Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
2fe744c8
Commit
2fe744c8
authored
Sep 15, 2006
by
petr/cps@owlet.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into mysql.com:/home/cps/mysql/trees/5.1-runtime-new
parents
10221798
f6663df6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
29 deletions
+33
-29
mysql-test/r/log_tables.result
mysql-test/r/log_tables.result
+9
-9
mysql-test/t/log_tables.test
mysql-test/t/log_tables.test
+9
-9
sql/handler.h
sql/handler.h
+1
-0
sql/share/errmsg.txt
sql/share/errmsg.txt
+4
-0
sql/sql_table.cc
sql/sql_table.cc
+4
-5
storage/csv/ha_tina.cc
storage/csv/ha_tina.cc
+1
-1
storage/myisam/ha_myisam.cc
storage/myisam/ha_myisam.cc
+1
-1
storage/myisam/mi_write.c
storage/myisam/mi_write.c
+4
-4
No files found.
mysql-test/r/log_tables.result
View file @
2fe744c8
...
...
@@ -73,16 +73,16 @@ select * from mysql.slow_log;
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text
TIMESTAMP USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 select sleep(2)
alter table mysql.general_log engine=myisam;
ERROR HY000: You can
'
t alter a log table if logging is enabled
ERROR HY000: You can
no
t alter a log table if logging is enabled
alter table mysql.slow_log engine=myisam;
ERROR HY000: You can
'
t alter a log table if logging is enabled
ERROR HY000: You can
no
t alter a log table if logging is enabled
drop table mysql.general_log;
ERROR HY000:
Cannot drop log table if lo
g is enabled
ERROR HY000:
You cannot drop a log table if loggin
g is enabled
drop table mysql.slow_log;
ERROR HY000:
Cannot drop log table if lo
g is enabled
ERROR HY000:
You cannot drop a log table if loggin
g is enabled
set global general_log='OFF';
alter table mysql.slow_log engine=myisam;
ERROR HY000: You can
'
t alter a log table if logging is enabled
ERROR HY000: You can
no
t alter a log table if logging is enabled
set global slow_query_log='OFF';
show create table mysql.general_log;
Table Create Table
...
...
@@ -173,13 +173,13 @@ unlock tables;
set global general_log='OFF';
set global slow_query_log='OFF';
alter table mysql.slow_log engine=ndb;
ERROR HY000:
One can use only CSV and MyISAM engines for the log tables
ERROR HY000:
This storage engine cannot be used for log tables"
alter table mysql.slow_log engine=innodb;
ERROR HY000:
One can use only CSV and MyISAM engines for the log tables
ERROR HY000:
This storage engine cannot be used for log tables"
alter table mysql.slow_log engine=archive;
ERROR HY000:
One can use only CSV and MyISAM engines for the log tables
ERROR HY000:
This storage engine cannot be used for log tables"
alter table mysql.slow_log engine=blackhole;
ERROR HY000:
One can use only CSV and MyISAM engines for the log tables
ERROR HY000:
This storage engine cannot be used for log tables"
drop table mysql.slow_log;
drop table mysql.general_log;
drop table mysql.general_log;
...
...
mysql-test/t/log_tables.test
View file @
2fe744c8
...
...
@@ -178,21 +178,21 @@ select * from mysql.slow_log;
# check that appropriate error messages are given when one attempts to alter
# or drop a log tables, while corresponding logs are enabled
--
error
ER_
CANT_ALTER_LOG_TABLE
--
error
ER_
BAD_LOG_STATEMENT
alter
table
mysql
.
general_log
engine
=
myisam
;
--
error
ER_
CANT_ALTER_LOG_TABLE
--
error
ER_
BAD_LOG_STATEMENT
alter
table
mysql
.
slow_log
engine
=
myisam
;
--
error
ER_
CANT_DROP_LOG_TABLE
--
error
ER_
BAD_LOG_STATEMENT
drop
table
mysql
.
general_log
;
--
error
ER_
CANT_DROP_LOG_TABLE
--
error
ER_
BAD_LOG_STATEMENT
drop
table
mysql
.
slow_log
;
# check that one can alter log tables to MyISAM
set
global
general_log
=
'OFF'
;
# cannot convert another log table
--
error
ER_
CANT_ALTER_LOG_TABLE
--
error
ER_
BAD_LOG_STATEMENT
alter
table
mysql
.
slow_log
engine
=
myisam
;
# alter both tables
...
...
@@ -252,13 +252,13 @@ set global general_log='OFF';
set
global
slow_query_log
=
'OFF'
;
# check that alter table doesn't work for other engines
--
error
ER_
BA
D_LOG_ENGINE
--
error
ER_
UNSUPORTE
D_LOG_ENGINE
alter
table
mysql
.
slow_log
engine
=
ndb
;
--
error
ER_
BA
D_LOG_ENGINE
--
error
ER_
UNSUPORTE
D_LOG_ENGINE
alter
table
mysql
.
slow_log
engine
=
innodb
;
--
error
ER_
BA
D_LOG_ENGINE
--
error
ER_
UNSUPORTE
D_LOG_ENGINE
alter
table
mysql
.
slow_log
engine
=
archive
;
--
error
ER_
BA
D_LOG_ENGINE
--
error
ER_
UNSUPORTE
D_LOG_ENGINE
alter
table
mysql
.
slow_log
engine
=
blackhole
;
drop
table
mysql
.
slow_log
;
...
...
sql/handler.h
View file @
2fe744c8
...
...
@@ -690,6 +690,7 @@ struct handlerton
#define HTON_FLUSH_AFTER_RENAME (1 << 4)
#define HTON_NOT_USER_SELECTABLE (1 << 5)
#define HTON_TEMPORARY_NOT_SUPPORTED (1 << 6) //Having temporary tables not supported
#define HTON_SUPPORT_LOG_TABLES (1 << 7) //Engine supports log tables
typedef
struct
st_thd_trans
{
...
...
sql/share/errmsg.txt
View file @
2fe744c8
...
...
@@ -5990,3 +5990,7 @@ ER_HOSTNAME
eng "host name"
ER_WRONG_STRING_LENGTH
eng "String '%-.70s' is too long for %s (should be no longer than %d)"
ER_UNSUPORTED_LOG_ENGINE
eng "This storage engine cannot be used for log tables""
ER_BAD_LOG_STATEMENT
eng "You cannot %s a log table if logging is enabled"
sql/sql_table.cc
View file @
2fe744c8
...
...
@@ -1628,7 +1628,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
(
!
my_strcasecmp
(
system_charset_info
,
table
->
table_name
,
"slow_log"
)
&&
opt_slow_log
&&
logger
.
is_slow_log_table_enabled
())))
{
my_error
(
ER_
CANT_DROP_LOG_TABLE
,
MYF
(
0
)
);
my_error
(
ER_
BAD_LOG_STATEMENT
,
MYF
(
0
),
"drop"
);
DBUG_RETURN
(
1
);
}
}
...
...
@@ -5179,7 +5179,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
(
table_kind
==
SLOW_LOG
&&
opt_slow_log
&&
logger
.
is_slow_log_table_enabled
()))
{
my_error
(
ER_
CANT_ALTER_LOG_TABLE
,
MYF
(
0
)
);
my_error
(
ER_
BAD_LOG_STATEMENT
,
MYF
(
0
),
"alter"
);
DBUG_RETURN
(
TRUE
);
}
...
...
@@ -5187,10 +5187,9 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
if
((
table_kind
==
GENERAL_LOG
||
table_kind
==
SLOW_LOG
)
&&
(
lex_create_info
->
used_fields
&
HA_CREATE_USED_ENGINE
)
&&
(
!
lex_create_info
->
db_type
||
/* unknown engine */
!
(
lex_create_info
->
db_type
->
db_type
==
DB_TYPE_MYISAM
||
lex_create_info
->
db_type
->
db_type
==
DB_TYPE_CSV_DB
)))
!
(
lex_create_info
->
db_type
->
flags
&
HTON_SUPPORT_LOG_TABLES
)))
{
my_error
(
ER_
BA
D_LOG_ENGINE
,
MYF
(
0
));
my_error
(
ER_
UNSUPORTE
D_LOG_ENGINE
,
MYF
(
0
));
DBUG_RETURN
(
TRUE
);
}
}
...
...
storage/csv/ha_tina.cc
View file @
2fe744c8
...
...
@@ -162,7 +162,7 @@ static int tina_init_func()
tina_hton
.
db_type
=
DB_TYPE_CSV_DB
;
tina_hton
.
create
=
tina_create_handler
;
tina_hton
.
panic
=
tina_end
;
tina_hton
.
flags
=
HTON_CAN_RECREATE
;
tina_hton
.
flags
=
HTON_CAN_RECREATE
|
HTON_SUPPORT_LOG_TABLES
;
}
return
0
;
}
...
...
storage/myisam/ha_myisam.cc
View file @
2fe744c8
...
...
@@ -1783,7 +1783,7 @@ static int myisam_init()
myisam_hton
.
db_type
=
DB_TYPE_MYISAM
;
myisam_hton
.
create
=
myisam_create_handler
;
myisam_hton
.
panic
=
mi_panic
;
myisam_hton
.
flags
=
HTON_CAN_RECREATE
;
myisam_hton
.
flags
=
HTON_CAN_RECREATE
|
HTON_SUPPORT_LOG_TABLES
;
return
0
;
}
...
...
storage/myisam/mi_write.c
View file @
2fe744c8
...
...
@@ -167,13 +167,13 @@ int mi_write(MI_INFO *info, byte *record)
/*
Update status of the table. We need to do so after each row write
for the log tables, as we want the new row to become visible to
other threads as soon as possible. We lock mutex here to follow
pthread memory visibility rules.
other threads as soon as possible. We don't lock mutex here
(as it is required by pthread memory visibility rules) as (1) it's
not critical to use outdated share->is_log_table value (2) locking
mutex here for every write is too expensive.
*/
pthread_mutex_lock
(
&
share
->
intern_lock
);
if
(
share
->
is_log_table
)
mi_update_status
((
void
*
)
info
);
pthread_mutex_unlock
(
&
share
->
intern_lock
);
allow_break
();
/* Allow SIGHUP & SIGINT */
DBUG_RETURN
(
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment