diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-03-11 17:30:56 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-03-11 17:30:56 -0300 |
commit | 402bc523b2105e31e9ac37eb94eb5b15c3ccf66a (patch) | |
tree | d672fd8c16180cf05a73eb32d08e77a091a2adaa /mysql-test/r/log_tables.result | |
parent | f79cb0de91a6b320966a7675dd6998c0bcf128e5 (diff) | |
download | mariadb-git-402bc523b2105e31e9ac37eb94eb5b15c3ccf66a.tar.gz |
Bug#36540: CREATE EVENT and ALTER EVENT statements fail with large server_id
The problem is that creating a event could fail if the value of
the variable server_id didn't fit in the originator column of
the event system table. The cause is two-fold: it was possible
to set server_id to a value outside the documented range (from
0 to 2^32-1) and the originator column of the event table didn't
have enough room for values in this range.
The log tables (general_log and slow_log) also don't have a proper
column type to store the server_id and having a large server_id
value could prevent queries from being logged.
The solution is to ensure that all system tables that store the
server_id value have a proper column type (int unsigned) and that
the variable can't be set to a value that is not within the range.
mysql-test/r/events_bugs.result:
Add test case result for Bug#36540
mysql-test/r/log_tables.result:
Update column type.
mysql-test/r/system_mysql_db.result:
Update column type.
mysql-test/r/variables.result:
Add test case result for server_id value range.
mysql-test/suite/sys_vars/r/server_id_basic_64.result:
Update test case results.
mysql-test/t/events_bugs.test:
Add test case for Bug#36540
mysql-test/t/log_tables.test:
Fix column type.
mysql-test/t/variables.test:
Add test case for server_id value range.
scripts/mysql_system_tables.sql:
Columns that store the server_id value must be of type INT UNSIGNED,
fix event (originator), general_log and slow_log (server_id) tables
in accordance.
scripts/mysql_system_tables_fix.sql:
Columns that store the server_id value must be of type INT UNSIGNED,
fix event (originator), general_log and slow_log (server_id) tables
in accordance.
sql/mysqld.cc:
Set min and max values for the server_id variable.
Unfortunately we can't easily change server_id variable type
from ulong to uint32 because of the sys_var classes.
Diffstat (limited to 'mysql-test/r/log_tables.result')
-rw-r--r-- | mysql-test/r/log_tables.result | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result index 376120abcda..f8321520880 100644 --- a/mysql-test/r/log_tables.result +++ b/mysql-test/r/log_tables.result @@ -56,7 +56,7 @@ general_log CREATE TABLE `general_log` ( `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `user_host` mediumtext NOT NULL, `thread_id` int(11) NOT NULL, - `server_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, `command_type` varchar(64) NOT NULL, `argument` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log' @@ -65,7 +65,7 @@ Field Type Null Key Default Extra event_time timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP user_host mediumtext NO NULL thread_id int(11) NO NULL -server_id int(11) NO NULL +server_id int(10) unsigned NO NULL command_type varchar(64) NO NULL argument mediumtext NO NULL show create table mysql.slow_log; @@ -80,7 +80,7 @@ slow_log CREATE TABLE `slow_log` ( `db` varchar(512) NOT NULL, `last_insert_id` int(11) NOT NULL, `insert_id` int(11) NOT NULL, - `server_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, `sql_text` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log' show fields from mysql.slow_log; @@ -94,7 +94,7 @@ rows_examined int(11) NO NULL db varchar(512) NO NULL last_insert_id int(11) NO NULL insert_id int(11) NO NULL -server_id int(11) NO NULL +server_id int(10) unsigned NO NULL sql_text mediumtext NO NULL flush logs; flush tables; @@ -167,7 +167,7 @@ general_log CREATE TABLE `general_log` ( `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `user_host` mediumtext NOT NULL, `thread_id` int(11) NOT NULL, - `server_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, `command_type` varchar(64) NOT NULL, `argument` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log' @@ -183,7 +183,7 @@ slow_log CREATE TABLE `slow_log` ( `db` varchar(512) NOT NULL, `last_insert_id` int(11) NOT NULL, `insert_id` int(11) NOT NULL, - `server_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, `sql_text` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log' alter table mysql.general_log engine=myisam; @@ -194,7 +194,7 @@ general_log CREATE TABLE `general_log` ( `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `user_host` mediumtext NOT NULL, `thread_id` int(11) NOT NULL, - `server_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, `command_type` varchar(64) NOT NULL, `argument` mediumtext NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='General log' @@ -210,7 +210,7 @@ slow_log CREATE TABLE `slow_log` ( `db` varchar(512) NOT NULL, `last_insert_id` int(11) NOT NULL, `insert_id` int(11) NOT NULL, - `server_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, `sql_text` mediumtext NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Slow log' set global general_log='ON'; @@ -268,7 +268,7 @@ CREATE TABLE `general_log` ( ON UPDATE CURRENT_TIMESTAMP, `user_host` mediumtext NOT NULL, `thread_id` int(11) NOT NULL, -`server_id` int(11) NOT NULL, +`server_id` int(10) unsigned NOT NULL, `command_type` varchar(64) NOT NULL, `argument` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'; @@ -283,7 +283,7 @@ ON UPDATE CURRENT_TIMESTAMP, `db` varchar(512) NOT NULL, `last_insert_id` int(11) NOT NULL, `insert_id` int(11) NOT NULL, -`server_id` int(11) NOT NULL, +`server_id` int(10) unsigned NOT NULL, `sql_text` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'; set global general_log='ON'; |