From 9f9b8cfc4cf45f174d03f8ee0703376ca0bbf417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 16 Jan 2012 16:39:05 +0200 Subject: Add missing sys_vars tests for InnoDB variables. --- mysql-test/suite/sys_vars/r/all_vars.result | 2 - .../r/innodb_change_buffering_debug_basic.result | 64 +++++++++++++++++++++ .../r/innodb_trx_rseg_n_slots_debug_basic.result | 65 ++++++++++++++++++++++ mysql-test/suite/sys_vars/t/all_vars.test | 4 -- .../t/innodb_change_buffering_debug_basic.test | 52 +++++++++++++++++ .../t/innodb_trx_rseg_n_slots_debug_basic.test | 53 ++++++++++++++++++ 6 files changed, 234 insertions(+), 6 deletions(-) create mode 100644 mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_trx_rseg_n_slots_debug_basic.result create mode 100644 mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_trx_rseg_n_slots_debug_basic.test (limited to 'mysql-test') diff --git a/mysql-test/suite/sys_vars/r/all_vars.result b/mysql-test/suite/sys_vars/r/all_vars.result index ee46a155cb0..0f741ff930a 100644 --- a/mysql-test/suite/sys_vars/r/all_vars.result +++ b/mysql-test/suite/sys_vars/r/all_vars.result @@ -3,8 +3,6 @@ create table t2 (variable_name text); load data infile "MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t1; insert into t2 select variable_name from information_schema.global_variables; insert into t2 select variable_name from information_schema.session_variables; -delete from t2 where variable_name='innodb_change_buffering_debug'; -delete from t2 where variable_name='innodb_trx_rseg_n_slots_debug'; update t2 set variable_name= replace(variable_name, "PERFORMANCE_SCHEMA_", "PFS_"); select variable_name as `There should be *no* long test name listed below:` from t2 where length(variable_name) > 50; diff --git a/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result new file mode 100644 index 00000000000..2b74f891050 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result @@ -0,0 +1,64 @@ +SET @start_global_value = @@global.innodb_change_buffering_debug; +SELECT @start_global_value; +@start_global_value +0 +select @@global.innodb_change_buffering_debug in (0, 1); +@@global.innodb_change_buffering_debug in (0, 1) +1 +select @@global.innodb_change_buffering_debug; +@@global.innodb_change_buffering_debug +0 +select @@session.innodb_change_buffering_debug; +ERROR HY000: Variable 'innodb_change_buffering_debug' is a GLOBAL variable +show global variables like 'innodb_change_buffering_debug'; +Variable_name Value +innodb_change_buffering_debug 0 +show session variables like 'innodb_change_buffering_debug'; +Variable_name Value +innodb_change_buffering_debug 0 +select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING_DEBUG 0 +select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING_DEBUG 0 +set global innodb_change_buffering_debug=1; +select @@global.innodb_change_buffering_debug; +@@global.innodb_change_buffering_debug +1 +select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING_DEBUG 1 +select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING_DEBUG 1 +set @@global.innodb_change_buffering_debug=0; +select @@global.innodb_change_buffering_debug; +@@global.innodb_change_buffering_debug +0 +select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING_DEBUG 0 +select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING_DEBUG 0 +set session innodb_change_buffering_debug='some'; +ERROR HY000: Variable 'innodb_change_buffering_debug' is a GLOBAL variable and should be set with SET GLOBAL +set @@session.innodb_change_buffering_debug='some'; +ERROR HY000: Variable 'innodb_change_buffering_debug' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_change_buffering_debug=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering_debug' +set global innodb_change_buffering_debug='foo'; +ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering_debug' +set global innodb_change_buffering_debug=-2; +Warnings: +Warning 1292 Truncated incorrect innodb_change_buffering_debug value: '-2' +set global innodb_change_buffering_debug=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering_debug' +set global innodb_change_buffering_debug=2; +Warnings: +Warning 1292 Truncated incorrect innodb_change_buffering_debug value: '2' +SET @@global.innodb_change_buffering_debug = @start_global_value; +SELECT @@global.innodb_change_buffering_debug; +@@global.innodb_change_buffering_debug +0 diff --git a/mysql-test/suite/sys_vars/r/innodb_trx_rseg_n_slots_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_trx_rseg_n_slots_debug_basic.result new file mode 100644 index 00000000000..7e253c869e3 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_trx_rseg_n_slots_debug_basic.result @@ -0,0 +1,65 @@ +SET @start_global_value = @@global.innodb_trx_rseg_n_slots_debug; +SELECT @start_global_value; +@start_global_value +0 +select @@global.innodb_trx_rseg_n_slots_debug between 0 and 1024; +@@global.innodb_trx_rseg_n_slots_debug between 0 and 1024 +1 +select @@global.innodb_trx_rseg_n_slots_debug; +@@global.innodb_trx_rseg_n_slots_debug +0 +select @@session.innodb_trx_rseg_n_slots_debug; +ERROR HY000: Variable 'innodb_trx_rseg_n_slots_debug' is a GLOBAL variable +show global variables like 'innodb_trx_rseg_n_slots_debug'; +Variable_name Value +innodb_trx_rseg_n_slots_debug 0 +show session variables like 'innodb_trx_rseg_n_slots_debug'; +Variable_name Value +innodb_trx_rseg_n_slots_debug 0 +select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_RSEG_N_SLOTS_DEBUG 0 +select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_RSEG_N_SLOTS_DEBUG 0 +set global innodb_trx_rseg_n_slots_debug=1; +select @@global.innodb_trx_rseg_n_slots_debug; +@@global.innodb_trx_rseg_n_slots_debug +1 +select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_RSEG_N_SLOTS_DEBUG 1 +select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_RSEG_N_SLOTS_DEBUG 1 +set @@global.innodb_trx_rseg_n_slots_debug=0; +select @@global.innodb_trx_rseg_n_slots_debug; +@@global.innodb_trx_rseg_n_slots_debug +0 +select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_RSEG_N_SLOTS_DEBUG 0 +select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_RSEG_N_SLOTS_DEBUG 0 +set session innodb_trx_rseg_n_slots_debug='some'; +ERROR HY000: Variable 'innodb_trx_rseg_n_slots_debug' is a GLOBAL variable and should be set with SET GLOBAL +set @@session.innodb_trx_rseg_n_slots_debug='some'; +ERROR HY000: Variable 'innodb_trx_rseg_n_slots_debug' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_trx_rseg_n_slots_debug=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_trx_rseg_n_slots_debug' +set global innodb_trx_rseg_n_slots_debug='foo'; +ERROR 42000: Incorrect argument type to variable 'innodb_trx_rseg_n_slots_debug' +set global innodb_trx_rseg_n_slots_debug=-2; +Warnings: +Warning 1292 Truncated incorrect innodb_trx_rseg_n_slots_debug value: '-2' +set global innodb_trx_rseg_n_slots_debug=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_trx_rseg_n_slots_debug' +set global innodb_trx_rseg_n_slots_debug=1024; +set global innodb_trx_rseg_n_slots_debug=1025; +Warnings: +Warning 1292 Truncated incorrect innodb_trx_rseg_n_slots_debug value: '1025' +SET @@global.innodb_trx_rseg_n_slots_debug = @start_global_value; +SELECT @@global.innodb_trx_rseg_n_slots_debug; +@@global.innodb_trx_rseg_n_slots_debug +0 diff --git a/mysql-test/suite/sys_vars/t/all_vars.test b/mysql-test/suite/sys_vars/t/all_vars.test index afb74c006e2..2f44ef43493 100644 --- a/mysql-test/suite/sys_vars/t/all_vars.test +++ b/mysql-test/suite/sys_vars/t/all_vars.test @@ -47,10 +47,6 @@ eval load data infile "$MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t insert into t2 select variable_name from information_schema.global_variables; insert into t2 select variable_name from information_schema.session_variables; -# This is only present in debug builds. -delete from t2 where variable_name='innodb_change_buffering_debug'; -delete from t2 where variable_name='innodb_trx_rseg_n_slots_debug'; - # Performance schema variables are too long for files named # 'mysql-test/suite/sys_vars/t/' ... # ... 'performance_schema_events_waits_history_long_size_basic-master.opt' diff --git a/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test new file mode 100644 index 00000000000..ec1065a538e --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test @@ -0,0 +1,52 @@ +--source include/have_innodb.inc +--source include/have_debug.inc + +SET @start_global_value = @@global.innodb_change_buffering_debug; +SELECT @start_global_value; + +# +# exists as global only +# +select @@global.innodb_change_buffering_debug in (0, 1); +select @@global.innodb_change_buffering_debug; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_change_buffering_debug; +show global variables like 'innodb_change_buffering_debug'; +show session variables like 'innodb_change_buffering_debug'; +select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug'; +select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug'; + +# +# show that it's writable +# +set global innodb_change_buffering_debug=1; +select @@global.innodb_change_buffering_debug; +select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug'; +select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug'; +set @@global.innodb_change_buffering_debug=0; +select @@global.innodb_change_buffering_debug; +select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug'; +select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug'; +--error ER_GLOBAL_VARIABLE +set session innodb_change_buffering_debug='some'; +--error ER_GLOBAL_VARIABLE +set @@session.innodb_change_buffering_debug='some'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_change_buffering_debug=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_change_buffering_debug='foo'; +set global innodb_change_buffering_debug=-2; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_change_buffering_debug=1e1; +set global innodb_change_buffering_debug=2; + +# +# Cleanup +# + +SET @@global.innodb_change_buffering_debug = @start_global_value; +SELECT @@global.innodb_change_buffering_debug; diff --git a/mysql-test/suite/sys_vars/t/innodb_trx_rseg_n_slots_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_trx_rseg_n_slots_debug_basic.test new file mode 100644 index 00000000000..d17917de8e9 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_trx_rseg_n_slots_debug_basic.test @@ -0,0 +1,53 @@ +--source include/have_innodb.inc +--source include/have_debug.inc + +SET @start_global_value = @@global.innodb_trx_rseg_n_slots_debug; +SELECT @start_global_value; + +# +# exists as global only +# +select @@global.innodb_trx_rseg_n_slots_debug between 0 and 1024; +select @@global.innodb_trx_rseg_n_slots_debug; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_trx_rseg_n_slots_debug; +show global variables like 'innodb_trx_rseg_n_slots_debug'; +show session variables like 'innodb_trx_rseg_n_slots_debug'; +select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; + +# +# show that it's writable +# +set global innodb_trx_rseg_n_slots_debug=1; +select @@global.innodb_trx_rseg_n_slots_debug; +select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +set @@global.innodb_trx_rseg_n_slots_debug=0; +select @@global.innodb_trx_rseg_n_slots_debug; +select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +--error ER_GLOBAL_VARIABLE +set session innodb_trx_rseg_n_slots_debug='some'; +--error ER_GLOBAL_VARIABLE +set @@session.innodb_trx_rseg_n_slots_debug='some'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_trx_rseg_n_slots_debug=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_trx_rseg_n_slots_debug='foo'; +set global innodb_trx_rseg_n_slots_debug=-2; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_trx_rseg_n_slots_debug=1e1; +set global innodb_trx_rseg_n_slots_debug=1024; +set global innodb_trx_rseg_n_slots_debug=1025; + +# +# Cleanup +# + +SET @@global.innodb_trx_rseg_n_slots_debug = @start_global_value; +SELECT @@global.innodb_trx_rseg_n_slots_debug; -- cgit v1.2.1 From beedf6b261b243ec0a2332162bface6ec7d58dd0 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Mon, 12 Dec 2011 14:07:02 +0100 Subject: Bug#12361113: CRASH WHEN "LOAD INDEX INTO CACHE" WITH TOO SMALL KEY CACHE The server crashed on division by zero because the key cache was not initialized and the block length was 0 which was used in a division. The fix was to not allow CACHE INDEX if the key cache was not initiallized. Thus never try LOAD INDEX INTO CACHE for an uninitialized key cache. Also added some windows files/directories to .bzrignore. --- mysql-test/r/key_cache.result | 16 ++++++++++++++++ mysql-test/t/key_cache.test | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result index 9ada5dc0784..6513c4eb374 100644 --- a/mysql-test/r/key_cache.result +++ b/mysql-test/r/key_cache.result @@ -368,3 +368,19 @@ Variable_name Value key_cache_block_size 1536 SET GLOBAL key_cache_block_size= @bug28478_key_cache_block_size; DROP TABLE t1; +# +# Bug#12361113: crash when load index into cache +# +# Note that this creates an empty disabled key cache! +SET GLOBAL key_cache_none.key_cache_block_size = 1024; +CREATE TABLE t1 (a INT, b INTEGER NOT NULL, KEY (b) ) ENGINE = MYISAM; +INSERT INTO t1 VALUES (1, 1); +CACHE INDEX t1 in key_cache_none; +ERROR HY000: Unknown key cache 'key_cache_none' +# The bug crashed the server at LOAD INDEX below. Now it will succeed +# since the default cache is used due to CACHE INDEX failed for +# key_cache_none. +LOAD INDEX INTO CACHE t1; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +DROP TABLE t1; diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index 4c14dc96aaa..9d865b9b5fe 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -247,3 +247,19 @@ SET GLOBAL key_cache_block_size= @bug28478_key_cache_block_size; DROP TABLE t1; # End of 4.1 tests + +--echo # +--echo # Bug#12361113: crash when load index into cache +--echo # + +--echo # Note that this creates an empty disabled key cache! +SET GLOBAL key_cache_none.key_cache_block_size = 1024; +CREATE TABLE t1 (a INT, b INTEGER NOT NULL, KEY (b) ) ENGINE = MYISAM; +INSERT INTO t1 VALUES (1, 1); +--error ER_UNKNOWN_KEY_CACHE +CACHE INDEX t1 in key_cache_none; +--echo # The bug crashed the server at LOAD INDEX below. Now it will succeed +--echo # since the default cache is used due to CACHE INDEX failed for +--echo # key_cache_none. +LOAD INDEX INTO CACHE t1; +DROP TABLE t1; -- cgit v1.2.1 From e5cb28793385566e22d5a82efdf3f6cb8dbe5cbc Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Thu, 15 Dec 2011 16:59:18 +0100 Subject: Post push fix for merge.test and mysqlcheck.test on windows --- mysql-test/r/mysqlcheck.result | 1 + mysql-test/t/merge.test | 10 +++++++--- mysql-test/t/mysqlcheck.test | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index 5f1a0565b10..ffba0d443e7 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -147,6 +147,7 @@ DROP TABLE `@`; CREATE TABLE `я` (a INT); SET NAMES DEFAULT; mysqlcheck --default-character-set="latin1" --databases test +call mtr.add_suppression("Can't find file: '..test.@003f.frm'"); test.? Error : Table doesn't exist status : Operation failed diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index a6affbb0540..7954aed6a55 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -1817,9 +1817,13 @@ CREATE TABLE t1(a INT); --echo # Test reattach merge failure LOCK TABLES m1 READ; --echo # Replace 't1' with 't3' table using file operations. -remove_file $MYSQLD_DATADIR/test/t1.frm; -remove_file $MYSQLD_DATADIR/test/t1.MYI; -remove_file $MYSQLD_DATADIR/test/t1.MYD; +# move + remove is a work around for windows. +move_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/oldt1.frm; +move_file $MYSQLD_DATADIR/test/t1.MYI $MYSQLD_DATADIR/test/oldt1.MYI; +move_file $MYSQLD_DATADIR/test/t1.MYD $MYSQLD_DATADIR/test/oldt1.MYD; +remove_file $MYSQLD_DATADIR/test/oldt1.frm; +remove_file $MYSQLD_DATADIR/test/oldt1.MYI; +remove_file $MYSQLD_DATADIR/test/oldt1.MYD; copy_file $MYSQLD_DATADIR/test/t3.frm $MYSQLD_DATADIR/test/t1.frm; copy_file $MYSQLD_DATADIR/test/t3.MYI $MYSQLD_DATADIR/test/t1.MYI; copy_file $MYSQLD_DATADIR/test/t3.MYD $MYSQLD_DATADIR/test/t1.MYD; diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index 986b5aba385..bf99d48fd6a 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -138,6 +138,7 @@ CREATE TABLE `я` (a INT); SET NAMES DEFAULT; --echo mysqlcheck --default-character-set="latin1" --databases test # Error returned depends on platform, replace it with "Table doesn't exist" +call mtr.add_suppression("Can't find file: '..test.@003f.frm'"); --replace_result "Can't find file: './test/@003f.frm' (errno: 22)" "Table doesn't exist" "Table 'test.?' doesn't exist" "Table doesn't exist" --exec $MYSQL_CHECK --default-character-set="latin1" --databases test --echo mysqlcheck --default-character-set="utf8" --databases test -- cgit v1.2.1 From 16036b5e61d8f48f352ac4e1f68a541f45f2ae34 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Fri, 16 Dec 2011 12:17:13 +0400 Subject: Test case for BUG11763712 is intended for 5.1 only. --- mysql-test/r/merge.result | 5 ----- mysql-test/t/merge.test | 53 ----------------------------------------------- 2 files changed, 58 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index cd56b5eca5c..6e4e6c5a443 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -2403,11 +2403,6 @@ REPAIR TABLE m1; Table Op Msg_type Msg_text test.m1 repair note The storage engine for the table doesn't support repair DROP TABLE m1, t1; -# -# BUG#11763712 - 56458: KILLING A FLUSH TABLE FOR A MERGE/CHILD -# CRASHES SERVER -# -# Disabled in 5.5 by Mattias. TODO: FIX THIS! End of 5.1 tests # # An additional test case for Bug#27430 Crash in subquery code diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 64327400a4f..74110962299 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -1812,59 +1812,6 @@ REPAIR TABLE m1; # DROP TABLE m1, t1; - ---echo # ---echo # BUG#11763712 - 56458: KILLING A FLUSH TABLE FOR A MERGE/CHILD ---echo # CRASHES SERVER ---echo # ---echo # Disabled in 5.5 by Mattias. TODO: FIX THIS! -if (0) -{ -CREATE TABLE t1(a INT); -CREATE TABLE t2(a INT); -CREATE TABLE t3(a INT, b INT); -CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2); - ---echo # Test reopen merge parent failure -LOCK TABLES m1 READ; ---echo # Remove 'm1' table using file operations. -remove_file $MYSQLD_DATADIR/test/m1.MRG; -remove_file $MYSQLD_DATADIR/test/m1.frm; ---error ER_NO_SUCH_TABLE -FLUSH TABLES; -UNLOCK TABLES; -CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2); - ---echo # Test reopen merge child failure -LOCK TABLES m1 READ; ---echo # Remove 't1' table using file operations. -remove_file $MYSQLD_DATADIR/test/t1.frm; -remove_file $MYSQLD_DATADIR/test/t1.MYI; -remove_file $MYSQLD_DATADIR/test/t1.MYD; ---error ER_NO_SUCH_TABLE -FLUSH TABLES; -UNLOCK TABLES; -CREATE TABLE t1(a INT); - ---echo # Test reattach merge failure -LOCK TABLES m1 READ; ---echo # Replace 't1' with 't3' table using file operations. -# move + remove is a work around for windows. -move_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/oldt1.frm; -move_file $MYSQLD_DATADIR/test/t1.MYI $MYSQLD_DATADIR/test/oldt1.MYI; -move_file $MYSQLD_DATADIR/test/t1.MYD $MYSQLD_DATADIR/test/oldt1.MYD; -remove_file $MYSQLD_DATADIR/test/oldt1.frm; -remove_file $MYSQLD_DATADIR/test/oldt1.MYI; -remove_file $MYSQLD_DATADIR/test/oldt1.MYD; -copy_file $MYSQLD_DATADIR/test/t3.frm $MYSQLD_DATADIR/test/t1.frm; -copy_file $MYSQLD_DATADIR/test/t3.MYI $MYSQLD_DATADIR/test/t1.MYI; -copy_file $MYSQLD_DATADIR/test/t3.MYD $MYSQLD_DATADIR/test/t1.MYD; ---error ER_CANT_REOPEN_TABLE -FLUSH TABLES; -UNLOCK TABLES; -DROP TABLE t1, t2, t3, m1; -} - --echo End of 5.1 tests --echo # -- cgit v1.2.1 From 8a8155f11fd290a95951d41aa29e94fa9f346101 Mon Sep 17 00:00:00 2001 From: Sneha Modi Date: Wed, 21 Dec 2011 15:14:55 +0530 Subject: Bug#11754150: A TEST CASE FOR BUG#6857 IS DISABLED IN SP.TEST The time comparison using current_time() stored in an int variable was giving wrong results as the current_time() format as an int implementation has been changed in mysql-trunk but not in mysql-5.5. The time is stored in the format hh:mm:ss as 'time' datatype.But as an int, it is stored as hhmmss, but only on the trunk. On mysql-5.5,as an int, it is stored as hh. Hence, the current_time() function has been changed to unix_timestamp() function. --- mysql-test/r/sp.result | 7 +++++-- mysql-test/t/sp.test | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 1644c764431..a48f82af915 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -2776,16 +2776,19 @@ create procedure bug6857(counter int) begin declare t0, t1 int; declare plus bool default 0; -set t0 = current_time(); +set t0 = unix_timestamp(); while counter > 0 do set counter = counter - 1; end while; -set t1 = current_time(); +set t1 = unix_timestamp(); if t1 > t0 then set plus = 1; end if; select plus; end| +call bug6857(300000)| +plus +1 drop procedure bug6857| drop procedure if exists bug8757| create procedure bug8757() diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 3f6c50a9095..6ac88f4f5bf 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -3341,11 +3341,11 @@ begin declare t0, t1 int; declare plus bool default 0; - set t0 = current_time(); + set t0 = unix_timestamp(); while counter > 0 do set counter = counter - 1; end while; - set t1 = current_time(); + set t1 = unix_timestamp(); if t1 > t0 then set plus = 1; end if; @@ -3357,7 +3357,7 @@ end| # painful. # Make sure this takes at least one second on all machines in all builds. # 30000 makes it about 3 seconds on an old 1.1GHz linux. -#call bug6857(300000)| +call bug6857(300000)| drop procedure bug6857| -- cgit v1.2.1 From 11fd796f8d3394a5b0c7133109e7a06961e6307b Mon Sep 17 00:00:00 2001 From: Sneha Modi Date: Wed, 21 Dec 2011 19:00:07 +0530 Subject: Bug#11754150: A TEST CASE FOR BUG#6857 IS DISABLED IN SP.TEST Unix_timestamp for time comparison has some problems...Re-using current_time for time comparison. --- mysql-test/r/sp.result | 7 ++----- mysql-test/t/sp.test | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index a48f82af915..1644c764431 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -2776,19 +2776,16 @@ create procedure bug6857(counter int) begin declare t0, t1 int; declare plus bool default 0; -set t0 = unix_timestamp(); +set t0 = current_time(); while counter > 0 do set counter = counter - 1; end while; -set t1 = unix_timestamp(); +set t1 = current_time(); if t1 > t0 then set plus = 1; end if; select plus; end| -call bug6857(300000)| -plus -1 drop procedure bug6857| drop procedure if exists bug8757| create procedure bug8757() diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 6ac88f4f5bf..3f6c50a9095 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -3341,11 +3341,11 @@ begin declare t0, t1 int; declare plus bool default 0; - set t0 = unix_timestamp(); + set t0 = current_time(); while counter > 0 do set counter = counter - 1; end while; - set t1 = unix_timestamp(); + set t1 = current_time(); if t1 > t0 then set plus = 1; end if; @@ -3357,7 +3357,7 @@ end| # painful. # Make sure this takes at least one second on all machines in all builds. # 30000 makes it about 3 seconds on an old 1.1GHz linux. -call bug6857(300000)| +#call bug6857(300000)| drop procedure bug6857| -- cgit v1.2.1 From 805989f6cea992f93f4755ac44860919f9fee2c8 Mon Sep 17 00:00:00 2001 From: Sneha Modi Date: Thu, 22 Dec 2011 16:39:08 +0530 Subject: Bug#11754150: A TEST CASE FOR BUG#6857 IS DISABLED IN SP.TEST unix_timestamp() is implemented in this part of the code in place of current_time(). Also, since the pb2 machines may be extremely fast, instead of looping through the code, we use sleep(1.1) so that the variables t0 and t1 have different values. --- mysql-test/r/sp.result | 15 +++++++++------ mysql-test/t/sp.test | 17 +++++------------ 2 files changed, 14 insertions(+), 18 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 1644c764431..07c945db5e6 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -2772,20 +2772,23 @@ userid drop procedure bug8116| drop table t3| drop procedure if exists bug6857| -create procedure bug6857(counter int) +create procedure bug6857() begin declare t0, t1 int; declare plus bool default 0; -set t0 = current_time(); -while counter > 0 do -set counter = counter - 1; -end while; -set t1 = current_time(); +set t0 = unix_timestamp(); +select sleep(1.1); +set t1 = unix_timestamp(); if t1 > t0 then set plus = 1; end if; select plus; end| +call bug6857()| +sleep(1.1) +0 +plus +1 drop procedure bug6857| drop procedure if exists bug8757| create procedure bug8757() diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 3f6c50a9095..a6e06e4aabe 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -3336,28 +3336,21 @@ drop table t3| --disable_warnings drop procedure if exists bug6857| --enable_warnings -create procedure bug6857(counter int) +create procedure bug6857() begin declare t0, t1 int; declare plus bool default 0; - set t0 = current_time(); - while counter > 0 do - set counter = counter - 1; - end while; - set t1 = current_time(); + set t0 = unix_timestamp(); + select sleep(1.1); + set t1 = unix_timestamp(); if t1 > t0 then set plus = 1; end if; select plus; end| -# QQ: This is currently disabled. Not only does it slow down a normal test -# run, it makes running with valgrind (or similar tools) extremely -# painful. -# Make sure this takes at least one second on all machines in all builds. -# 30000 makes it about 3 seconds on an old 1.1GHz linux. -#call bug6857(300000)| +call bug6857()| drop procedure bug6857| -- cgit v1.2.1 From 086ee89a38b548ebdbfd7373c76abd66a81d344c Mon Sep 17 00:00:00 2001 From: Sneha Modi Date: Thu, 22 Dec 2011 23:11:48 +0530 Subject: Bug#11754150: A test case for Bug#6857 has been disabled in sp.test: An extra space was inserted in the code by mistake which was producing a result content mismatch. --- mysql-test/t/sp.test | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index a6e06e4aabe..d0fe9779da9 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -3340,9 +3340,8 @@ create procedure bug6857() begin declare t0, t1 int; declare plus bool default 0; - set t0 = unix_timestamp(); - select sleep(1.1); + select sleep(1.1); set t1 = unix_timestamp(); if t1 > t0 then set plus = 1; -- cgit v1.2.1 From 5e487124aaeb6628e241301f16960e81a1e04035 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Fri, 23 Dec 2011 23:05:00 +0530 Subject: Bug#12809202 61854: MYSQLDUMP --SINGLE-TRANSACTION --FLUSH-LOG BREAKS CONSISTENCY The transaction started by mysqldump gets committed implicitly when flush-log is specified along with single-transaction option, and hence can break consistency. This is because, COM_REFRESH is executed in order to flush logs and starting from 5.5 this command performs an implicit commit. Fixed by making sure that COM_REFRESH is executed before the transaction has started and not after it. Note : This patch triggers following behavioral changes in mysqldump : 1) After this patch we no longer flush logs before dumping each database if --single-transaction option is given like it was done before (in the absence of --lock-all-tables and --master-data options). 2) Also, after this patch, we start acquiring FTWRL before flushing logs in cases when only --single-transaction and --flush-logs are given. It becomes safe to use mysqldump with these two options and without --master-data parameter for backups. client/mysqldump.c: Bug#12809202 61854: MYSQLDUMP --SINGLE-TRANSACTION --FLUSH-LOG BREAKS CONSISTENCY Added logic to make sure that, if flush-log option is specified, mysql_refresh() is never executed after the transaction has started. Added verbose messages for all the executions of mysql_refresh() in order to track its invocation. mysql-test/r/mysqldump.result: Added test case for Bug#12809202. mysql-test/t/mysqldump.test: Added test case for Bug#12809202. --- mysql-test/r/mysqldump.result | 100 ++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/mysqldump.test | 32 ++++++++++++++ 2 files changed, 132 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 8f6add75fd3..5d03976f3a5 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -4662,3 +4662,103 @@ UNLOCK TABLES; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; +# +# Bug#12809202 61854: MYSQLDUMP --SINGLE-TRANSACTION --FLUSH-LOG BREAKS +# CONSISTENCY +# +DROP DATABASE IF EXISTS b12809202_db; +CREATE DATABASE b12809202_db; +CREATE TABLE b12809202_db.t1 (c1 INT); +CREATE TABLE b12809202_db.t2 (c1 INT); +INSERT INTO b12809202_db.t1 VALUES (1), (2), (3); +INSERT INTO b12809202_db.t2 VALUES (1), (2), (3); +# Starting mysqldump with --single-transaction & --flush-log options.. +# Note : In the following dump the transaction +# should start only after the logs are +# flushed, as 'flush logs' causes implicit +# commit starting 5.5. + +#### Dump starts here #### +-- Connecting to localhost... +-- main : logs flushed successfully! +-- Starting transaction... +-- Retrieving table structure for table t1... +-- Sending SELECT query... +-- Retrieving rows... +-- +-- Host: localhost Database: b12809202_db +-- ------------------------------------------------------ + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `t1` +-- + +DROP TABLE IF EXISTS `t1`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `c1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `t1` +-- + +LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +INSERT INTO `t1` VALUES (1),(2),(3); +-- Retrieving table structure for table t2... +-- Sending SELECT query... +-- Retrieving rows... +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `t2` +-- + +DROP TABLE IF EXISTS `t2`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t2` ( + `c1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `t2` +-- + +LOCK TABLES `t2` WRITE; +/*!40000 ALTER TABLE `t2` DISABLE KEYS */; +INSERT INTO `t2` VALUES (1),(2),(3); +/*!40000 ALTER TABLE `t2` ENABLE KEYS */; +UNLOCK TABLES; +-- Disconnecting from localhost... +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed +#### Dump ends here #### +DROP TABLE b12809202_db.t1; +DROP TABLE b12809202_db.t2; +DROP DATABASE b12809202_db; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index e224bf6afe3..b1688986090 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2215,5 +2215,37 @@ CREATE TABLE t1 (a INT); --exec $MYSQL_DUMP --compatible=no_t,no_f --skip-comments test DROP TABLE t1; +--echo # +--echo # Bug#12809202 61854: MYSQLDUMP --SINGLE-TRANSACTION --FLUSH-LOG BREAKS +--echo # CONSISTENCY +--echo # + +--disable_warnings +DROP DATABASE IF EXISTS b12809202_db; +--enable_warnings + +CREATE DATABASE b12809202_db; +CREATE TABLE b12809202_db.t1 (c1 INT); +CREATE TABLE b12809202_db.t2 (c1 INT); + +INSERT INTO b12809202_db.t1 VALUES (1), (2), (3); +INSERT INTO b12809202_db.t2 VALUES (1), (2), (3); + +--echo # Starting mysqldump with --single-transaction & --flush-log options.. +--echo # Note : In the following dump the transaction +--echo # should start only after the logs are +--echo # flushed, as 'flush logs' causes implicit +--echo # commit starting 5.5. +--echo +--echo #### Dump starts here #### +--replace_regex /-- Server version.*// /-- MySQL dump .*// /-- Dump completed on .*/-- Dump completed/ +--exec $MYSQL_DUMP --verbose --single-transaction --flush-log b12809202_db 2>&1 +--echo +--echo #### Dump ends here #### + +DROP TABLE b12809202_db.t1; +DROP TABLE b12809202_db.t2; +DROP DATABASE b12809202_db; + # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc -- cgit v1.2.1 From 49d2790aff0cd579b7f101c26e39afdd0ba2524c Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Sat, 24 Dec 2011 15:08:59 +0530 Subject: Bug#12809202 61854: MYSQLDUMP --SINGLE-TRANSACTION --FLUSH-LOG BREAKS CONSISTENCY Post-fix for some failing tests. --- mysql-test/r/mysqldump.result | 4 ++++ mysql-test/t/mysqldump.test | 6 ++++++ 2 files changed, 10 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 5d03976f3a5..ee9b6a878cd 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -4762,3 +4762,7 @@ UNLOCK TABLES; DROP TABLE b12809202_db.t1; DROP TABLE b12809202_db.t2; DROP DATABASE b12809202_db; +# +# Delete all existing binary logs. +# +RESET MASTER; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index b1688986090..871b3735b1b 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2243,9 +2243,15 @@ INSERT INTO b12809202_db.t2 VALUES (1), (2), (3); --echo --echo #### Dump ends here #### +# Cleanup DROP TABLE b12809202_db.t1; DROP TABLE b12809202_db.t2; DROP DATABASE b12809202_db; +--echo # +--echo # Delete all existing binary logs. +--echo # +RESET MASTER; + # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc -- cgit v1.2.1 From dcd0058723e3b0d9d2222ac414ffdc6bd3518be3 Mon Sep 17 00:00:00 2001 From: Rohit Kalhans Date: Mon, 26 Dec 2011 22:40:56 +0530 Subject: rpl.rpl_known_bugs_detection fails on PB2 daily mysql-5.5. The rpl.rpl_known_bugs_detection fails on pb2 as warnings were found in the mysqld log file. We fix this problem by suppressing the warning. --- mysql-test/suite/rpl/r/rpl_known_bugs_detection.result | 1 + mysql-test/suite/rpl/t/rpl_known_bugs_detection.test | 2 ++ 2 files changed, 3 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result index 92ccc78aaca..8ed402b9f8d 100644 --- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result +++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT, UNIQUE(b)); INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10; diff --git a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test index 99871b695a6..a713691ec2d 100644 --- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test +++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test @@ -6,6 +6,8 @@ source include/have_debug.inc; source include/master-slave.inc; +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); + # Currently only statement-based-specific bugs are here -- source include/have_binlog_format_statement.inc -- cgit v1.2.1 From 251fa88afacbd03a00894c04037d987b62f3ca58 Mon Sep 17 00:00:00 2001 From: Tatjana Azundris Nuernberg Date: Mon, 2 Jan 2012 06:25:48 +0000 Subject: BUG#11755281/47032: ERROR 2006 / ERROR 2013 INSTEAD OF PROPER ERROR MESSAGE If init_command was incorrect, we couldn't let users execute queries, but we couldn't report the issue to the client either as it does not expect error messages before even sending a command. Thus, we simply disconnected them without throwing a clear error. We now go through the proper sequence once (without executing any user statements) so we can report back what the problem is. Only then do we disconnect the user. As always, root remains unaffected by this as init_command is (still) not executed for them. mysql-test/r/init_connect.result: We now report a proper error if init_command fails. Expect as much. mysql-test/t/init_connect.test: We now report a proper error if init_command fails. Expect as much. sql/sql_connect.cc: If init_command fails, throw an error explaining this to the user. --- mysql-test/r/init_connect.result | 2 ++ mysql-test/t/init_connect.test | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/init_connect.result b/mysql-test/r/init_connect.result index f5ec0bdc932..0ff6c206422 100644 --- a/mysql-test/r/init_connect.result +++ b/mysql-test/r/init_connect.result @@ -20,6 +20,8 @@ hex(a) 616263 set GLOBAL init_connect="adsfsdfsdfs"; select @a; +ERROR 08S01: Aborted connection to db: 'test' user: 'user_1' host: 'localhost' (init_connect command failed) +select @a; Got one of the listed errors drop table t1; End of 4.1 tests diff --git a/mysql-test/t/init_connect.test b/mysql-test/t/init_connect.test index b6bac5f65fa..e96d02fe0d1 100644 --- a/mysql-test/t/init_connect.test +++ b/mysql-test/t/init_connect.test @@ -36,6 +36,14 @@ connection con0; set GLOBAL init_connect="adsfsdfsdfs"; connect (con5,localhost,user_1,,); connection con5; +# BUG#11755281/47032: ERROR 2006 / ERROR 2013 INSTEAD OF PROPER ERROR MESSAGE +# We now throw a proper error message here: +--replace_regex /connection .* to/connection to/ +--error ER_NEW_ABORTING_CONNECTION +select @a; +# We got disconnected after receiving the above error message; any further +# requests should fail with a notice that no one's listening to us. +# --error CR_SERVER_GONE_ERROR,CR_SERVER_LOST --error 2013,2006 select @a; connection con0; -- cgit v1.2.1 From 3e7bcafe0d78d2d695486df331dd8440b4338f86 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Wed, 4 Jan 2012 16:16:17 +0100 Subject: Followup after 13055685: Use new syntax to mask different error output in affected tests --- mysql-test/include/show_slave_status.inc | 6 ++++++ mysql-test/include/wait_for_slave_io_error.inc | 4 ++++ mysql-test/suite/rpl/r/rpl_log_pos.result | 1 + mysql-test/suite/rpl/r/rpl_manual_change_index_file.result | 1 + mysql-test/suite/rpl/r/rpl_packet.result | 1 + mysql-test/suite/rpl/t/rpl_log_pos.test | 9 +++------ mysql-test/suite/rpl/t/rpl_manual_change_index_file.test | 9 +++------ mysql-test/suite/rpl/t/rpl_packet.test | 9 +++------ 8 files changed, 22 insertions(+), 18 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/show_slave_status.inc b/mysql-test/include/show_slave_status.inc index 67b1c987954..e2fdc72b18b 100644 --- a/mysql-test/include/show_slave_status.inc +++ b/mysql-test/include/show_slave_status.inc @@ -55,6 +55,11 @@ # comma-separated list. Example: # # --let $status_items= Master_Log_File, Relay_Master_Log_File +# +# $slave_io_error_replace +# If set, one or more regex patterns for replacing variable +# text in the error message. Syntax as --replace-regex +# --let $_show_slave_status_items=$status_items @@ -70,6 +75,7 @@ while ($_show_slave_status_items) --let $_show_slave_status_items= `SELECT LTRIM(SUBSTRING('$_show_slave_status_items', LENGTH('$_show_slave_status_name') + 2))` --let $_show_slave_status_value= query_get_value(SHOW SLAVE STATUS, $_show_slave_status_name, 1) + --replace_regex $slave_io_error_replace --let $_show_slave_status_value= `SELECT REPLACE("$_show_slave_status_value", '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')` --echo $_show_slave_status_name = '$_show_slave_status_value' } diff --git a/mysql-test/include/wait_for_slave_io_error.inc b/mysql-test/include/wait_for_slave_io_error.inc index e1609113b8f..bc78c9e2da1 100644 --- a/mysql-test/include/wait_for_slave_io_error.inc +++ b/mysql-test/include/wait_for_slave_io_error.inc @@ -33,6 +33,10 @@ # (e.g., temporary connection error) and does not cause the slave # IO thread to stop. # +# $slave_io_error_replace +# If set, one or more regex patterns for replacing variable +# text in the error message. Syntax as --replace-regex +# # $slave_timeout # See include/wait_for_slave_param.inc # diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index 42b88711f03..72e7c3e2d7f 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -9,6 +9,7 @@ change master to master_log_pos=MASTER_LOG_POS; Read_Master_Log_Pos = '75' start slave; include/wait_for_slave_io_error.inc [errno=1236] +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' include/stop_slave_sql.inc show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result index a2dc5d402a7..e41886ddf6b 100644 --- a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result +++ b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result @@ -5,6 +5,7 @@ CREATE TABLE t1(c1 INT); FLUSH LOGS; call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log'); include/wait_for_slave_io_error.inc [errno=1236] +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the last event was read from 'master-bin.000002' at XXX, the last byte read was read from 'master-bin.000002' at XXX.'' CREATE TABLE t2(c1 INT); FLUSH LOGS; CREATE TABLE t3(c1 INT); diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result index 27f85cac7de..864e246312d 100644 --- a/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-test/suite/rpl/r/rpl_packet.result @@ -37,6 +37,7 @@ DROP TABLE t1; CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM; INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet)); include/wait_for_slave_io_error.inc [errno=1236] +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' STOP SLAVE; RESET SLAVE; RESET MASTER; diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test index 882a05712f2..a6521113b37 100644 --- a/mysql-test/suite/rpl/t/rpl_log_pos.test +++ b/mysql-test/suite/rpl/t/rpl_log_pos.test @@ -22,12 +22,9 @@ let $status_items= Read_Master_Log_Pos; source include/show_slave_status.inc; start slave; let $slave_io_errno= 1236; -# -# Win and Unix path is printed differently: BUG#13055685. So -# show_slave_io_error is made 0 until the bug fixes provide necessary -# facilities -# -let $show_slave_io_error= 0; +--let $show_slave_io_error= 1 +# Mask line numbers, and whether master-bin is preceded by "./" or "." +--let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ source include/wait_for_slave_io_error.inc; source include/stop_slave_sql.inc; diff --git a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test index 9b648de8486..8914b215632 100644 --- a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test +++ b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test @@ -60,12 +60,9 @@ call mtr.add_suppression('Got fatal error 1236 from master when reading data fro connection slave; # 1236 = ER_MASTER_FATAL_ERROR_READING_BINLOG --let $slave_io_errno= 1236 -# -# Win and Unix path is printed differently: BUG#13055685. So -# show_slave_io_error is made 0 until the bug fixes provide necessary -# facilities -# ---let $show_slave_io_error= 0 +--let $show_slave_io_error= 1 +# Mask line numbers, and whether master-bin is preceded by "./" or "." +--let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ --source include/wait_for_slave_io_error.inc connection master; diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test index 2b8a1fd8310..06a03131a57 100644 --- a/mysql-test/suite/rpl/t/rpl_packet.test +++ b/mysql-test/suite/rpl/t/rpl_packet.test @@ -125,12 +125,9 @@ connection slave; # The slave I/O thread must stop after receiving # 1236=ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master. --let $slave_io_errno= 1236 -# -# Win and Unix path is printed differently: BUG#13055685. So -# show_slave_io_error is made 0 until the bug fixes provide necessary -# facilities -# ---let $show_slave_io_error= 0 + +# Mask line numbers, and whether master-bin is preceded by "./" or "." +--let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ --source include/wait_for_slave_io_error.inc # Remove the bad binlog and clear error status on slave. -- cgit v1.2.1 From b03c15413f1fd6b244f8d8a2a57948d0df265ecb Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Fri, 6 Jan 2012 15:46:03 +0530 Subject: Bug#12872804 - 62155: BINLOG.BINLOG_STM_UNSAFE_WARNING FAILS WHEN RUN WITH --REPEAT=2 Fixed the testcase using timestamp logic while doing grep from the error file. --- .../binlog/r/binlog_stm_unsafe_warning.result | 6 +++--- .../suite/binlog/t/binlog_stm_unsafe_warning.test | 23 +++++++++++++++++----- 2 files changed, 21 insertions(+), 8 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result index edbd878982b..08f193c9f5f 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result +++ b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result @@ -34,13 +34,13 @@ USE test; # SET @old_log_warnings = @@log_warnings; DROP TABLE IF EXISTS t1; -CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(10)); +CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(15)); SET GLOBAL LOG_WARNINGS = 0; -INSERT INTO t1 VALUES(UUID(), 'Bug#46265'); +INSERT INTO t1 VALUES(UUID(), 'timestamp'); Warnings: Note 1592 Statement may not be safe to log in statement format. SET GLOBAL LOG_WARNINGS = 1; -INSERT INTO t1 VALUES(UUID(), 'Bug#46265'); +INSERT INTO t1 VALUES(UUID(), 'timestamp'); Warnings: Note 1592 Statement may not be safe to log in statement format. DROP TABLE t1; diff --git a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test index 21c11d5a3df..e5424a911bb 100644 --- a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test +++ b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test @@ -80,22 +80,33 @@ eval USE $old_db; --echo # Bug#46265: Can not disable warning about unsafe statements for binary logging --echo # +# Here introducing a sleep of one Second, just to make sure +# that when this test executes with "--repeat" option, +# the timestamp value is different and hence the Occcurrence count is one. +--sleep 1 + SET @old_log_warnings = @@log_warnings; --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings -CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(10)); +let BINLOG_COUNTER1= `select CONVERT(NOW(),UNSIGNED) as timestmap from dual`; + +CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(15)); SET GLOBAL LOG_WARNINGS = 0; -INSERT INTO t1 VALUES(UUID(), 'Bug#46265'); +# Replacing the result file content here. +# Instead of writing $BINLOG_COUNTER1 value to result file, writing a fixed string timestamp to it. +--replace_result $BINLOG_COUNTER1 timestamp +eval INSERT INTO t1 VALUES(UUID(), '$BINLOG_COUNTER1'); SET GLOBAL LOG_WARNINGS = 1; -INSERT INTO t1 VALUES(UUID(), 'Bug#46265'); +--replace_result $BINLOG_COUNTER1 timestamp +eval INSERT INTO t1 VALUES(UUID(), '$BINLOG_COUNTER1'); DROP TABLE t1; SET GLOBAL log_warnings = @old_log_warnings; let $log_error_= `SELECT @@GLOBAL.log_error`; -if(!`select LENGTH('$log_error_')`) +if(!$log_error_) { # MySQL Server on windows is started with --console and thus # does not know the location of its .err log, use default location @@ -111,7 +122,9 @@ perl; use strict; my $log_error= $ENV{'LOG_ERROR'} or die "LOG_ERROR not set"; open(FILE, "$log_error") or die("Unable to open $log_error: $!\n"); - my $count = () = grep(/Bug#46265/g,); + my $binlog_counter= $ENV{'BINLOG_COUNTER1'} or die "BINLOG_COUNTER1 not set"; + my $count = () = grep(/$binlog_counter/g,); + # Grep the timestamp value from the error file. print "Occurrences: $count\n"; close(FILE); EOF -- cgit v1.2.1 From 13b265483e0aeefdc6de8bd227ca0dfc7cd91736 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Fri, 6 Jan 2012 16:28:24 +0530 Subject: Bug#12872803 - 62154: FEDERATED.FEDERATED_SERVER TEST FAILS WITH RUN --REPEAT=2 Fixed it to work with "--repeat" option. --- mysql-test/suite/federated/federated_server.result | 4 ++-- mysql-test/suite/federated/federated_server.test | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/federated/federated_server.result b/mysql-test/suite/federated/federated_server.result index 2c20d1c1d57..6b37277b5a9 100644 --- a/mysql-test/suite/federated/federated_server.result +++ b/mysql-test/suite/federated/federated_server.result @@ -54,7 +54,7 @@ PASSWORD '', PORT SLAVE_PORT, SOCKET '', OWNER 'root'); -select * from mysql.servers; +select * from mysql.servers order by Server_name; Server_name Host Db Username Password Port Socket Wrapper Owner server_one 127.0.0.1 first_db root SLAVE_PORT mysql root server_two 127.0.0.1 second_db root SLAVE_PORT mysql root @@ -154,7 +154,7 @@ id name drop table federated.t1; drop server 'server_one'; drop server 'server_two'; -select * from mysql.servers; +select * from mysql.servers order by Server_name; Server_name Host Db Username Password Port Socket Wrapper Owner drop table first_db.t1; drop table second_db.t1; diff --git a/mysql-test/suite/federated/federated_server.test b/mysql-test/suite/federated/federated_server.test index ec952d071f2..64ee74edb16 100644 --- a/mysql-test/suite/federated/federated_server.test +++ b/mysql-test/suite/federated/federated_server.test @@ -62,7 +62,9 @@ eval create server 'server_two' foreign data wrapper 'mysql' options OWNER 'root'); --replace_result $SLAVE_MYPORT SLAVE_PORT -eval select * from mysql.servers; +# Adding 'order by' clause here, in order to maintain consistent result out of the select query. +#eval select * from mysql.servers; +eval select * from mysql.servers order by Server_name; DROP TABLE IF EXISTS federated.old; --replace_result $SLAVE_MYPORT SLAVE_PORT @@ -147,7 +149,9 @@ drop table federated.t1; drop server 'server_one'; drop server 'server_two'; -select * from mysql.servers; +# Adding 'order by' clause here, in order to maintain consistent result out of the select query. +#select * from mysql.servers; +eval select * from mysql.servers order by Server_name; connection slave; drop table first_db.t1; -- cgit v1.2.1 From 115f5e8551b9243ef3ca98ce882993fb78c426e1 Mon Sep 17 00:00:00 2001 From: Yasufumi Kinoshita Date: Tue, 10 Jan 2012 14:18:58 +0900 Subject: Bug#12400341 INNODB CAN LEAVE ORPHAN IBD FILES AROUND If we meet DB_TOO_MANY_CONCURRENT_TRXS during the execution tab_create_graph from row_create_table_for_mysql(), .ibd file for the table should be created already but was not deleted for the error handling. rb:875 approved by Jimmy Yang --- .../suite/innodb/r/innodb_bug12400341.result | 25 +++++ .../suite/innodb/t/innodb_bug12400341-master.opt | 1 + mysql-test/suite/innodb/t/innodb_bug12400341.test | 103 +++++++++++++++++++++ .../innodb_plugin/r/innodb_bug12400341.result | 25 +++++ .../innodb_plugin/t/innodb_bug12400341-master.opt | 1 + .../suite/innodb_plugin/t/innodb_bug12400341.test | 103 +++++++++++++++++++++ 6 files changed, 258 insertions(+) create mode 100644 mysql-test/suite/innodb/r/innodb_bug12400341.result create mode 100644 mysql-test/suite/innodb/t/innodb_bug12400341-master.opt create mode 100644 mysql-test/suite/innodb/t/innodb_bug12400341.test create mode 100644 mysql-test/suite/innodb_plugin/r/innodb_bug12400341.result create mode 100644 mysql-test/suite/innodb_plugin/t/innodb_bug12400341-master.opt create mode 100644 mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/r/innodb_bug12400341.result b/mysql-test/suite/innodb/r/innodb_bug12400341.result new file mode 100644 index 00000000000..551e94f5e77 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug12400341.result @@ -0,0 +1,25 @@ +call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too"); +show variables like "max_connections"; +Variable_name Value +max_connections 64 +show variables like "innodb_thread_concurrency"; +Variable_name Value +innodb_thread_concurrency 0 +show variables like "innodb_file_per_table"; +Variable_name Value +innodb_file_per_table ON +drop database if exists mysqltest; +create database mysqltest; +CREATE TABLE mysqltest.transtable (id int unsigned NOT NULL PRIMARY KEY, val int DEFAULT 0) ENGINE=InnoDB; +select count(*) from information_schema.processlist; +count(*) +33 +CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB; +ERROR HY000: Can't create table 'mysqltest.testtable' (errno: 177) +select count(*) from information_schema.processlist; +count(*) +33 +select count(*) from information_schema.processlist; +count(*) +33 +drop database mysqltest; diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341-master.opt b/mysql-test/suite/innodb/t/innodb_bug12400341-master.opt new file mode 100644 index 00000000000..2e85b082c68 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug12400341-master.opt @@ -0,0 +1 @@ +--max_connections=64 --innodb_thread_concurrency=0 --innodb_file_per_table diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341.test b/mysql-test/suite/innodb/t/innodb_bug12400341.test new file mode 100644 index 00000000000..2ab1be81f6d --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug12400341.test @@ -0,0 +1,103 @@ +# Test for bug #12400341: INNODB CAN LEAVE ORPHAN IBD FILES AROUND + +-- source include/have_innodb.inc + +if (`select count(*)=0 from information_schema.global_variables where variable_name = 'INNODB_TRX_RSEG_N_SLOTS_DEBUG'`) +{ + --skip Test requires InnoDB built with UNIV_DEBUG definition. +} + +call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too"); + +--disable_query_log +set @old_innodb_trx_rseg_n_slots_debug = @@innodb_trx_rseg_n_slots_debug; +set global innodb_trx_rseg_n_slots_debug = 32; +--enable_query_log + +show variables like "max_connections"; +show variables like "innodb_thread_concurrency"; +show variables like "innodb_file_per_table"; + +--disable_warnings +drop database if exists mysqltest; +--enable_warnings + +create database mysqltest; +CREATE TABLE mysqltest.transtable (id int unsigned NOT NULL PRIMARY KEY, val int DEFAULT 0) ENGINE=InnoDB; + +--disable_query_log +# +# Insert in 1 transaction which needs over 1 page undo record to avoid the insert_undo cached, +# because the cached insert_undo can be reused at "CREATE TABLE" statement later. +# +START TRANSACTION; +let $c = 1024; +while ($c) +{ + eval INSERT INTO mysqltest.transtable (id) VALUES ($c); + dec $c; +} +COMMIT; + +let $c = 32; +while ($c) +{ + # if failed at here, it might be shortage of file descriptors limit. + connect (con$c,localhost,root,,); + dec $c; +} +--enable_query_log + +select count(*) from information_schema.processlist; + +# +# fill the all undo slots +# +--disable_query_log +let $c = 32; +while ($c) +{ + connection con$c; + START TRANSACTION; + eval UPDATE mysqltest.transtable SET val = 1 WHERE id = 33 - $c; + dec $c; +} +--enable_query_log + +connection default; + +--error ER_CANT_CREATE_TABLE +CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB; + +select count(*) from information_schema.processlist; + +--disable_query_log +let $c = 32; +while ($c) +{ + connection con$c; + ROLLBACK; + dec $c; +} +--enable_query_log + +connection default; +select count(*) from information_schema.processlist; + +--disable_query_log +let $c = 32; +while ($c) +{ + disconnect con$c; + dec $c; +} +--enable_query_log + +# +# If the isolated .ibd file remained, the drop database should fail. +# +drop database mysqltest; + +--disable_query_log +set global innodb_trx_rseg_n_slots_debug = @old_innodb_trx_rseg_n_slots_debug; +--enable_query_log diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug12400341.result b/mysql-test/suite/innodb_plugin/r/innodb_bug12400341.result new file mode 100644 index 00000000000..551e94f5e77 --- /dev/null +++ b/mysql-test/suite/innodb_plugin/r/innodb_bug12400341.result @@ -0,0 +1,25 @@ +call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too"); +show variables like "max_connections"; +Variable_name Value +max_connections 64 +show variables like "innodb_thread_concurrency"; +Variable_name Value +innodb_thread_concurrency 0 +show variables like "innodb_file_per_table"; +Variable_name Value +innodb_file_per_table ON +drop database if exists mysqltest; +create database mysqltest; +CREATE TABLE mysqltest.transtable (id int unsigned NOT NULL PRIMARY KEY, val int DEFAULT 0) ENGINE=InnoDB; +select count(*) from information_schema.processlist; +count(*) +33 +CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB; +ERROR HY000: Can't create table 'mysqltest.testtable' (errno: 177) +select count(*) from information_schema.processlist; +count(*) +33 +select count(*) from information_schema.processlist; +count(*) +33 +drop database mysqltest; diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug12400341-master.opt b/mysql-test/suite/innodb_plugin/t/innodb_bug12400341-master.opt new file mode 100644 index 00000000000..2e85b082c68 --- /dev/null +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug12400341-master.opt @@ -0,0 +1 @@ +--max_connections=64 --innodb_thread_concurrency=0 --innodb_file_per_table diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test b/mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test new file mode 100644 index 00000000000..b9e40e0dff3 --- /dev/null +++ b/mysql-test/suite/innodb_plugin/t/innodb_bug12400341.test @@ -0,0 +1,103 @@ +# Test for bug #12400341: INNODB CAN LEAVE ORPHAN IBD FILES AROUND + +-- source include/have_innodb_plugin.inc + +if (`select count(*)=0 from information_schema.global_variables where variable_name = 'INNODB_TRX_RSEG_N_SLOTS_DEBUG'`) +{ + --skip Test requires InnoDB built with UNIV_DEBUG definition. +} + +call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too"); + +--disable_query_log +set @old_innodb_trx_rseg_n_slots_debug = @@innodb_trx_rseg_n_slots_debug; +set global innodb_trx_rseg_n_slots_debug = 32; +--enable_query_log + +show variables like "max_connections"; +show variables like "innodb_thread_concurrency"; +show variables like "innodb_file_per_table"; + +--disable_warnings +drop database if exists mysqltest; +--enable_warnings + +create database mysqltest; +CREATE TABLE mysqltest.transtable (id int unsigned NOT NULL PRIMARY KEY, val int DEFAULT 0) ENGINE=InnoDB; + +--disable_query_log +# +# Insert in 1 transaction which needs over 1 page undo record to avoid the insert_undo cached, +# because the cached insert_undo can be reused at "CREATE TABLE" statement later. +# +START TRANSACTION; +let $c = 1024; +while ($c) +{ + eval INSERT INTO mysqltest.transtable (id) VALUES ($c); + dec $c; +} +COMMIT; + +let $c = 32; +while ($c) +{ + # if failed at here, it might be shortage of file descriptors limit. + connect (con$c,localhost,root,,); + dec $c; +} +--enable_query_log + +select count(*) from information_schema.processlist; + +# +# fill the all undo slots +# +--disable_query_log +let $c = 32; +while ($c) +{ + connection con$c; + START TRANSACTION; + eval UPDATE mysqltest.transtable SET val = 1 WHERE id = 33 - $c; + dec $c; +} +--enable_query_log + +connection default; + +--error ER_CANT_CREATE_TABLE +CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB; + +select count(*) from information_schema.processlist; + +--disable_query_log +let $c = 32; +while ($c) +{ + connection con$c; + ROLLBACK; + dec $c; +} +--enable_query_log + +connection default; +select count(*) from information_schema.processlist; + +--disable_query_log +let $c = 32; +while ($c) +{ + disconnect con$c; + dec $c; +} +--enable_query_log + +# +# If the isolated .ibd file remained, the drop database should fail. +# +drop database mysqltest; + +--disable_query_log +set global innodb_trx_rseg_n_slots_debug = @old_innodb_trx_rseg_n_slots_debug; +--enable_query_log -- cgit v1.2.1 From aaa2ba39de13aa3a022995ce8953afa5b453e424 Mon Sep 17 00:00:00 2001 From: Sneha Modi Date: Tue, 10 Jan 2012 11:41:50 +0530 Subject: Bug#11748572: ALLOCATING A LARGE QUERY CACHE IS NOT DETERMINISTIC Moving query_cache_size_basic_32.test and query_cache_size_basic_64.test from experimental to disabled as a solution has still not been found. --- mysql-test/collections/default.experimental | 2 -- mysql-test/suite/sys_vars/t/disabled.def | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index f528f1c473e..b3623402065 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -24,6 +24,4 @@ sys_vars.wait_timeout_func # Bug#11750645 2010-04-26 alik wai sys_vars.ndb_log_update_as_write_basic sys_vars.have_ndbcluster_basic sys_vars.ndb_log_updated_only_basic -sys_vars.query_cache_size_basic_64 # Bug#11748572 - 36747: ALLOCATING A LARGE QUERY CACHE IS NOT DETERMINISTIC -sys_vars.query_cache_size_basic_32 # Bug#11748572 - 36747: ALLOCATING A LARGE QUERY CACHE IS NOT DETERMINISTIC sys_vars.rpl_init_slave_func # Bug#12535301 2011-05-09 andrei sys_vars.rpl_init_slave_func mismatches in daily-5.5 diff --git a/mysql-test/suite/sys_vars/t/disabled.def b/mysql-test/suite/sys_vars/t/disabled.def index f950aaf9ca5..d0049805315 100644 --- a/mysql-test/suite/sys_vars/t/disabled.def +++ b/mysql-test/suite/sys_vars/t/disabled.def @@ -11,5 +11,7 @@ ############################################################################## transaction_prealloc_size_basic_32 : Bug#11748572 transaction_prealloc_size_basic_64 : Bug#11748572 +query_cache_size_basic_32 : Bug#13535584 +query_cache_size_basic_64 : Bug#11748572 #thread_cache_size_func : Bug#11750172: 2008-11-07 joro main.thread_cache_size_func fails in pushbuild when run with pool of threads -- cgit v1.2.1 From 99e462ab0b308e629f4604adc3a33e2cf817be82 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Tue, 10 Jan 2012 13:33:45 +0530 Subject: BUG#11760384 - 52792: mysqldump in XML mode does not dump routines. mysqldump in xml mode did not dump routines, events or triggers. This patch fixes this issue by fixing the if conditions that disallowed the dump of above mentioned objects in xml mode, and added the required code to enable dump in xml format. client/mysqldump.c: BUG#11760384 - 52792: mysqldump in XML mode does not dump routines. Fixed some if conditions to allow execution of dump methods for xml and further added the relevant code at places to produce the dump in xml format. mysql-test/r/mysqldump.result: Added a test case for Bug#11760384. mysql-test/t/mysqldump.test: Added a test case for Bug#11760384. --- mysql-test/r/mysqldump.result | 439 ++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/mysqldump.test | 112 +++++++++++ 2 files changed, 551 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index a337c0384f6..1d4a5783c3f 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -4628,5 +4628,444 @@ ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; DROP DATABASE `test-database`; USE `test`; # +# BUG#11760384 : 52792: mysqldump in XML mode does not dump routines. +# +CREATE DATABASE BUG52792; +USE BUG52792; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(20)); +CREATE TABLE t2 (c1 INT); +INSERT INTO t1 VALUES (1, 'aaa'), (2, 'bbb'), (3, 'ccc'); +INSERT INTO t2 VALUES (1),(2),(3); +# Stored Procedures. +CREATE PROCEDURE simpleproc1 (OUT param1 INT) +BEGIN +SELECT COUNT(*) INTO param1 FROM t1; +END// +CREATE PROCEDURE simpleproc2 (OUT param1 INT) +BEGIN +SELECT COUNT(*) INTO param1 FROM t2; +END// +# Events. +CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792; +CREATE EVENT e2 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792; +# Functions. +CREATE FUNCTION `hello1` (s CHAR(20)) +RETURNS CHAR(50) DETERMINISTIC +RETURN CONCAT('Hello, ' ,s ,'!'); +CREATE FUNCTION `hello2` (s CHAR(20)) +RETURNS CHAR(50) DETERMINISTIC +RETURN CONCAT(']]>, ' , s ,'!'); +# Triggers. +CREATE TRIGGER trig1 BEFORE INSERT ON t2 +FOR EACH ROW BEGIN +INSERT INTO t2 VALUES(1); +END; +| +CREATE TRIGGER trig2 AFTER INSERT ON t2 +FOR EACH ROW BEGIN +INSERT INTO t2 VALUES(1, ']]>'); +INSERT INTO t2 VALUES(2, ''); +INSERT INTO t2 VALUES(3, ' & \ " _'); +END; +| +# Views +CREATE VIEW v1 AS SELECT * FROM t1; +CREATE VIEW v2 AS SELECT * FROM t2; + +# Dumping BUG52792 database in xml format. + +# Running 'replace_regex on timestamp' + + + + + + + + + + + 1 + aaa + + + 2 + bbb + + + 3 + ccc + + + + + + + + + 1 + + + 2 + + + 3 + + + + + + + +'); +INSERT INTO t2 VALUES(2, ''); +INSERT INTO t2 VALUES(3, ' & \ " _'); +END +]]> + + + + + + + + + + + + + + + + + + + + + + + + +, ' , s ,'!') +]]> + + + + + + + + + + + +# Dumping BUG52792 database in xml format with comments. + +# Running 'replace_regex on timestamp' + + + + + + + + + + + + + 1 + aaa + + + 2 + bbb + + + 3 + ccc + + + + + + + + + + + 1 + + + 2 + + + 3 + + + + + + + +'); +INSERT INTO t2 VALUES(2, ''); +INSERT INTO t2 VALUES(3, ' & \ " _'); +END +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +, ' , s ,'!') +]]> + + + + + + + + + + + +# Test to check 'Insufficient privileges' error. + +GRANT ALL PRIVILEGES ON BUG52792.* TO user1; +# Running 'replace_regex on timestamp' + + + + + + + + + + + 1 + aaa + + + 2 + bbb + + + 3 + ccc + + + + + + + + + 1 + + + 2 + + + 3 + + + + + + + +'); +INSERT INTO t2 VALUES(2, ''); +INSERT INTO t2 VALUES(3, ' & \ " _'); +END +]]> + + + + + + + + + + + + + + + + + + + + + + +DROP USER user1; +DROP DATABASE BUG52792; +# UTF-8 +CREATE DATABASE BUG52792; +USE BUG52792; +SET NAMES utf8; +CREATE FUNCTION `straße` ( c1 CHAR(20)) +RETURNS CHAR(50) DETERMINISTIC +RETURN CONCAT(']]>, ', s, '!'); + + + + + +, ', s, '!') +]]> + + + + +DROP DATABASE BUG52792; +USE test; +# # End of 5.1 tests # diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 8ecf8187ff9..20c788e3b9a 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2196,6 +2196,118 @@ DROP DATABASE `test-database`; # Switching back to test database. USE `test`; +--echo # +--echo # BUG#11760384 : 52792: mysqldump in XML mode does not dump routines. +--echo # +CREATE DATABASE BUG52792; +USE BUG52792; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(20)); +CREATE TABLE t2 (c1 INT); +INSERT INTO t1 VALUES (1, 'aaa'), (2, 'bbb'), (3, 'ccc'); +INSERT INTO t2 VALUES (1),(2),(3); + +--echo # Stored Procedures. + +DELIMITER //; +CREATE PROCEDURE simpleproc1 (OUT param1 INT) +BEGIN + SELECT COUNT(*) INTO param1 FROM t1; +END// +DELIMITER ;// + +DELIMITER //; +CREATE PROCEDURE simpleproc2 (OUT param1 INT) +BEGIN + SELECT COUNT(*) INTO param1 FROM t2; +END// +DELIMITER ;// + +--echo # Events. + +CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792; +CREATE EVENT e2 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792; + +--echo # Functions. + +CREATE FUNCTION `hello1` (s CHAR(20)) + RETURNS CHAR(50) DETERMINISTIC +RETURN CONCAT('Hello, ' ,s ,'!'); + +CREATE FUNCTION `hello2` (s CHAR(20)) + RETURNS CHAR(50) DETERMINISTIC +RETURN CONCAT(']]>, ' , s ,'!'); + +--echo # Triggers. + +DELIMITER |; +CREATE TRIGGER trig1 BEFORE INSERT ON t2 + FOR EACH ROW BEGIN + INSERT INTO t2 VALUES(1); +END; +| +DELIMITER ;| + +DELIMITER |; +CREATE TRIGGER trig2 AFTER INSERT ON t2 + FOR EACH ROW BEGIN + INSERT INTO t2 VALUES(1, ']]>'); + INSERT INTO t2 VALUES(2, ''); + INSERT INTO t2 VALUES(3, ' & \ " _'); +END; +| +DELIMITER ;| + +--echo # Views + +CREATE VIEW v1 AS SELECT * FROM t1; +CREATE VIEW v2 AS SELECT * FROM t2; +--echo +--echo # Dumping BUG52792 database in xml format. +--echo +--echo # Running 'replace_regex on timestamp' +--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/--TIME--/ +--exec $MYSQL_DUMP --user=root --compact -R -E --triggers -X BUG52792 +--echo +--echo # Dumping BUG52792 database in xml format with comments. +--echo +--echo # Running 'replace_regex on timestamp' +--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/--TIME--/ +--exec $MYSQL_DUMP --comments --user=root -R -E --triggers -X BUG52792 + +--echo +--echo # Test to check 'Insufficient privileges' error. +--echo + +GRANT ALL PRIVILEGES ON BUG52792.* TO user1; + +connect (conn_1, localhost, user1, , BUG52792, $MASTER_MYPORT, $MASTER_MYSOCK); +connection conn_1; + +--echo # Running 'replace_regex on timestamp' +--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/--TIME--/ +--error 2 +--exec $MYSQL_DUMP --user=user1 -R -E --triggers -X BUG52792 + +connection default; +disconnect conn_1; + +DROP USER user1; +DROP DATABASE BUG52792; +--echo # UTF-8 +CREATE DATABASE BUG52792; +USE BUG52792; +SET NAMES utf8; +CREATE FUNCTION `straße` ( c1 CHAR(20)) + RETURNS CHAR(50) DETERMINISTIC +RETURN CONCAT(']]>, ', s, '!'); + +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 -R -X BUG52792 + +DROP DATABASE BUG52792; + +USE test; + --echo # --echo # End of 5.1 tests --echo # -- cgit v1.2.1 From 1522923949a9ea2a7379f9369b398870a711f79a Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 12 Jan 2012 13:02:51 +0400 Subject: BUG#13354387 - CRASH IN IN MY_DECIMAL::OPERATOR FOR VIEW AND FUNCTION UNIX_TIME Fixing the 5.5 part (the 5.6 part will go in a separate commit soon). Problem: Item_direct_ref::get_date() incorrectly calculated its "null_value", which made UNIX_TIMESTAMP(view_column) incorrectly return NULL for a NOT NULL view_column. Fix: Make Item_direct_ref::get_date() calculate null_value in the similar way with the other methods (val_real,val_str,val_int,val_decimal): copy null_value from the referenced Item. modified: mysql-test/r/func_time.result mysql-test/t/func_time.test sql/item.cc --- mysql-test/r/func_time.result | 15 +++++++++++++++ mysql-test/t/func_time.test | 15 +++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index bad467b3255..bd591299455 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1433,6 +1433,21 @@ NULL 1 NULL SET storage_engine=NULL; ERROR 42000: Variable 'storage_engine' can't be set to the value of 'NULL' # +# BUG#13354387 - CRASH IN IN MY_DECIMAL::OPERATOR FOR VIEW AND FUNCTION UNIX_TIMESTAMP +# Part1 (5.5) +SET time_zone='+03:00'; +CREATE TABLE t1 (a DATETIME NOT NULL); +INSERT INTO t1 VALUES ('2009-09-20 07:32:39.06'); +INSERT INTO t1 VALUES ('0000-00-00 00:00:00.00'); +CREATE VIEW v1 AS SELECT * FROM t1; +SELECT CAST(UNIX_TIMESTAMP(a) AS DECIMAL(25,3)) AS c1 FROM v1 ORDER BY 1; +c1 +0.000 +1253421159.000 +DROP VIEW v1; +DROP TABLE t1; +SET time_zone=DEFAULT; +# # Bug #59686 crash in String::copy() with time data type # SELECT min(timestampadd(month, 1>'', from_days('%Z'))); diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 57a5a656591..d385a079f64 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -940,6 +940,21 @@ SELECT MONTHNAME(0), MONTHNAME(0) IS NULL, MONTHNAME(0) + 1; --error ER_WRONG_VALUE_FOR_VAR SET storage_engine=NULL; + +--echo # +--echo # BUG#13354387 - CRASH IN IN MY_DECIMAL::OPERATOR FOR VIEW AND FUNCTION UNIX_TIMESTAMP +--echo # Part1 (5.5) +SET time_zone='+03:00'; +CREATE TABLE t1 (a DATETIME NOT NULL); +INSERT INTO t1 VALUES ('2009-09-20 07:32:39.06'); +INSERT INTO t1 VALUES ('0000-00-00 00:00:00.00'); +CREATE VIEW v1 AS SELECT * FROM t1; +SELECT CAST(UNIX_TIMESTAMP(a) AS DECIMAL(25,3)) AS c1 FROM v1 ORDER BY 1; +DROP VIEW v1; +DROP TABLE t1; +SET time_zone=DEFAULT; + + --echo # --echo # Bug #59686 crash in String::copy() with time data type --echo # -- cgit v1.2.1 From 9b0fdd650f5939fcfc70d8c3f1b3b42ea533071f Mon Sep 17 00:00:00 2001 From: Nuno Carvalho Date: Mon, 16 Jan 2012 09:17:40 +0000 Subject: BUG#11893288 60542: RPL.RPL_EXTRA_COL_MASTER_* DOESN'T TEST WHAT WAS INTENDED Test extra/rpl_tests/rpl_extra_col_master.test (used by rpl_extra_col_master_*) ends with the active connection pointing to the slave. Thus, the two last tests never succeed in changing the binlog format of the master away from 'row'. With correct active connection (master) tests fail for binlog 'statement' and 'mixed' formats. Tests rpl_extra_col_master_* only run when binary log format is row. Statement and mix replication do not make sense in this tests since it will try to execute statements on columns that do not exist. This fix is basically a backport from mysql-5.5, see changes done as part of BUG 39934. --- .../extra/rpl_tests/rpl_extra_col_master.test | 4 + .../suite/rpl/r/rpl_extra_col_master_innodb.result | 1743 -------------------- .../suite/rpl/r/rpl_extra_col_master_myisam.result | 1743 -------------------- .../suite/rpl/t/rpl_extra_col_master_innodb.test | 12 +- .../suite/rpl/t/rpl_extra_col_master_myisam.test | 10 +- 5 files changed, 9 insertions(+), 3503 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/extra/rpl_tests/rpl_extra_col_master.test b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test index 1c103512318..07a0f2c9557 100644 --- a/mysql-test/extra/rpl_tests/rpl_extra_col_master.test +++ b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test @@ -59,6 +59,8 @@ #VARCHAR(M) # +--let $_saved_conn= $CURRENT_CONNECTION + let $binformat = `SHOW VARIABLES LIKE '%binlog_format%'`; --echo --echo *********************************************************** @@ -1018,3 +1020,5 @@ SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; connection master; DROP TABLE t5; sync_slave_with_master; + +--connection $_saved_conn diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result index affb179d50e..8684701738a 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result @@ -1,6 +1,5 @@ include/master-slave.inc [connection master] -set binlog_format=row; *********************************************************** *********************************************************** @@ -832,1748 +831,6 @@ c1 hex(c4) c5 DROP TABLE t18; -***************************************************** -* - Insert UUID column on Master not on slave * -* Expect: Rows inserted * -***************************************************** - -*** Create t5 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t5 on Master *** -CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 LONG, -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT), -(2,@b1,'JOE',UUID(),DEFAULT), -(3,@b1,'QA',UUID(),DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 6231623162316231 Kyle UUID TIME -2 6231623162316231 JOE UUID TIME -3 6231623162316231 QA UUID TIME - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; -c1 hex(c4) c5 -1 6231623162316231 Kyle -2 6231623162316231 JOE -3 6231623162316231 QA -DROP TABLE t5; -set binlog_format=statement; - -*********************************************************** -*********************************************************** -***************** Start of Testing ************************ -*********************************************************** -*********************************************************** -* This test format == binlog_format STATEMENT and engine == 'InnoDB' -*********************************************************** -*********************************************************** - -***** Testing more columns on the Master ***** - -CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 FLOAT DEFAULT '2.00', -f6 CHAR(4) DEFAULT 'TEST', -f7 INT DEFAULT '0', -f8 TEXT, -f9 LONGBLOB, -f10 BIT(63), -f11 VARBINARY(64))ENGINE='InnoDB'; - -* Alter Table on Slave and drop columns f5 through f11 * - -alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; - -* Insert data in Master then update and delete some rows* - -* Select count and 20 rows from Master * - -SELECT COUNT(*) FROM t1; -COUNT(*) -40 - -SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, -hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20; -f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) -2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 - -* Select count and 20 rows from Slave * - -SELECT COUNT(*) FROM t1; -COUNT(*) -40 - -SELECT * FROM t1 ORDER BY f3 LIMIT 20; -f1 f2 f3 f4 -2 2 2 second -3 3 3 next -5 5 5 second -6 6 6 next -8 8 8 second -9 9 9 next -11 11 11 second -12 12 12 next -14 14 14 second -15 15 15 next -17 17 17 second -18 18 18 next -20 20 20 second -21 21 21 next -23 23 23 second -24 24 24 next -26 26 26 second -27 27 27 next -29 29 29 second -30 30 30 next -include/check_slave_is_running.inc - -***** Testing Altering table def scenario ***** - -CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 ENUM('a', 'b', 'c') default 'a', -f7 DECIMAL(17,9) default '1000.00', -f8 MEDIUMBLOB, -f9 NUMERIC(6,4) default '2000.00', -f10 VARCHAR(1024), -f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f12 SET('a', 'b', 'c') default 'b') -ENGINE='InnoDB'; -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 - -CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 ENUM('a', 'b', 'c') default 'a', -f8 MEDIUMBLOB, -f10 VARCHAR(1024), -f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f12 SET('a', 'b', 'c') default 'b') -ENGINE='InnoDB'; - -CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 DECIMAL(17,9) default '1000.00', -f7 MEDIUMBLOB, -f8 NUMERIC(6,4) default '2000.00', -f9 VARCHAR(1024), -f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f11 CHAR(255)) -ENGINE='InnoDB'; -Warnings: -Warning 1264 Out of range value for column 'f8' at row 1 - -CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 BIGINT, -f6 BLOB, -f7 DATE, -f8 DATETIME, -f9 FLOAT, -f10 INT, -f11 LONGBLOB, -f12 LONGTEXT, -f13 MEDIUMBLOB, -f14 MEDIUMINT, -f15 MEDIUMTEXT, -f16 REAL, -f17 SMALLINT, -f18 TEXT, -f19 TIME, -f20 TIMESTAMP, -f21 TINYBLOB, -f22 TINYINT, -f23 TINYTEXT, -f24 YEAR, -f25 BINARY(255), -f26 BIT(64), -f27 CHAR(255), -f28 DECIMAL(30,7), -f29 DOUBLE, -f30 ENUM ('a','b', 'c') default 'a', -f31 FLOAT, -f32 NUMERIC(17,9), -f33 SET ('a', 'b', 'c') default 'b', -f34 VARBINARY(1025), -f35 VARCHAR(257) -) ENGINE='InnoDB'; - -** Alter tables on slave and drop columns ** - -alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop -f12; -alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12; -alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; -alter table t31 -drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, -drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18, -drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25, -drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32, -drop f33, drop f34, drop f35; - -** Insert Data into Master ** -INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10: -some var char'; -INSERT into t2 values (2, 2, 2, 'second', -2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char', -'01234567', 'c'), -(3, 3, 3, 'third', -3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', -'01234567', 'c'); -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 -Warning 1264 Out of range value for column 'f9' at row 2 -INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char'; -INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10: -binary data'; -INSERT into t31 set f1=1, f2=1, f3=1, f4='first'; -INSERT into t31 set f1=1, f2=1, f3=2, f4='second', -f9=2.2, f10='seven samurai', f28=222.222, f35='222'; -Warnings: -Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1 -INSERT into t31 values (1, 1, 3, 'third', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ); -Warnings: -Warning 1264 Out of range value for column 'f5' at row 1 -Warning 1264 Out of range value for column 'f24' at row 1 -INSERT into t31 values (1, 1, 4, 'fourth', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ), -(1, 1, 5, 'fifth', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ), -(1, 1, 6, 'sixth', -/* f5 BIGINT, */ NULL, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ NULL -); -Warnings: -Warning 1264 Out of range value for column 'f5' at row 1 -Warning 1264 Out of range value for column 'f24' at row 1 -Warning 1264 Out of range value for column 'f5' at row 2 -Warning 1264 Out of range value for column 'f24' at row 2 -Warning 1264 Out of range value for column 'f24' at row 3 - -** Sync slave with master ** -** Do selects from tables ** - -select * from t1 order by f3; -f1 f2 f3 f4 -2 2 2 second -3 3 3 next -5 5 5 second -6 6 6 next -8 8 8 second -9 9 9 next -11 11 11 second -12 12 12 next -14 14 14 second -15 15 15 next -17 17 17 second -18 18 18 next -20 20 20 second -21 21 21 next -23 23 23 second -24 24 24 next -26 26 26 second -27 27 27 next -29 29 29 second -30 30 30 next -31 31 31 second -32 32 32 second -33 33 33 second -34 34 34 second -35 35 35 second -36 36 36 second -37 37 37 second -38 38 38 second -39 39 39 second -40 40 40 second -41 41 41 second -42 42 42 second -43 43 43 second -44 44 44 second -45 45 45 second -46 46 46 second -47 47 47 second -48 48 48 second -49 49 49 second -50 50 50 second -select * from t2 order by f1; -f1 f2 f3 f4 -1 1 1 first -2 2 2 second -3 3 3 third -select * from t3 order by f1; -f1 f2 f3 f4 -1 1 1 first -select * from t4 order by f1; -f1 f2 f3 f4 -1 1 1 first -select * from t31 order by f3; -f1 f2 f3 f4 -1 1 1 first -1 1 2 second -1 1 3 third -1 1 4 fourth -1 1 5 fifth -1 1 6 sixth - -** Do updates master ** - -update t31 set f5=555555555555555 where f3=6; -update t31 set f2=2 where f3=2; -update t31 set f1=NULL where f3=1; -update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; -Warnings: -Warning 1048 Column 'f3' cannot be null - -** Delete from Master ** - -delete from t1; -delete from t2; -delete from t3; -delete from t4; -delete from t31; -select * from t31; -f1 f2 f3 f4 - -** Check slave status ** - -include/check_slave_is_running.inc - -**************************************** -* columns in master at middle of table * -* Expect: Proper error message * -**************************************** - -** Stop and Reset Slave ** - -STOP SLAVE; -RESET SLAVE; - -** create table slave side ** -CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) -) ENGINE='InnoDB'; - -** Connect to master and create table ** - -CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', -c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), -(2,@b1,DEFAULT,'JOE',DEFAULT), -(3,@b1,DEFAULT,'QA',DEFAULT); - -******************************************** -*** Expect slave to fail with Error 1535 *** -******************************************** - -include/wait_for_slave_sql_error_and_skip.inc [errno=1535] -Last_SQL_Error = 'Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254' - -*** Drop t10 *** -DROP TABLE t10; - -********************************************* -* More columns in master at middle of table * -* Expect: Proper error message * -********************************************* - -*** Create t11 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) -) ENGINE='InnoDB'; - -*** Create t11 on Master *** -CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, -c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), -(2,@b1,'Testing is cool','JOE',DEFAULT), -(3,@b1,DEFAULT,'QA',DEFAULT); - -******************************************** -*** Expect slave to fail with Error 1535 *** -******************************************** - -include/wait_for_slave_sql_error_and_skip.inc [errno=1535] -Last_SQL_Error = 'Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15' - -*** Drop t11 *** -DROP TABLE t11; - -********************************************* -* More columns in master at middle of table * -* Expect: This one should pass blob-text * -********************************************* - -*** Create t12 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB -) ENGINE='InnoDB'; - -*** Create t12 on Master *** -CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, -c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',DEFAULT,DEFAULT), -(3,@b1,'QA',DEFAULT,DEFAULT); - -SELECT a,hex(b),f,c,e FROM t12 ORDER BY a; -a hex(b) f c e -1 62316231623162316231623162316231 Kyle test 1 -2 62316231623162316231623162316231 JOE test 1 -3 62316231623162316231623162316231 QA test 1 - -*** Select on Slave *** -SELECT a,hex(b),c FROM t12 ORDER BY a; -a hex(b) c -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -*** Drop t12 *** -DROP TABLE t12; - -**************************************************** -* - Alter Master adding columns at middle of table * -* Expect: columns added * -**************************************************** - - -*** Create t14 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t14 on Master *** -CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1; -ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2; - -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT), -(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT), -(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT); - -SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1; -c1 c2 c3 hex(c4) c5 c6 c7 -1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP -3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP - -*** Select on Slave **** -SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1; -c1 c2 c3 hex(c4) c5 -1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle -2 2.00 This Test Should work 62316231623162316231623162316231 JOE -3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA - -**************************************************** -* - Alter Master Dropping columns from the middle. * -* Expect: columns dropped * -**************************************************** - -*** connect to master and drop columns *** -ALTER TABLE t14 DROP COLUMN c2; -ALTER TABLE t14 DROP COLUMN c7; - -*** Select from Master *** -SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1; -c1 c3 hex(c4) c5 c6 -1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 -2 This Test Should work 62316231623162316231623162316231 JOE 1 -3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 - -************ -* Bug30415 * -************ -include/wait_for_slave_sql_error.inc [errno=1091] -Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'' -STOP SLAVE; -RESET SLAVE; - -*** Drop t14 *** -DROP TABLE t14; -DROP TABLE t14; -RESET MASTER; -START SLAVE; - -************************************************* -* - Alter Master adding columns at end of table * -* Expect: Error 1054 * -************************************************* - -*** Create t15 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t15 on Master *** -CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7; -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00), -(2,@b1,'JOE',DEFAULT,DEFAULT,3.00), -(3,@b1,'QA',DEFAULT,DEFAULT,3.00); -SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1; -c1 hex(c4) c5 c6 c7 c2 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00 -2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00 -3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00 - -******************************************** -*** Expect slave to fail with Error 1054 *** -******************************************** - -include/wait_for_slave_sql_error.inc [errno=1054] -Last_SQL_Error = 'Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'' -STOP SLAVE; -RESET SLAVE; - -*** Drop t15 *** -DROP TABLE t15; -DROP TABLE t15; -RESET MASTER; -START SLAVE; - -************************************************ -* - Create index on Master column not on slave * -* Expect:Warning * -************************************************ - -*** Create t16 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t16 on Master *** -CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Create Index and Data Insert *** -CREATE INDEX part_of_c6 ON t16 (c6); -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -***************** -*** BUG 30434 *** -***************** - -include/wait_for_slave_sql_error.inc [errno=1072] -Last_SQL_Error = 'Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'' -STOP SLAVE; -RESET SLAVE; - -*** Drop t16 *** -DROP TABLE t16; -DROP TABLE t16; -RESET MASTER; -START SLAVE; - -***************************************************** -* - Delete rows using column on Master not on slave * -* Expect: Rows Deleted * -***************************************************** - -*** Create t17 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t17 on Master *** -CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -** Delete from master ** -DELETE FROM t17 WHERE c6 = 3; -SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP - -** Check slave ** -SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -DROP TABLE t17; - - -***************************************************** -* - Update row using column on Master not on slave * -* Expect: Rows updated * -***************************************************** - -** Bug30674 ** - -*** Create t18 on slave *** - -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t18 on Master *** -CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -** update from master ** -UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; -SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP - -** Check slave ** -SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 TEST -DROP TABLE t18; - - -***************************************************** -* - Insert UUID column on Master not on slave * -* Expect: Rows inserted * -***************************************************** - -*** Create t5 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t5 on Master *** -CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 LONG, -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT), -(2,@b1,'JOE',UUID(),DEFAULT), -(3,@b1,'QA',UUID(),DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 6231623162316231 Kyle UUID TIME -2 6231623162316231 JOE UUID TIME -3 6231623162316231 QA UUID TIME - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; -c1 hex(c4) c5 -1 6231623162316231 Kyle -2 6231623162316231 JOE -3 6231623162316231 QA -DROP TABLE t5; -set binlog_format=mixed; - -*********************************************************** -*********************************************************** -***************** Start of Testing ************************ -*********************************************************** -*********************************************************** -* This test format == binlog_format MIXED and engine == 'InnoDB' -*********************************************************** -*********************************************************** - -***** Testing more columns on the Master ***** - -CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 FLOAT DEFAULT '2.00', -f6 CHAR(4) DEFAULT 'TEST', -f7 INT DEFAULT '0', -f8 TEXT, -f9 LONGBLOB, -f10 BIT(63), -f11 VARBINARY(64))ENGINE='InnoDB'; - -* Alter Table on Slave and drop columns f5 through f11 * - -alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; - -* Insert data in Master then update and delete some rows* - -* Select count and 20 rows from Master * - -SELECT COUNT(*) FROM t1; -COUNT(*) -40 - -SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, -hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20; -f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) -2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 - -* Select count and 20 rows from Slave * - -SELECT COUNT(*) FROM t1; -COUNT(*) -40 - -SELECT * FROM t1 ORDER BY f3 LIMIT 20; -f1 f2 f3 f4 -2 2 2 second -3 3 3 next -5 5 5 second -6 6 6 next -8 8 8 second -9 9 9 next -11 11 11 second -12 12 12 next -14 14 14 second -15 15 15 next -17 17 17 second -18 18 18 next -20 20 20 second -21 21 21 next -23 23 23 second -24 24 24 next -26 26 26 second -27 27 27 next -29 29 29 second -30 30 30 next -include/check_slave_is_running.inc - -***** Testing Altering table def scenario ***** - -CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 ENUM('a', 'b', 'c') default 'a', -f7 DECIMAL(17,9) default '1000.00', -f8 MEDIUMBLOB, -f9 NUMERIC(6,4) default '2000.00', -f10 VARCHAR(1024), -f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f12 SET('a', 'b', 'c') default 'b') -ENGINE='InnoDB'; -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 - -CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 ENUM('a', 'b', 'c') default 'a', -f8 MEDIUMBLOB, -f10 VARCHAR(1024), -f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f12 SET('a', 'b', 'c') default 'b') -ENGINE='InnoDB'; - -CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 DECIMAL(17,9) default '1000.00', -f7 MEDIUMBLOB, -f8 NUMERIC(6,4) default '2000.00', -f9 VARCHAR(1024), -f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f11 CHAR(255)) -ENGINE='InnoDB'; -Warnings: -Warning 1264 Out of range value for column 'f8' at row 1 - -CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 BIGINT, -f6 BLOB, -f7 DATE, -f8 DATETIME, -f9 FLOAT, -f10 INT, -f11 LONGBLOB, -f12 LONGTEXT, -f13 MEDIUMBLOB, -f14 MEDIUMINT, -f15 MEDIUMTEXT, -f16 REAL, -f17 SMALLINT, -f18 TEXT, -f19 TIME, -f20 TIMESTAMP, -f21 TINYBLOB, -f22 TINYINT, -f23 TINYTEXT, -f24 YEAR, -f25 BINARY(255), -f26 BIT(64), -f27 CHAR(255), -f28 DECIMAL(30,7), -f29 DOUBLE, -f30 ENUM ('a','b', 'c') default 'a', -f31 FLOAT, -f32 NUMERIC(17,9), -f33 SET ('a', 'b', 'c') default 'b', -f34 VARBINARY(1025), -f35 VARCHAR(257) -) ENGINE='InnoDB'; - -** Alter tables on slave and drop columns ** - -alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop -f12; -alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12; -alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; -alter table t31 -drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, -drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18, -drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25, -drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32, -drop f33, drop f34, drop f35; - -** Insert Data into Master ** -INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10: -some var char'; -INSERT into t2 values (2, 2, 2, 'second', -2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char', -'01234567', 'c'), -(3, 3, 3, 'third', -3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', -'01234567', 'c'); -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 -Warning 1264 Out of range value for column 'f9' at row 2 -INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char'; -INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10: -binary data'; -INSERT into t31 set f1=1, f2=1, f3=1, f4='first'; -INSERT into t31 set f1=1, f2=1, f3=2, f4='second', -f9=2.2, f10='seven samurai', f28=222.222, f35='222'; -Warnings: -Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1 -INSERT into t31 values (1, 1, 3, 'third', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ); -Warnings: -Warning 1264 Out of range value for column 'f5' at row 1 -Warning 1264 Out of range value for column 'f24' at row 1 -INSERT into t31 values (1, 1, 4, 'fourth', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ), -(1, 1, 5, 'fifth', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ), -(1, 1, 6, 'sixth', -/* f5 BIGINT, */ NULL, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ NULL -); -Warnings: -Warning 1264 Out of range value for column 'f5' at row 1 -Warning 1264 Out of range value for column 'f24' at row 1 -Warning 1264 Out of range value for column 'f5' at row 2 -Warning 1264 Out of range value for column 'f24' at row 2 -Warning 1264 Out of range value for column 'f24' at row 3 - -** Sync slave with master ** -** Do selects from tables ** - -select * from t1 order by f3; -f1 f2 f3 f4 -2 2 2 second -3 3 3 next -5 5 5 second -6 6 6 next -8 8 8 second -9 9 9 next -11 11 11 second -12 12 12 next -14 14 14 second -15 15 15 next -17 17 17 second -18 18 18 next -20 20 20 second -21 21 21 next -23 23 23 second -24 24 24 next -26 26 26 second -27 27 27 next -29 29 29 second -30 30 30 next -31 31 31 second -32 32 32 second -33 33 33 second -34 34 34 second -35 35 35 second -36 36 36 second -37 37 37 second -38 38 38 second -39 39 39 second -40 40 40 second -41 41 41 second -42 42 42 second -43 43 43 second -44 44 44 second -45 45 45 second -46 46 46 second -47 47 47 second -48 48 48 second -49 49 49 second -50 50 50 second -select * from t2 order by f1; -f1 f2 f3 f4 -1 1 1 first -2 2 2 second -3 3 3 third -select * from t3 order by f1; -f1 f2 f3 f4 -1 1 1 first -select * from t4 order by f1; -f1 f2 f3 f4 -1 1 1 first -select * from t31 order by f3; -f1 f2 f3 f4 -1 1 1 first -1 1 2 second -1 1 3 third -1 1 4 fourth -1 1 5 fifth -1 1 6 sixth - -** Do updates master ** - -update t31 set f5=555555555555555 where f3=6; -update t31 set f2=2 where f3=2; -update t31 set f1=NULL where f3=1; -update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; -Warnings: -Warning 1048 Column 'f3' cannot be null - -** Delete from Master ** - -delete from t1; -delete from t2; -delete from t3; -delete from t4; -delete from t31; -select * from t31; -f1 f2 f3 f4 - -** Check slave status ** - -include/check_slave_is_running.inc - -**************************************** -* columns in master at middle of table * -* Expect: Proper error message * -**************************************** - -** Stop and Reset Slave ** - -STOP SLAVE; -RESET SLAVE; - -** create table slave side ** -CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) -) ENGINE='InnoDB'; - -** Connect to master and create table ** - -CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', -c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), -(2,@b1,DEFAULT,'JOE',DEFAULT), -(3,@b1,DEFAULT,'QA',DEFAULT); - -******************************************** -*** Expect slave to fail with Error 1535 *** -******************************************** - -include/wait_for_slave_sql_error_and_skip.inc [errno=1535] -Last_SQL_Error = 'Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254' - -*** Drop t10 *** -DROP TABLE t10; - -********************************************* -* More columns in master at middle of table * -* Expect: Proper error message * -********************************************* - -*** Create t11 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) -) ENGINE='InnoDB'; - -*** Create t11 on Master *** -CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, -c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), -(2,@b1,'Testing is cool','JOE',DEFAULT), -(3,@b1,DEFAULT,'QA',DEFAULT); - -******************************************** -*** Expect slave to fail with Error 1535 *** -******************************************** - -include/wait_for_slave_sql_error_and_skip.inc [errno=1535] -Last_SQL_Error = 'Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15' - -*** Drop t11 *** -DROP TABLE t11; - -********************************************* -* More columns in master at middle of table * -* Expect: This one should pass blob-text * -********************************************* - -*** Create t12 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB -) ENGINE='InnoDB'; - -*** Create t12 on Master *** -CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, -c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',DEFAULT,DEFAULT), -(3,@b1,'QA',DEFAULT,DEFAULT); - -SELECT a,hex(b),f,c,e FROM t12 ORDER BY a; -a hex(b) f c e -1 62316231623162316231623162316231 Kyle test 1 -2 62316231623162316231623162316231 JOE test 1 -3 62316231623162316231623162316231 QA test 1 - -*** Select on Slave *** -SELECT a,hex(b),c FROM t12 ORDER BY a; -a hex(b) c -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -*** Drop t12 *** -DROP TABLE t12; - -**************************************************** -* - Alter Master adding columns at middle of table * -* Expect: columns added * -**************************************************** - - -*** Create t14 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t14 on Master *** -CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1; -ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2; - -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT), -(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT), -(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT); - -SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1; -c1 c2 c3 hex(c4) c5 c6 c7 -1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP -3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP - -*** Select on Slave **** -SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1; -c1 c2 c3 hex(c4) c5 -1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle -2 2.00 This Test Should work 62316231623162316231623162316231 JOE -3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA - -**************************************************** -* - Alter Master Dropping columns from the middle. * -* Expect: columns dropped * -**************************************************** - -*** connect to master and drop columns *** -ALTER TABLE t14 DROP COLUMN c2; -ALTER TABLE t14 DROP COLUMN c7; - -*** Select from Master *** -SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1; -c1 c3 hex(c4) c5 c6 -1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 -2 This Test Should work 62316231623162316231623162316231 JOE 1 -3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 - -************ -* Bug30415 * -************ -include/wait_for_slave_sql_error.inc [errno=1091] -Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'' -STOP SLAVE; -RESET SLAVE; - -*** Drop t14 *** -DROP TABLE t14; -DROP TABLE t14; -RESET MASTER; -START SLAVE; - -************************************************* -* - Alter Master adding columns at end of table * -* Expect: Error 1054 * -************************************************* - -*** Create t15 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t15 on Master *** -CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7; -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00), -(2,@b1,'JOE',DEFAULT,DEFAULT,3.00), -(3,@b1,'QA',DEFAULT,DEFAULT,3.00); -SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1; -c1 hex(c4) c5 c6 c7 c2 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00 -2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00 -3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00 - -******************************************** -*** Expect slave to fail with Error 1054 *** -******************************************** - -include/wait_for_slave_sql_error.inc [errno=1054] -Last_SQL_Error = 'Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'' -STOP SLAVE; -RESET SLAVE; - -*** Drop t15 *** -DROP TABLE t15; -DROP TABLE t15; -RESET MASTER; -START SLAVE; - -************************************************ -* - Create index on Master column not on slave * -* Expect:Warning * -************************************************ - -*** Create t16 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t16 on Master *** -CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Create Index and Data Insert *** -CREATE INDEX part_of_c6 ON t16 (c6); -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -***************** -*** BUG 30434 *** -***************** - -include/wait_for_slave_sql_error.inc [errno=1072] -Last_SQL_Error = 'Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'' -STOP SLAVE; -RESET SLAVE; - -*** Drop t16 *** -DROP TABLE t16; -DROP TABLE t16; -RESET MASTER; -START SLAVE; - -***************************************************** -* - Delete rows using column on Master not on slave * -* Expect: Rows Deleted * -***************************************************** - -*** Create t17 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t17 on Master *** -CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -** Delete from master ** -DELETE FROM t17 WHERE c6 = 3; -SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP - -** Check slave ** -SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -DROP TABLE t17; - - -***************************************************** -* - Update row using column on Master not on slave * -* Expect: Rows updated * -***************************************************** - -** Bug30674 ** - -*** Create t18 on slave *** - -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t18 on Master *** -CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -** update from master ** -UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; -SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP - -** Check slave ** -SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 TEST -DROP TABLE t18; - - ***************************************************** * - Insert UUID column on Master not on slave * * Expect: Rows inserted * diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result index 8aeb5bdc1c9..c390f0858d6 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result @@ -1,6 +1,5 @@ include/master-slave.inc [connection master] -set binlog_format=row; *********************************************************** *********************************************************** @@ -832,1748 +831,6 @@ c1 hex(c4) c5 DROP TABLE t18; -***************************************************** -* - Insert UUID column on Master not on slave * -* Expect: Rows inserted * -***************************************************** - -*** Create t5 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t5 on Master *** -CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 LONG, -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT), -(2,@b1,'JOE',UUID(),DEFAULT), -(3,@b1,'QA',UUID(),DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 6231623162316231 Kyle UUID TIME -2 6231623162316231 JOE UUID TIME -3 6231623162316231 QA UUID TIME - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; -c1 hex(c4) c5 -1 6231623162316231 Kyle -2 6231623162316231 JOE -3 6231623162316231 QA -DROP TABLE t5; -set binlog_format=statement; - -*********************************************************** -*********************************************************** -***************** Start of Testing ************************ -*********************************************************** -*********************************************************** -* This test format == binlog_format STATEMENT and engine == 'MyISAM' -*********************************************************** -*********************************************************** - -***** Testing more columns on the Master ***** - -CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 FLOAT DEFAULT '2.00', -f6 CHAR(4) DEFAULT 'TEST', -f7 INT DEFAULT '0', -f8 TEXT, -f9 LONGBLOB, -f10 BIT(63), -f11 VARBINARY(64))ENGINE='MyISAM'; - -* Alter Table on Slave and drop columns f5 through f11 * - -alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; - -* Insert data in Master then update and delete some rows* - -* Select count and 20 rows from Master * - -SELECT COUNT(*) FROM t1; -COUNT(*) -40 - -SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, -hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20; -f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) -2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 - -* Select count and 20 rows from Slave * - -SELECT COUNT(*) FROM t1; -COUNT(*) -40 - -SELECT * FROM t1 ORDER BY f3 LIMIT 20; -f1 f2 f3 f4 -2 2 2 second -3 3 3 next -5 5 5 second -6 6 6 next -8 8 8 second -9 9 9 next -11 11 11 second -12 12 12 next -14 14 14 second -15 15 15 next -17 17 17 second -18 18 18 next -20 20 20 second -21 21 21 next -23 23 23 second -24 24 24 next -26 26 26 second -27 27 27 next -29 29 29 second -30 30 30 next -include/check_slave_is_running.inc - -***** Testing Altering table def scenario ***** - -CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 ENUM('a', 'b', 'c') default 'a', -f7 DECIMAL(17,9) default '1000.00', -f8 MEDIUMBLOB, -f9 NUMERIC(6,4) default '2000.00', -f10 VARCHAR(1024), -f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f12 SET('a', 'b', 'c') default 'b') -ENGINE='MyISAM'; -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 - -CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 ENUM('a', 'b', 'c') default 'a', -f8 MEDIUMBLOB, -f10 VARCHAR(1024), -f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f12 SET('a', 'b', 'c') default 'b') -ENGINE='MyISAM'; - -CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 DECIMAL(17,9) default '1000.00', -f7 MEDIUMBLOB, -f8 NUMERIC(6,4) default '2000.00', -f9 VARCHAR(1024), -f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f11 CHAR(255)) -ENGINE='MyISAM'; -Warnings: -Warning 1264 Out of range value for column 'f8' at row 1 - -CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 BIGINT, -f6 BLOB, -f7 DATE, -f8 DATETIME, -f9 FLOAT, -f10 INT, -f11 LONGBLOB, -f12 LONGTEXT, -f13 MEDIUMBLOB, -f14 MEDIUMINT, -f15 MEDIUMTEXT, -f16 REAL, -f17 SMALLINT, -f18 TEXT, -f19 TIME, -f20 TIMESTAMP, -f21 TINYBLOB, -f22 TINYINT, -f23 TINYTEXT, -f24 YEAR, -f25 BINARY(255), -f26 BIT(64), -f27 CHAR(255), -f28 DECIMAL(30,7), -f29 DOUBLE, -f30 ENUM ('a','b', 'c') default 'a', -f31 FLOAT, -f32 NUMERIC(17,9), -f33 SET ('a', 'b', 'c') default 'b', -f34 VARBINARY(1025), -f35 VARCHAR(257) -) ENGINE='MyISAM'; - -** Alter tables on slave and drop columns ** - -alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop -f12; -alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12; -alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; -alter table t31 -drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, -drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18, -drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25, -drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32, -drop f33, drop f34, drop f35; - -** Insert Data into Master ** -INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10: -some var char'; -INSERT into t2 values (2, 2, 2, 'second', -2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char', -'01234567', 'c'), -(3, 3, 3, 'third', -3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', -'01234567', 'c'); -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 -Warning 1264 Out of range value for column 'f9' at row 2 -INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char'; -INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10: -binary data'; -INSERT into t31 set f1=1, f2=1, f3=1, f4='first'; -INSERT into t31 set f1=1, f2=1, f3=2, f4='second', -f9=2.2, f10='seven samurai', f28=222.222, f35='222'; -Warnings: -Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1 -INSERT into t31 values (1, 1, 3, 'third', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ); -Warnings: -Warning 1264 Out of range value for column 'f5' at row 1 -Warning 1264 Out of range value for column 'f24' at row 1 -INSERT into t31 values (1, 1, 4, 'fourth', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ), -(1, 1, 5, 'fifth', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ), -(1, 1, 6, 'sixth', -/* f5 BIGINT, */ NULL, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ NULL -); -Warnings: -Warning 1264 Out of range value for column 'f5' at row 1 -Warning 1264 Out of range value for column 'f24' at row 1 -Warning 1264 Out of range value for column 'f5' at row 2 -Warning 1264 Out of range value for column 'f24' at row 2 -Warning 1264 Out of range value for column 'f24' at row 3 - -** Sync slave with master ** -** Do selects from tables ** - -select * from t1 order by f3; -f1 f2 f3 f4 -2 2 2 second -3 3 3 next -5 5 5 second -6 6 6 next -8 8 8 second -9 9 9 next -11 11 11 second -12 12 12 next -14 14 14 second -15 15 15 next -17 17 17 second -18 18 18 next -20 20 20 second -21 21 21 next -23 23 23 second -24 24 24 next -26 26 26 second -27 27 27 next -29 29 29 second -30 30 30 next -31 31 31 second -32 32 32 second -33 33 33 second -34 34 34 second -35 35 35 second -36 36 36 second -37 37 37 second -38 38 38 second -39 39 39 second -40 40 40 second -41 41 41 second -42 42 42 second -43 43 43 second -44 44 44 second -45 45 45 second -46 46 46 second -47 47 47 second -48 48 48 second -49 49 49 second -50 50 50 second -select * from t2 order by f1; -f1 f2 f3 f4 -1 1 1 first -2 2 2 second -3 3 3 third -select * from t3 order by f1; -f1 f2 f3 f4 -1 1 1 first -select * from t4 order by f1; -f1 f2 f3 f4 -1 1 1 first -select * from t31 order by f3; -f1 f2 f3 f4 -1 1 1 first -1 1 2 second -1 1 3 third -1 1 4 fourth -1 1 5 fifth -1 1 6 sixth - -** Do updates master ** - -update t31 set f5=555555555555555 where f3=6; -update t31 set f2=2 where f3=2; -update t31 set f1=NULL where f3=1; -update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; -Warnings: -Warning 1048 Column 'f3' cannot be null - -** Delete from Master ** - -delete from t1; -delete from t2; -delete from t3; -delete from t4; -delete from t31; -select * from t31; -f1 f2 f3 f4 - -** Check slave status ** - -include/check_slave_is_running.inc - -**************************************** -* columns in master at middle of table * -* Expect: Proper error message * -**************************************** - -** Stop and Reset Slave ** - -STOP SLAVE; -RESET SLAVE; - -** create table slave side ** -CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) -) ENGINE='MyISAM'; - -** Connect to master and create table ** - -CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', -c CHAR(5), e INT DEFAULT '1')ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), -(2,@b1,DEFAULT,'JOE',DEFAULT), -(3,@b1,DEFAULT,'QA',DEFAULT); - -******************************************** -*** Expect slave to fail with Error 1535 *** -******************************************** - -include/wait_for_slave_sql_error_and_skip.inc [errno=1535] -Last_SQL_Error = 'Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254' - -*** Drop t10 *** -DROP TABLE t10; - -********************************************* -* More columns in master at middle of table * -* Expect: Proper error message * -********************************************* - -*** Create t11 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) -) ENGINE='MyISAM'; - -*** Create t11 on Master *** -CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, -c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), -(2,@b1,'Testing is cool','JOE',DEFAULT), -(3,@b1,DEFAULT,'QA',DEFAULT); - -******************************************** -*** Expect slave to fail with Error 1535 *** -******************************************** - -include/wait_for_slave_sql_error_and_skip.inc [errno=1535] -Last_SQL_Error = 'Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15' - -*** Drop t11 *** -DROP TABLE t11; - -********************************************* -* More columns in master at middle of table * -* Expect: This one should pass blob-text * -********************************************* - -*** Create t12 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB -) ENGINE='MyISAM'; - -*** Create t12 on Master *** -CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, -c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',DEFAULT,DEFAULT), -(3,@b1,'QA',DEFAULT,DEFAULT); - -SELECT a,hex(b),f,c,e FROM t12 ORDER BY a; -a hex(b) f c e -1 62316231623162316231623162316231 Kyle test 1 -2 62316231623162316231623162316231 JOE test 1 -3 62316231623162316231623162316231 QA test 1 - -*** Select on Slave *** -SELECT a,hex(b),c FROM t12 ORDER BY a; -a hex(b) c -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -*** Drop t12 *** -DROP TABLE t12; - -**************************************************** -* - Alter Master adding columns at middle of table * -* Expect: columns added * -**************************************************** - - -*** Create t14 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t14 on Master *** -CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1; -ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2; - -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT), -(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT), -(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT); - -SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1; -c1 c2 c3 hex(c4) c5 c6 c7 -1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP -3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP - -*** Select on Slave **** -SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1; -c1 c2 c3 hex(c4) c5 -1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle -2 2.00 This Test Should work 62316231623162316231623162316231 JOE -3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA - -**************************************************** -* - Alter Master Dropping columns from the middle. * -* Expect: columns dropped * -**************************************************** - -*** connect to master and drop columns *** -ALTER TABLE t14 DROP COLUMN c2; -ALTER TABLE t14 DROP COLUMN c7; - -*** Select from Master *** -SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1; -c1 c3 hex(c4) c5 c6 -1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 -2 This Test Should work 62316231623162316231623162316231 JOE 1 -3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 - -************ -* Bug30415 * -************ -include/wait_for_slave_sql_error.inc [errno=1091] -Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'' -STOP SLAVE; -RESET SLAVE; - -*** Drop t14 *** -DROP TABLE t14; -DROP TABLE t14; -RESET MASTER; -START SLAVE; - -************************************************* -* - Alter Master adding columns at end of table * -* Expect: Error 1054 * -************************************************* - -*** Create t15 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t15 on Master *** -CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7; -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00), -(2,@b1,'JOE',DEFAULT,DEFAULT,3.00), -(3,@b1,'QA',DEFAULT,DEFAULT,3.00); -SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1; -c1 hex(c4) c5 c6 c7 c2 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00 -2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00 -3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00 - -******************************************** -*** Expect slave to fail with Error 1054 *** -******************************************** - -include/wait_for_slave_sql_error.inc [errno=1054] -Last_SQL_Error = 'Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'' -STOP SLAVE; -RESET SLAVE; - -*** Drop t15 *** -DROP TABLE t15; -DROP TABLE t15; -RESET MASTER; -START SLAVE; - -************************************************ -* - Create index on Master column not on slave * -* Expect:Warning * -************************************************ - -*** Create t16 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t16 on Master *** -CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Create Index and Data Insert *** -CREATE INDEX part_of_c6 ON t16 (c6); -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -***************** -*** BUG 30434 *** -***************** - -include/wait_for_slave_sql_error.inc [errno=1072] -Last_SQL_Error = 'Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'' -STOP SLAVE; -RESET SLAVE; - -*** Drop t16 *** -DROP TABLE t16; -DROP TABLE t16; -RESET MASTER; -START SLAVE; - -***************************************************** -* - Delete rows using column on Master not on slave * -* Expect: Rows Deleted * -***************************************************** - -*** Create t17 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t17 on Master *** -CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -** Delete from master ** -DELETE FROM t17 WHERE c6 = 3; -SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP - -** Check slave ** -SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -DROP TABLE t17; - - -***************************************************** -* - Update row using column on Master not on slave * -* Expect: Rows updated * -***************************************************** - -** Bug30674 ** - -*** Create t18 on slave *** - -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t18 on Master *** -CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -** update from master ** -UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; -SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP - -** Check slave ** -SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 TEST -DROP TABLE t18; - - -***************************************************** -* - Insert UUID column on Master not on slave * -* Expect: Rows inserted * -***************************************************** - -*** Create t5 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t5 on Master *** -CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 LONG, -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT), -(2,@b1,'JOE',UUID(),DEFAULT), -(3,@b1,'QA',UUID(),DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 6231623162316231 Kyle UUID TIME -2 6231623162316231 JOE UUID TIME -3 6231623162316231 QA UUID TIME - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; -c1 hex(c4) c5 -1 6231623162316231 Kyle -2 6231623162316231 JOE -3 6231623162316231 QA -DROP TABLE t5; -set binlog_format=mixed; - -*********************************************************** -*********************************************************** -***************** Start of Testing ************************ -*********************************************************** -*********************************************************** -* This test format == binlog_format MIXED and engine == 'MyISAM' -*********************************************************** -*********************************************************** - -***** Testing more columns on the Master ***** - -CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 FLOAT DEFAULT '2.00', -f6 CHAR(4) DEFAULT 'TEST', -f7 INT DEFAULT '0', -f8 TEXT, -f9 LONGBLOB, -f10 BIT(63), -f11 VARBINARY(64))ENGINE='MyISAM'; - -* Alter Table on Slave and drop columns f5 through f11 * - -alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; - -* Insert data in Master then update and delete some rows* - -* Select count and 20 rows from Master * - -SELECT COUNT(*) FROM t1; -COUNT(*) -40 - -SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, -hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20; -f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) -2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 - -* Select count and 20 rows from Slave * - -SELECT COUNT(*) FROM t1; -COUNT(*) -40 - -SELECT * FROM t1 ORDER BY f3 LIMIT 20; -f1 f2 f3 f4 -2 2 2 second -3 3 3 next -5 5 5 second -6 6 6 next -8 8 8 second -9 9 9 next -11 11 11 second -12 12 12 next -14 14 14 second -15 15 15 next -17 17 17 second -18 18 18 next -20 20 20 second -21 21 21 next -23 23 23 second -24 24 24 next -26 26 26 second -27 27 27 next -29 29 29 second -30 30 30 next -include/check_slave_is_running.inc - -***** Testing Altering table def scenario ***** - -CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 ENUM('a', 'b', 'c') default 'a', -f7 DECIMAL(17,9) default '1000.00', -f8 MEDIUMBLOB, -f9 NUMERIC(6,4) default '2000.00', -f10 VARCHAR(1024), -f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f12 SET('a', 'b', 'c') default 'b') -ENGINE='MyISAM'; -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 - -CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 ENUM('a', 'b', 'c') default 'a', -f8 MEDIUMBLOB, -f10 VARCHAR(1024), -f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f12 SET('a', 'b', 'c') default 'b') -ENGINE='MyISAM'; - -CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 DECIMAL(17,9) default '1000.00', -f7 MEDIUMBLOB, -f8 NUMERIC(6,4) default '2000.00', -f9 VARCHAR(1024), -f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f11 CHAR(255)) -ENGINE='MyISAM'; -Warnings: -Warning 1264 Out of range value for column 'f8' at row 1 - -CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 BIGINT, -f6 BLOB, -f7 DATE, -f8 DATETIME, -f9 FLOAT, -f10 INT, -f11 LONGBLOB, -f12 LONGTEXT, -f13 MEDIUMBLOB, -f14 MEDIUMINT, -f15 MEDIUMTEXT, -f16 REAL, -f17 SMALLINT, -f18 TEXT, -f19 TIME, -f20 TIMESTAMP, -f21 TINYBLOB, -f22 TINYINT, -f23 TINYTEXT, -f24 YEAR, -f25 BINARY(255), -f26 BIT(64), -f27 CHAR(255), -f28 DECIMAL(30,7), -f29 DOUBLE, -f30 ENUM ('a','b', 'c') default 'a', -f31 FLOAT, -f32 NUMERIC(17,9), -f33 SET ('a', 'b', 'c') default 'b', -f34 VARBINARY(1025), -f35 VARCHAR(257) -) ENGINE='MyISAM'; - -** Alter tables on slave and drop columns ** - -alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop -f12; -alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12; -alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; -alter table t31 -drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, -drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18, -drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25, -drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32, -drop f33, drop f34, drop f35; - -** Insert Data into Master ** -INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10: -some var char'; -INSERT into t2 values (2, 2, 2, 'second', -2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char', -'01234567', 'c'), -(3, 3, 3, 'third', -3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', -'01234567', 'c'); -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 -Warning 1264 Out of range value for column 'f9' at row 2 -INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char'; -INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10: -binary data'; -INSERT into t31 set f1=1, f2=1, f3=1, f4='first'; -INSERT into t31 set f1=1, f2=1, f3=2, f4='second', -f9=2.2, f10='seven samurai', f28=222.222, f35='222'; -Warnings: -Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1 -INSERT into t31 values (1, 1, 3, 'third', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ); -Warnings: -Warning 1264 Out of range value for column 'f5' at row 1 -Warning 1264 Out of range value for column 'f24' at row 1 -INSERT into t31 values (1, 1, 4, 'fourth', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ), -(1, 1, 5, 'fifth', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ), -(1, 1, 6, 'sixth', -/* f5 BIGINT, */ NULL, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ NULL -); -Warnings: -Warning 1264 Out of range value for column 'f5' at row 1 -Warning 1264 Out of range value for column 'f24' at row 1 -Warning 1264 Out of range value for column 'f5' at row 2 -Warning 1264 Out of range value for column 'f24' at row 2 -Warning 1264 Out of range value for column 'f24' at row 3 - -** Sync slave with master ** -** Do selects from tables ** - -select * from t1 order by f3; -f1 f2 f3 f4 -2 2 2 second -3 3 3 next -5 5 5 second -6 6 6 next -8 8 8 second -9 9 9 next -11 11 11 second -12 12 12 next -14 14 14 second -15 15 15 next -17 17 17 second -18 18 18 next -20 20 20 second -21 21 21 next -23 23 23 second -24 24 24 next -26 26 26 second -27 27 27 next -29 29 29 second -30 30 30 next -31 31 31 second -32 32 32 second -33 33 33 second -34 34 34 second -35 35 35 second -36 36 36 second -37 37 37 second -38 38 38 second -39 39 39 second -40 40 40 second -41 41 41 second -42 42 42 second -43 43 43 second -44 44 44 second -45 45 45 second -46 46 46 second -47 47 47 second -48 48 48 second -49 49 49 second -50 50 50 second -select * from t2 order by f1; -f1 f2 f3 f4 -1 1 1 first -2 2 2 second -3 3 3 third -select * from t3 order by f1; -f1 f2 f3 f4 -1 1 1 first -select * from t4 order by f1; -f1 f2 f3 f4 -1 1 1 first -select * from t31 order by f3; -f1 f2 f3 f4 -1 1 1 first -1 1 2 second -1 1 3 third -1 1 4 fourth -1 1 5 fifth -1 1 6 sixth - -** Do updates master ** - -update t31 set f5=555555555555555 where f3=6; -update t31 set f2=2 where f3=2; -update t31 set f1=NULL where f3=1; -update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; -Warnings: -Warning 1048 Column 'f3' cannot be null - -** Delete from Master ** - -delete from t1; -delete from t2; -delete from t3; -delete from t4; -delete from t31; -select * from t31; -f1 f2 f3 f4 - -** Check slave status ** - -include/check_slave_is_running.inc - -**************************************** -* columns in master at middle of table * -* Expect: Proper error message * -**************************************** - -** Stop and Reset Slave ** - -STOP SLAVE; -RESET SLAVE; - -** create table slave side ** -CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) -) ENGINE='MyISAM'; - -** Connect to master and create table ** - -CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', -c CHAR(5), e INT DEFAULT '1')ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), -(2,@b1,DEFAULT,'JOE',DEFAULT), -(3,@b1,DEFAULT,'QA',DEFAULT); - -******************************************** -*** Expect slave to fail with Error 1535 *** -******************************************** - -include/wait_for_slave_sql_error_and_skip.inc [errno=1535] -Last_SQL_Error = 'Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254' - -*** Drop t10 *** -DROP TABLE t10; - -********************************************* -* More columns in master at middle of table * -* Expect: Proper error message * -********************************************* - -*** Create t11 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) -) ENGINE='MyISAM'; - -*** Create t11 on Master *** -CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, -c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), -(2,@b1,'Testing is cool','JOE',DEFAULT), -(3,@b1,DEFAULT,'QA',DEFAULT); - -******************************************** -*** Expect slave to fail with Error 1535 *** -******************************************** - -include/wait_for_slave_sql_error_and_skip.inc [errno=1535] -Last_SQL_Error = 'Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15' - -*** Drop t11 *** -DROP TABLE t11; - -********************************************* -* More columns in master at middle of table * -* Expect: This one should pass blob-text * -********************************************* - -*** Create t12 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB -) ENGINE='MyISAM'; - -*** Create t12 on Master *** -CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, -c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',DEFAULT,DEFAULT), -(3,@b1,'QA',DEFAULT,DEFAULT); - -SELECT a,hex(b),f,c,e FROM t12 ORDER BY a; -a hex(b) f c e -1 62316231623162316231623162316231 Kyle test 1 -2 62316231623162316231623162316231 JOE test 1 -3 62316231623162316231623162316231 QA test 1 - -*** Select on Slave *** -SELECT a,hex(b),c FROM t12 ORDER BY a; -a hex(b) c -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -*** Drop t12 *** -DROP TABLE t12; - -**************************************************** -* - Alter Master adding columns at middle of table * -* Expect: columns added * -**************************************************** - - -*** Create t14 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t14 on Master *** -CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1; -ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2; - -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT), -(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT), -(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT); - -SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1; -c1 c2 c3 hex(c4) c5 c6 c7 -1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP -3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP - -*** Select on Slave **** -SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1; -c1 c2 c3 hex(c4) c5 -1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle -2 2.00 This Test Should work 62316231623162316231623162316231 JOE -3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA - -**************************************************** -* - Alter Master Dropping columns from the middle. * -* Expect: columns dropped * -**************************************************** - -*** connect to master and drop columns *** -ALTER TABLE t14 DROP COLUMN c2; -ALTER TABLE t14 DROP COLUMN c7; - -*** Select from Master *** -SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1; -c1 c3 hex(c4) c5 c6 -1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 -2 This Test Should work 62316231623162316231623162316231 JOE 1 -3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 - -************ -* Bug30415 * -************ -include/wait_for_slave_sql_error.inc [errno=1091] -Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'' -STOP SLAVE; -RESET SLAVE; - -*** Drop t14 *** -DROP TABLE t14; -DROP TABLE t14; -RESET MASTER; -START SLAVE; - -************************************************* -* - Alter Master adding columns at end of table * -* Expect: Error 1054 * -************************************************* - -*** Create t15 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t15 on Master *** -CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7; -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00), -(2,@b1,'JOE',DEFAULT,DEFAULT,3.00), -(3,@b1,'QA',DEFAULT,DEFAULT,3.00); -SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1; -c1 hex(c4) c5 c6 c7 c2 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00 -2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00 -3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00 - -******************************************** -*** Expect slave to fail with Error 1054 *** -******************************************** - -include/wait_for_slave_sql_error.inc [errno=1054] -Last_SQL_Error = 'Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'' -STOP SLAVE; -RESET SLAVE; - -*** Drop t15 *** -DROP TABLE t15; -DROP TABLE t15; -RESET MASTER; -START SLAVE; - -************************************************ -* - Create index on Master column not on slave * -* Expect:Warning * -************************************************ - -*** Create t16 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t16 on Master *** -CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Create Index and Data Insert *** -CREATE INDEX part_of_c6 ON t16 (c6); -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -***************** -*** BUG 30434 *** -***************** - -include/wait_for_slave_sql_error.inc [errno=1072] -Last_SQL_Error = 'Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'' -STOP SLAVE; -RESET SLAVE; - -*** Drop t16 *** -DROP TABLE t16; -DROP TABLE t16; -RESET MASTER; -START SLAVE; - -***************************************************** -* - Delete rows using column on Master not on slave * -* Expect: Rows Deleted * -***************************************************** - -*** Create t17 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t17 on Master *** -CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -** Delete from master ** -DELETE FROM t17 WHERE c6 = 3; -SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP - -** Check slave ** -SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -DROP TABLE t17; - - -***************************************************** -* - Update row using column on Master not on slave * -* Expect: Rows updated * -***************************************************** - -** Bug30674 ** - -*** Create t18 on slave *** - -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t18 on Master *** -CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -** update from master ** -UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; -SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP - -** Check slave ** -SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 TEST -DROP TABLE t18; - - ***************************************************** * - Insert UUID column on Master not on slave * * Expect: Rows inserted * diff --git a/mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test b/mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test index 11211e51286..201392346be 100644 --- a/mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test +++ b/mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test @@ -1,17 +1,11 @@ ############################################################# # Purpose: To test having extra columns on the master WL#3915 ############################################################# --- source include/master-slave.inc +-- source include/have_binlog_format_row.inc -- source include/have_innodb.inc +-- source include/master-slave.inc let $engine_type = 'InnoDB'; +--source extra/rpl_tests/rpl_extra_col_master.test -set binlog_format=row; --- source extra/rpl_tests/rpl_extra_col_master.test - -set binlog_format=statement; --- source extra/rpl_tests/rpl_extra_col_master.test - -set binlog_format=mixed; --- source extra/rpl_tests/rpl_extra_col_master.test --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test b/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test index 2343d430784..4f344cfaca9 100644 --- a/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test +++ b/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test @@ -1,16 +1,10 @@ ############################################################# # Purpose: To test having extra columns on the master WL#3915 ############################################################# +-- source include/have_binlog_format_row.inc -- source include/master-slave.inc let $engine_type = 'MyISAM'; +--source extra/rpl_tests/rpl_extra_col_master.test -set binlog_format=row; --- source extra/rpl_tests/rpl_extra_col_master.test - -set binlog_format=statement; --- source extra/rpl_tests/rpl_extra_col_master.test - -set binlog_format=mixed; --- source extra/rpl_tests/rpl_extra_col_master.test --source include/rpl_end.inc -- cgit v1.2.1 From 10543a4a2eb68ecb618936b57d62c6ca1f7eb6bb Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Mon, 16 Jan 2012 12:04:28 +0200 Subject: Bug #11754014: 45549: udf plugin_dir path separator inconsistency and cryptic error 1126 message The problem was that dlopen() related code was using just a subset of the path normalization routines used in other places. Fixed the expansion of the pre-dlopen() behavior for plugins and UDFs to use a platform-dependent consistent encoding of the paths. Fixed the error dlopen() error handling to take the correct error message and strip off the trailing newline character(s). Fixed tests to do a platform independent replace of directories and to account for the traling slash. --- .../suite/sys_vars/r/character_sets_dir_basic.result | 10 +++++----- mysql-test/suite/sys_vars/r/plugin_dir_basic.result | 10 +++++----- .../suite/sys_vars/t/character_sets_dir_basic.test | 19 ++++++++++++++----- 3 files changed, 24 insertions(+), 15 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/sys_vars/r/character_sets_dir_basic.result b/mysql-test/suite/sys_vars/r/character_sets_dir_basic.result index c04e5dac199..ef8ec0cd9b8 100644 --- a/mysql-test/suite/sys_vars/r/character_sets_dir_basic.result +++ b/mysql-test/suite/sys_vars/r/character_sets_dir_basic.result @@ -1,20 +1,20 @@ select @@global.character_sets_dir; @@global.character_sets_dir -MYSQL_CHARSETSDIR/ +MYSQL_CHARSETSDIR select @@session.character_sets_dir; ERROR HY000: Variable 'character_sets_dir' is a GLOBAL variable show global variables like 'character_sets_dir'; Variable_name Value -character_sets_dir MYSQL_CHARSETSDIR/ +character_sets_dir MYSQL_CHARSETSDIR show session variables like 'character_sets_dir'; Variable_name Value -character_sets_dir MYSQL_CHARSETSDIR/ +character_sets_dir MYSQL_CHARSETSDIR select * from information_schema.global_variables where variable_name='character_sets_dir'; VARIABLE_NAME VARIABLE_VALUE -CHARACTER_SETS_DIR MYSQL_CHARSETSDIR/ +CHARACTER_SETS_DIR MYSQL_CHARSETSDIR select * from information_schema.session_variables where variable_name='character_sets_dir'; VARIABLE_NAME VARIABLE_VALUE -CHARACTER_SETS_DIR MYSQL_CHARSETSDIR/ +CHARACTER_SETS_DIR MYSQL_CHARSETSDIR set global character_sets_dir="foo"; ERROR HY000: Variable 'character_sets_dir' is a read only variable set session character_sets_dir="foo"; diff --git a/mysql-test/suite/sys_vars/r/plugin_dir_basic.result b/mysql-test/suite/sys_vars/r/plugin_dir_basic.result index a5f36de73fa..e2c03bcad6a 100644 --- a/mysql-test/suite/sys_vars/r/plugin_dir_basic.result +++ b/mysql-test/suite/sys_vars/r/plugin_dir_basic.result @@ -1,20 +1,20 @@ select @@global.plugin_dir; @@global.plugin_dir -MYSQL_TMP_DIR +MYSQL_TMP_DIR/ select @@session.plugin_dir; ERROR HY000: Variable 'plugin_dir' is a GLOBAL variable show global variables like 'plugin_dir'; Variable_name Value -plugin_dir MYSQL_TMP_DIR +plugin_dir MYSQL_TMP_DIR/ show session variables like 'plugin_dir'; Variable_name Value -plugin_dir MYSQL_TMP_DIR +plugin_dir MYSQL_TMP_DIR/ select * from information_schema.global_variables where variable_name='plugin_dir'; VARIABLE_NAME VARIABLE_VALUE -PLUGIN_DIR MYSQL_TMP_DIR +PLUGIN_DIR MYSQL_TMP_DIR/ select * from information_schema.session_variables where variable_name='plugin_dir'; VARIABLE_NAME VARIABLE_VALUE -PLUGIN_DIR MYSQL_TMP_DIR +PLUGIN_DIR MYSQL_TMP_DIR/ set global plugin_dir=1; ERROR HY000: Variable 'plugin_dir' is a read only variable set session plugin_dir=1; diff --git a/mysql-test/suite/sys_vars/t/character_sets_dir_basic.test b/mysql-test/suite/sys_vars/t/character_sets_dir_basic.test index 3d9de961530..0660fbeba2b 100644 --- a/mysql-test/suite/sys_vars/t/character_sets_dir_basic.test +++ b/mysql-test/suite/sys_vars/t/character_sets_dir_basic.test @@ -1,17 +1,26 @@ # # show the global and session values; # ---replace_result $MYSQL_CHARSETSDIR MYSQL_CHARSETSDIR + +# workaround to adjust for the directory separators being different in +# different OSes : slash on unixes and backslash or slash on windows. +# TODO: fix with a proper comparison in mysqltest +let $rcd= `SELECT REPLACE('$MYSQL_CHARSETSDIR', '\\\\\', '.')`; +let $rcd= `SELECT REPLACE('$rcd', '/', '.')`; +let $regex_charsetdir= `SELECT '/$rcd[\\\\\/\\\\\]/MYSQL_CHARSETSDIR/'`; + +--replace_regex $regex_charsetdir select @@global.character_sets_dir; + --error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@session.character_sets_dir; ---replace_result $MYSQL_CHARSETSDIR MYSQL_CHARSETSDIR +--replace_regex $regex_charsetdir show global variables like 'character_sets_dir'; ---replace_result $MYSQL_CHARSETSDIR MYSQL_CHARSETSDIR +--replace_regex $regex_charsetdir show session variables like 'character_sets_dir'; ---replace_result $MYSQL_CHARSETSDIR MYSQL_CHARSETSDIR +--replace_regex $regex_charsetdir select * from information_schema.global_variables where variable_name='character_sets_dir'; ---replace_result $MYSQL_CHARSETSDIR MYSQL_CHARSETSDIR +--replace_regex $regex_charsetdir select * from information_schema.session_variables where variable_name='character_sets_dir'; # -- cgit v1.2.1 From 7cdd7a7493d080a7e6cce32eb950999fbfd29167 Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Wed, 18 Jan 2012 00:16:19 +0200 Subject: BUG#13593869 - 64035: SEVERAL ERRORS IN COM_BINLOG_DUMP/MYSQL_BINLOG_SEND CRASH THE SERVER The server crashes when receiving a COM_BINLOG_DUMP command with a position of 0 or larger than the file size. The execution proceeds to an error block having the last read replication coordinates pointer be NULL and its dereferencing crashed the server. Fixed with making "public" previously used only for heartbeat coordinates. mysql-test/extra/rpl_tests/rpl_start_stop_slave.test: regression test for bug#3593869-64035 is added. mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result: results updated (error mess format is changed). mysql-test/suite/rpl/r/rpl_log_pos.result: results updated (error mess format is changed). mysql-test/suite/rpl/r/rpl_manual_change_index_file.result: results updated (error mess format is changed). mysql-test/suite/rpl/r/rpl_packet.result: results updated (error mess format is changed). mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result: results updated (error mess format is changed). mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test: Slave is stopped by bug#3593869-64035 tests so -let $rpl_only_running_threads= 1 is set prior to rpl_end. sql/share/errmsg-utf8.txt: Increasing the max length of explanatory message to 512. sql/sql_repl.cc: Making `coord' to carry the last read from binlog event coordinates regardless of heartbeat. Renaming, small cleanup and simplifying the code after if (coord) becomes unnecessary. Adding yet another 3rd pair of coordinates - the starting replication - into error text. --- .../extra/rpl_tests/rpl_start_stop_slave.test | 33 ++++++++++++++++++++++ .../rpl/r/rpl_cant_read_event_incident.result | 2 +- mysql-test/suite/rpl/r/rpl_log_pos.result | 2 +- .../rpl/r/rpl_manual_change_index_file.result | 2 +- mysql-test/suite/rpl/r/rpl_packet.result | 2 +- .../suite/rpl/r/rpl_stm_start_stop_slave.result | 10 +++++++ .../suite/rpl/t/rpl_cant_read_event_incident.test | 1 + .../suite/rpl/t/rpl_stm_start_stop_slave.test | 2 +- 8 files changed, 49 insertions(+), 5 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test index 42250764b54..301f4d84c58 100644 --- a/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test +++ b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test @@ -177,3 +177,36 @@ UNLOCK TABLES; --connection master DROP TABLE t1; sync_slave_with_master; + +# +# bug#3593869-64035 uninitialized event_coordinates instance crashes server +# Testing how out of valid range position value is handled with an error. +# + +--connection master +RESET MASTER; +let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1); +let $master_pos= `SELECT $master_pos + 1`; + +--connection slave +--source include/stop_slave.inc +--replace_regex /[0-9]+/MASTER_POS/ +eval CHANGE MASTER TO master_log_pos=$master_pos; + +START SLAVE; +# ER_MASTER_FATAL_ERROR_READING_BINLOG 1236 +--let $slave_param=Last_IO_Errno +--let $slave_param_value=1236 +--source include/wait_for_slave_param.inc + +--let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ +--let $status_items= Last_IO_Errno, Last_IO_Error +--source include/show_slave_status.inc + +--source include/stop_slave.inc +RESET SLAVE; + +--connection master +RESET MASTER; + +# Slave is stopped by bug#3593869-64035 tests. diff --git a/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result index c1b2c6e3195..a719f865090 100644 --- a/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result +++ b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result @@ -11,7 +11,7 @@ reset slave; start slave; include/wait_for_slave_param.inc [Last_IO_Errno] Last_IO_Errno = '1236' -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the last event was read from './master-bin.000001' at 316, the last byte read was read from './master-bin.000001' at 335.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the start event position from '' at XXX, the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' reset master; stop slave; reset slave; diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index 72e7c3e2d7f..afd91a29f9e 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -9,7 +9,7 @@ change master to master_log_pos=MASTER_LOG_POS; Read_Master_Log_Pos = '75' start slave; include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the start event position from 'master-bin.000001' at XXX, the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' include/stop_slave_sql.inc show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result index e41886ddf6b..efe9bf076f0 100644 --- a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result +++ b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result @@ -5,7 +5,7 @@ CREATE TABLE t1(c1 INT); FLUSH LOGS; call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log'); include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the last event was read from 'master-bin.000002' at XXX, the last byte read was read from 'master-bin.000002' at XXX.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the start event position from 'master-bin.000001' at XXX, the last event was read from 'master-bin.000002' at XXX, the last byte read was read from 'master-bin.000002' at XXX.'' CREATE TABLE t2(c1 INT); FLUSH LOGS; CREATE TABLE t3(c1 INT); diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result index 864e246312d..b2da820755e 100644 --- a/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-test/suite/rpl/r/rpl_packet.result @@ -37,7 +37,7 @@ DROP TABLE t1; CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM; INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet)); include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the start event position from '' at XXX, the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' STOP SLAVE; RESET SLAVE; RESET MASTER; diff --git a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result index 57206873e2f..8bf903b0713 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result @@ -69,6 +69,16 @@ include/wait_for_slave_to_stop.inc include/start_slave.inc # Clean up DROP TABLE t1; +RESET MASTER; +include/stop_slave.inc +CHANGE MASTER TO master_log_pos=MASTER_POS; +START SLAVE; +include/wait_for_slave_param.inc [Last_IO_Errno] +Last_IO_Errno = '1236' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the start event position from 'master-bin.000001' at XXX, the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' +include/stop_slave.inc +RESET SLAVE; +RESET MASTER; SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; diff --git a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test index 5e88b163d99..490ddf5d167 100644 --- a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test +++ b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test @@ -51,6 +51,7 @@ start slave; --let $slave_param_value=1236 --source include/wait_for_slave_param.inc +--let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ --let $status_items= Last_IO_Errno, Last_IO_Error --source include/show_slave_status.inc diff --git a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test index ada080e9071..dfe2e49bb90 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test @@ -22,5 +22,5 @@ SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); --connection master SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; - +--let $rpl_only_running_threads= 1 --source include/rpl_end.inc -- cgit v1.2.1 From 37fce0ece437daf6035e6f6ecd6ec6342b0d224a Mon Sep 17 00:00:00 2001 From: Nuno Carvalho Date: Thu, 19 Jan 2012 16:56:43 +0000 Subject: BUG#13050593 - BACKSLASH SWALLOWED BY INCLUDE/SHOW_SLAVE_STATUS.INC If an error message contains '\' backslash it is displayed correctly through show-slave-status or query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);. But when SELECT REPLACE(...) is applied backslash is escaped resulting in a different test output. Disabled backslash escape on show_slave_status.inc and replaced '\' for '/' using replace_regex function in order to achieve the same test output when different path separators are used. --- .../extra/rpl_tests/rpl_start_stop_slave.test | 2 +- mysql-test/include/show_slave_status.inc | 28 ++++++++++++++++++++-- mysql-test/include/wait_for_slave_io_error.inc | 1 + .../rpl/r/rpl_cant_read_event_incident.result | 2 +- mysql-test/suite/rpl/r/rpl_log_pos.result | 2 +- .../rpl/r/rpl_manual_change_index_file.result | 2 +- mysql-test/suite/rpl/r/rpl_packet.result | 2 +- .../suite/rpl/r/rpl_stm_start_stop_slave.result | 2 +- .../suite/rpl/t/rpl_cant_read_event_incident.test | 7 +----- mysql-test/suite/rpl/t/rpl_log_pos.test | 4 ++-- .../suite/rpl/t/rpl_manual_change_index_file.test | 4 ++-- mysql-test/suite/rpl/t/rpl_packet.test | 4 ++-- 12 files changed, 40 insertions(+), 20 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test index 301f4d84c58..5aa1d75c516 100644 --- a/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test +++ b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test @@ -199,7 +199,7 @@ START SLAVE; --let $slave_param_value=1236 --source include/wait_for_slave_param.inc ---let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ +--let $slave_field_result_replace= / at [0-9]*/ at XXX/ --let $status_items= Last_IO_Errno, Last_IO_Error --source include/show_slave_status.inc diff --git a/mysql-test/include/show_slave_status.inc b/mysql-test/include/show_slave_status.inc index e2fdc72b18b..52ec550ce60 100644 --- a/mysql-test/include/show_slave_status.inc +++ b/mysql-test/include/show_slave_status.inc @@ -56,10 +56,17 @@ # # --let $status_items= Master_Log_File, Relay_Master_Log_File # -# $slave_io_error_replace +# $slave_field_result_replace # If set, one or more regex patterns for replacing variable # text in the error message. Syntax as --replace-regex # +# $slave_sql_mode +# If set, change the slave sql mode during this macro, reverting +# to the previous on exit. Default sql_mode is NO_BACKSLASH_ESCAPES +# to allow replace '\' by '/' making paths OS independent. Example: +# +# --let $slave_sql_mode= NO_BACKSLASH_ESCAPES +# --let $_show_slave_status_items=$status_items @@ -69,13 +76,30 @@ if (!$status_items) } +--let $_slave_sql_mode= NO_BACKSLASH_ESCAPES +if ($slave_sql_mode) +{ + --let $_slave_sql_mode= $slave_sql_mode +} +--let $_previous_slave_sql_mode = `SELECT @@sql_mode` +--disable_query_log +eval SET sql_mode= '$_slave_sql_mode'; +--enable_query_log + + while ($_show_slave_status_items) { --let $_show_slave_status_name= `SELECT SUBSTRING_INDEX('$_show_slave_status_items', ',', 1)` --let $_show_slave_status_items= `SELECT LTRIM(SUBSTRING('$_show_slave_status_items', LENGTH('$_show_slave_status_name') + 2))` --let $_show_slave_status_value= query_get_value(SHOW SLAVE STATUS, $_show_slave_status_name, 1) - --replace_regex $slave_io_error_replace + --let $_slave_field_result_replace= /[\\]/\// $slave_field_result_replace + --replace_regex $_slave_field_result_replace --let $_show_slave_status_value= `SELECT REPLACE("$_show_slave_status_value", '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')` --echo $_show_slave_status_name = '$_show_slave_status_value' } + + +--disable_query_log +eval SET sql_mode= '$_previous_slave_sql_mode'; +--enable_query_log diff --git a/mysql-test/include/wait_for_slave_io_error.inc b/mysql-test/include/wait_for_slave_io_error.inc index bc78c9e2da1..4177bf4b858 100644 --- a/mysql-test/include/wait_for_slave_io_error.inc +++ b/mysql-test/include/wait_for_slave_io_error.inc @@ -76,6 +76,7 @@ if ($show_slave_io_error) { --let $_wait_for_slave_io_error_old_status_items= $status_items --let $status_items= Last_IO_Error + --let $slave_field_result_replace= $slave_io_error_replace --source include/show_slave_status.inc --let $status_items= $_wait_for_slave_io_error_old_status_items } diff --git a/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result index a719f865090..a406a6afe92 100644 --- a/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result +++ b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result @@ -11,7 +11,7 @@ reset slave; start slave; include/wait_for_slave_param.inc [Last_IO_Errno] Last_IO_Errno = '1236' -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the start event position from '' at XXX, the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the start event position from '' at XXX, the last event was read from './master-bin.000001' at XXX, the last byte read was read from './master-bin.000001' at XXX.'' reset master; stop slave; reset slave; diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index afd91a29f9e..49691bea9b6 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -9,7 +9,7 @@ change master to master_log_pos=MASTER_LOG_POS; Read_Master_Log_Pos = '75' start slave; include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the start event position from 'master-bin.000001' at XXX, the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the start event position from 'master-bin.000001' at XXX, the last event was read from './master-bin.000001' at XXX, the last byte read was read from './master-bin.000001' at XXX.'' include/stop_slave_sql.inc show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result index efe9bf076f0..2143b3492d5 100644 --- a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result +++ b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result @@ -5,7 +5,7 @@ CREATE TABLE t1(c1 INT); FLUSH LOGS; call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log'); include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the start event position from 'master-bin.000001' at XXX, the last event was read from 'master-bin.000002' at XXX, the last byte read was read from 'master-bin.000002' at XXX.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the start event position from 'master-bin.000001' at XXX, the last event was read from './master-bin.000002' at XXX, the last byte read was read from './master-bin.000002' at XXX.'' CREATE TABLE t2(c1 INT); FLUSH LOGS; CREATE TABLE t3(c1 INT); diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result index b2da820755e..7591006abcb 100644 --- a/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-test/suite/rpl/r/rpl_packet.result @@ -37,7 +37,7 @@ DROP TABLE t1; CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM; INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet)); include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the start event position from '' at XXX, the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the start event position from '' at XXX, the last event was read from './master-bin.000001' at XXX, the last byte read was read from './master-bin.000001' at XXX.'' STOP SLAVE; RESET SLAVE; RESET MASTER; diff --git a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result index 8bf903b0713..a7f3744b582 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result @@ -75,7 +75,7 @@ CHANGE MASTER TO master_log_pos=MASTER_POS; START SLAVE; include/wait_for_slave_param.inc [Last_IO_Errno] Last_IO_Errno = '1236' -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the start event position from 'master-bin.000001' at XXX, the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the start event position from 'master-bin.000001' at XXX, the last event was read from './master-bin.000001' at XXX, the last byte read was read from './master-bin.000001' at XXX.'' include/stop_slave.inc RESET SLAVE; RESET MASTER; diff --git a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test index 490ddf5d167..27478a318b8 100644 --- a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test +++ b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test @@ -14,11 +14,6 @@ --source include/master-slave.inc --source include/have_binlog_format_mixed.inc -# -# Bug#13050593 swallows `\' from Last_IO_Error -# todo: uncomment the filter once the bug is fixed. -# ---source include/not_windows.inc call mtr.add_suppression("Error in Log_event::read_log_event()"); @@ -51,7 +46,7 @@ start slave; --let $slave_param_value=1236 --source include/wait_for_slave_param.inc ---let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ +--let $slave_field_result_replace= / at [0-9]*/ at XXX/ --let $status_items= Last_IO_Errno, Last_IO_Error --source include/show_slave_status.inc diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test index a6521113b37..1043a80b5d5 100644 --- a/mysql-test/suite/rpl/t/rpl_log_pos.test +++ b/mysql-test/suite/rpl/t/rpl_log_pos.test @@ -23,8 +23,8 @@ source include/show_slave_status.inc; start slave; let $slave_io_errno= 1236; --let $show_slave_io_error= 1 -# Mask line numbers, and whether master-bin is preceded by "./" or "." ---let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ +# Mask line numbers +--let $slave_io_error_replace= / at [0-9]*/ at XXX/ source include/wait_for_slave_io_error.inc; source include/stop_slave_sql.inc; diff --git a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test index 8914b215632..981cecb66ad 100644 --- a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test +++ b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test @@ -61,8 +61,8 @@ connection slave; # 1236 = ER_MASTER_FATAL_ERROR_READING_BINLOG --let $slave_io_errno= 1236 --let $show_slave_io_error= 1 -# Mask line numbers, and whether master-bin is preceded by "./" or "." ---let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ +# Mask line numbers +--let $slave_io_error_replace= / at [0-9]*/ at XXX/ --source include/wait_for_slave_io_error.inc connection master; diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test index 06a03131a57..4f296fed68e 100644 --- a/mysql-test/suite/rpl/t/rpl_packet.test +++ b/mysql-test/suite/rpl/t/rpl_packet.test @@ -126,8 +126,8 @@ connection slave; # 1236=ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master. --let $slave_io_errno= 1236 -# Mask line numbers, and whether master-bin is preceded by "./" or "." ---let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ +# Mask line numbers +--let $slave_io_error_replace= / at [0-9]*/ at XXX/ --source include/wait_for_slave_io_error.inc # Remove the bad binlog and clear error status on slave. -- cgit v1.2.1 From 752496999e661074613459c2f12bc73e21540386 Mon Sep 17 00:00:00 2001 From: Dmitry Shulga Date: Fri, 20 Jan 2012 16:03:39 +0600 Subject: Patch for bug#13070308 - VALGRIND failure in XA test. The issue is that xa.test failed sporadically on some platforms. The reason for the test failure is a race condition in xa.test. The race condition occures between connection that executes statement INSERT INTO t2 SELECT FROM t1 and other connection that tries to run statements DELETE FROM t1 and COMMIT. If COMMIT statement had been executed before the statement INSERT INTO t2 SELECT FROM t1 was locked by lock on table t1 (as a result of query from table t1) then the INSERT statement is executed successfully and a following test for deadlock would failed. This patch fixes this race condition by moving COMMIT statement after commit of distributed transaction from concurrent session. --- mysql-test/r/xa.result | 8 +++++--- mysql-test/t/xa.test | 13 ++++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/xa.result b/mysql-test/r/xa.result index 7b580abb19f..6db257eafd5 100644 --- a/mysql-test/r/xa.result +++ b/mysql-test/r/xa.result @@ -206,8 +206,8 @@ DROP TABLE t1; # FAILED # DROP TABLE IF EXISTS t1, t2; -CREATE TABLE t1 (a INT); -CREATE TABLE t2 (a INT); +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +CREATE TABLE t2 (a INT) ENGINE=InnoDB; START TRANSACTION; INSERT INTO t1 VALUES (1); # Connection con2 @@ -217,12 +217,14 @@ INSERT INTO t2 SELECT a FROM t1; # Connection default # Waiting until INSERT ... is blocked DELETE FROM t1; -COMMIT; # Connection con2 # Reaping: INSERT INTO t2 SELECT a FROM t1 ERROR 40001: Deadlock found when trying to get lock; try restarting transaction XA COMMIT 'xid1'; ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected +# Connection default +COMMIT; +# Connection con2 XA START 'xid1'; XA END 'xid1'; XA PREPARE 'xid1'; diff --git a/mysql-test/t/xa.test b/mysql-test/t/xa.test index 8ce9ce52960..cb4345e9479 100644 --- a/mysql-test/t/xa.test +++ b/mysql-test/t/xa.test @@ -338,8 +338,8 @@ DROP TABLE t1; DROP TABLE IF EXISTS t1, t2; --enable_warnings -CREATE TABLE t1 (a INT); -CREATE TABLE t2 (a INT); +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +CREATE TABLE t2 (a INT) ENGINE=InnoDB; START TRANSACTION; INSERT INTO t1 VALUES (1); @@ -359,7 +359,6 @@ let $wait_condition= --echo # Waiting until INSERT ... is blocked --source include/wait_condition.inc DELETE FROM t1; -COMMIT; --echo # Connection con2 --connection con2 @@ -368,6 +367,14 @@ COMMIT; --reap --error ER_XA_RBDEADLOCK XA COMMIT 'xid1'; + +--echo # Connection default +connection default; + +COMMIT; + +--echo # Connection con2 +connection con2; # This caused the assert to be triggered XA START 'xid1'; -- cgit v1.2.1 From f73bc0243ac13ce799d075b240dce63d0f5932c3 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 20 Jan 2012 13:35:48 +0200 Subject: Addendum to the fix for bug #11754014 - Fixed the checks to properly check for plugin_dir containing a trailing slash or backslash. - Fixed a under-configuration in udf_skip_grants that was preventing the test from running even when there was a udf plugin. --- mysql-test/include/have_example_plugin.inc | 2 +- mysql-test/include/have_semisync_plugin.inc | 2 +- mysql-test/include/have_simple_parser.inc | 2 +- mysql-test/include/have_udf.inc | 2 +- mysql-test/t/udf_skip_grants-master.opt | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/have_example_plugin.inc b/mysql-test/include/have_example_plugin.inc index 8920399555d..88f4e212102 100644 --- a/mysql-test/include/have_example_plugin.inc +++ b/mysql-test/include/have_example_plugin.inc @@ -15,7 +15,7 @@ if (!$EXAMPLE_PLUGIN) { # # Check if --plugin-dir was setup for exampledb # -if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$EXAMPLE_PLUGIN_OPT'`) { +if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$EXAMPLE_PLUGIN_OPT/'`) { --skip Example plugin requires that --plugin-dir is set to the example plugin dir (either the .opt file does not contain \$EXAMPLE_PLUGIN_OPT or another plugin is in use) } enable_query_log; diff --git a/mysql-test/include/have_semisync_plugin.inc b/mysql-test/include/have_semisync_plugin.inc index 95899f559aa..1cd3b30be1c 100644 --- a/mysql-test/include/have_semisync_plugin.inc +++ b/mysql-test/include/have_semisync_plugin.inc @@ -16,6 +16,6 @@ if (!$SEMISYNC_MASTER_PLUGIN) # # Check if --plugin-dir was setup for semisync # -if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$SEMISYNC_PLUGIN_OPT'`) { +if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$SEMISYNC_PLUGIN_OPT/'`) { --skip SEMISYNC plugin requires that --plugin-dir is set to the semisync plugin dir (either the .opt file does not contain \$SEMISYNC_PLUGIN_OPT or another plugin is in use) } diff --git a/mysql-test/include/have_simple_parser.inc b/mysql-test/include/have_simple_parser.inc index d077916c5e7..0cedad27a77 100644 --- a/mysql-test/include/have_simple_parser.inc +++ b/mysql-test/include/have_simple_parser.inc @@ -15,6 +15,6 @@ if (!$SIMPLE_PARSER) { # # Check if --plugin-dir was setup for simple parser # -if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$SIMPLE_PARSER_OPT'`) { +if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$SIMPLE_PARSER_OPT/'`) { --skip simple parser requires that --plugin-dir is set to the udf plugin dir (either the .opt file does not contain \$UDF_EXAMPLE_LIB_OPT or another plugin is in use) } diff --git a/mysql-test/include/have_udf.inc b/mysql-test/include/have_udf.inc index 5c404b03729..993b9e13fdb 100644 --- a/mysql-test/include/have_udf.inc +++ b/mysql-test/include/have_udf.inc @@ -15,6 +15,6 @@ if (!$UDF_EXAMPLE_LIB) { # # Check if --plugin-dir was setup for udf # -if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$UDF_EXAMPLE_LIB_OPT'`) { +if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$UDF_EXAMPLE_LIB_OPT/'`) { --skip UDF requires that --plugin-dir is set to the udf plugin dir (either the .opt file does not contain \$UDF_EXAMPLE_LIB_OPT or another plugin is in use) } diff --git a/mysql-test/t/udf_skip_grants-master.opt b/mysql-test/t/udf_skip_grants-master.opt index 5699a3387b8..015d0014da0 100644 --- a/mysql-test/t/udf_skip_grants-master.opt +++ b/mysql-test/t/udf_skip_grants-master.opt @@ -1 +1,2 @@ --skip-grant-tables +$UDF_EXAMPLE_LIB_OPT -- cgit v1.2.1 From cfbe0fe0cdcaf421fae0fee8d690952f94b73db5 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Fri, 20 Jan 2012 14:19:39 +0100 Subject: Bug#13500478 63623: TEST CASE PARTITION_BINLOG_STMT CREATES A FILE IN AN IMPROPER LOCATION. Fixed by using $MYSQLTEST_VARDIR, as proposed by Davi Arnaut. Thank you Davi! --- mysql-test/r/partition_binlog_stmt.result | 2 +- mysql-test/t/partition_binlog_stmt.test | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/partition_binlog_stmt.result b/mysql-test/r/partition_binlog_stmt.result index 9be23636ca6..5b9df742f70 100644 --- a/mysql-test/r/partition_binlog_stmt.result +++ b/mysql-test/r/partition_binlog_stmt.result @@ -8,6 +8,6 @@ name TINYBLOB NOT NULL, modified TIMESTAMP DEFAULT '0000-00-00 00:00:00', INDEX namelocs (name(255))) ENGINE = MyISAM PARTITION BY HASH(id) PARTITIONS 2; -LOAD DATA LOCAL INFILE 'init_file.txt' +LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/init_file.txt' INTO TABLE t1 (name); DROP TABLE t1; diff --git a/mysql-test/t/partition_binlog_stmt.test b/mysql-test/t/partition_binlog_stmt.test index c426de9f303..cc57222dc3c 100644 --- a/mysql-test/t/partition_binlog_stmt.test +++ b/mysql-test/t/partition_binlog_stmt.test @@ -8,7 +8,7 @@ DROP TABLE IF EXISTS t1; --echo # --echo # Bug#51851: Server with SBR locks mutex twice on LOAD DATA into --echo # partitioned MyISAM table ---write_file init_file.txt +--write_file $MYSQLTEST_VARDIR/tmp/init_file.txt abcd EOF @@ -19,8 +19,9 @@ CREATE TABLE t1 INDEX namelocs (name(255))) ENGINE = MyISAM PARTITION BY HASH(id) PARTITIONS 2; -LOAD DATA LOCAL INFILE 'init_file.txt' +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/init_file.txt' INTO TABLE t1 (name); ---remove_file init_file.txt +--remove_file $MYSQLTEST_VARDIR/tmp/init_file.txt DROP TABLE t1; -- cgit v1.2.1 From e449cf48afc34705b601113fd73bce84338c2e37 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 23 Jan 2012 13:07:10 +0400 Subject: Bug#11752408 - 43593: DUMP/BACKUP/RESTORE/UPGRADE TOOLS FAILS BECAUSE OF UTF8_GENERAL_CI Introducing new collations: utf8_general_mysql500_ci and ucs2_general_mysql500_ci, to reproduce behaviour of utf8_general_ci and ucs2_general_ci from mysql-5.1.23 (and earlier). The collations are added to simplify upgrade from mysql-5.1.23 and earlier. Note: The patch does not make new server start over old data automatically. Some manual upgrade procedures are assumed. Paul: please get in touch with me to discuss upgrade procedures when documenting this bug. modified: include/m_ctype.h mysql-test/r/ctype_utf8.result mysql-test/t/ctype_utf8.test mysys/charset-def.c strings/ctype-ucs2.c strings/ctype-utf8.c --- mysql-test/r/ctype_utf8.result | 24 ++++++++++++++++++++++++ mysql-test/t/ctype_utf8.test | 8 ++++++++ 2 files changed, 32 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index b491ce504bf..c540c750f9d 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1928,4 +1928,28 @@ D120 SELECT HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20)); HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20)) D120D18E +# +# Bug#11752408 - 43593: DUMP/BACKUP/RESTORE/UPGRADE TOOLS FAILS BECAUSE OF UTF8_GENERAL_CI +# +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci); +INSERT INTO t1 VALUES ('a'),('r'),('s'),(_latin1 0xDF),(_latin1 0xF7),('t'),('z'); +SELECT * FROM t1 ORDER BY a; +a +a +r +s +t +z +ß +÷ +SELECT a, COUNT(*) FROM t1 GROUP BY a; +a COUNT(*) +a 1 +r 1 +s 1 +t 1 +z 1 +ß 1 +÷ 1 +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 8e9f09d1e56..545afbbcf6c 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -1484,5 +1484,13 @@ SELECT HEX(LPAD(_utf8 0xD18F, 3, 0x20)); SELECT HEX(INSERT(_utf8 0xD18F, 2, 1, 0x20)); SELECT HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20)); +--echo # +--echo # Bug#11752408 - 43593: DUMP/BACKUP/RESTORE/UPGRADE TOOLS FAILS BECAUSE OF UTF8_GENERAL_CI +--echo # +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci); +INSERT INTO t1 VALUES ('a'),('r'),('s'),(_latin1 0xDF),(_latin1 0xF7),('t'),('z'); +SELECT * FROM t1 ORDER BY a; +SELECT a, COUNT(*) FROM t1 GROUP BY a; +DROP TABLE t1; --echo End of 5.1 tests -- cgit v1.2.1 From e69da6dc3e0026ab03786a290c45305866d7fab0 Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Mon, 23 Jan 2012 17:39:37 +0530 Subject: BUG#11752315 - 43460: STOP SLAVE UNABLE TO COMPLETE WHEN SLAVE THREAD IS TRYING TO RECONNECT TO Problem : The basic problem is the way the thread sleeps in mysql-5.5 and also in mysql-5.1 when we execute a stop slave on windows platform. On windows platform if the stop slave is executed after the master dies, we have this long wait before the stop slave return a value. This is because there is a sleep of the thread. The sleep is uninterruptable in the two above version, which was fixed by Davi patch for the BUG#11765860 for mysql-trunk. Backporting his patch for mysql-5.5 fixes the problem. Solution : A new pair of mutex and condition variable is introduced to synchronize thread sleep and finalization. A new mutex is required because the slave threads are terminated while holding the slave thread locks (run_lock), which can not be relinquished during termination as this would affect the lock order. mysql-test/suite/rpl/r/rpl_start_stop_slave.result: The result file associated with the test added. mysql-test/suite/rpl/t/rpl_start_stop_slave.test: A test to check the new functionality. sql/rpl_mi.cc: The constructor using the new mutex and condition variables for the master_info. sql/rpl_mi.h: The condition variable and mutex have been added for the master_info. sql/rpl_rli.cc: The constructor using the new mutex and condition variables for the realy_log_info. sql/rpl_rli.h: The condition variable and mutex have been added for the relay_log_info. sql/slave.cc: Use a timed wait on a condition variable to implement a interruptible sleep. The wait is registered with the THD object so that the thread will be woken up if killed. --- mysql-test/suite/rpl/r/rpl_start_stop_slave.result | 10 +++++ mysql-test/suite/rpl/t/rpl_start_stop_slave.test | 44 ++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 mysql-test/suite/rpl/r/rpl_start_stop_slave.result create mode 100644 mysql-test/suite/rpl/t/rpl_start_stop_slave.test (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/r/rpl_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result new file mode 100644 index 00000000000..43a7712bdf1 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result @@ -0,0 +1,10 @@ +include/master-slave.inc +[connection master] +set @time_before_kill := (select CURRENT_TIMESTAMP); +[Time before the query] +[Connection ID of the slave I/O thread found] +kill ; +set @time_after_kill := (select CURRENT_TIMESTAMP); +[Time after the query] +[Killing of the slave IO thread was successful] +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test new file mode 100644 index 00000000000..69d39a066b1 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test @@ -0,0 +1,44 @@ +# +#BUG#11752315 : STOP SLAVE UNABLE TO COMPLETE WHEN SLAVE THREAD IS TRYING +# TO RECONNECT TO +# +# ==== Purpose ==== +# +#Tests that the slave does not go to a sleep for a long duration after the +#master is killed and we do a START_SLAVE and STOP_SLAVE. +# +# ==== Method ==== +# +#This is a new functionality of having an interruptable sleep of the slave. +#We find the thread id for the slave thread. On finding the thread ID of the +#slave thread we kill the slave thread. A successful kill in less than 60 sec +#should serve the purpose of checking the functionality. +# + +--source include/have_log_bin.inc +--source include/master-slave.inc + +connection slave; +--let $connection_id=`SELECT id FROM information_schema.processlist where state LIKE 'Waiting for master to send event'` + +set @time_before_kill := (select CURRENT_TIMESTAMP); + +--echo [Time before the query] +--echo [Connection ID of the slave I/O thread found] + +--replace_regex /kill [0-9]*/kill / +--eval kill $connection_id + +set @time_after_kill := (select CURRENT_TIMESTAMP); + +--echo [Time after the query] + +if(`select TIMESTAMPDIFF(SECOND,@time_after_kill, @time_before_kill) > 60`) +{ +--echo # assert : The difference between the timestamps 'time_after_kill' and 'time_before_kill' should be less than 60sec. +--die +} + +--echo [Killing of the slave IO thread was successful] +# End of test +--source include/rpl_end.inc -- cgit v1.2.1 From 825c74f6aa5bdeb1d041846df3f592714dd741bb Mon Sep 17 00:00:00 2001 From: Nuno Carvalho Date: Mon, 23 Jan 2012 16:50:54 +0000 Subject: BUG#12364404 - UNDETERMINISTIC WAIT LOOP IN WAIT_FOR_NDB_TO_BINLOG.INC The wait_for_ndb_to_binlog.inc include file used by the blow rpl_tests common for rpl and rpl_ndb suite is simply doing a "sleep 5", this is not deterministic and wastes lot of test time uneccessarily. The test should be rewritten to check if the condition it wait for has been reached or not. For NDB engine all events will be added by NDB injector so tests only can continue after injector is ready, this test waits for proper injector thread state. --- mysql-test/include/wait_for_ndb_to_binlog.inc | 39 +++++++++------------------ 1 file changed, 12 insertions(+), 27 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/include/wait_for_ndb_to_binlog.inc b/mysql-test/include/wait_for_ndb_to_binlog.inc index 77da6d62154..c1f94802724 100644 --- a/mysql-test/include/wait_for_ndb_to_binlog.inc +++ b/mysql-test/include/wait_for_ndb_to_binlog.inc @@ -1,13 +1,11 @@ # ==== Purpose ==== # -# Several test primitives from mysql-test/extra/rpl_tests -# shared for test cases for MyISAM, InnoDB, NDB and other -# engines. But for NDB all events will be added by NDB -# injector and now there are no way to detect the state of -# NDB injector therefore this primitive waits 5 sec -# if engine type is NDB. -# In future that should be fixed by waiting of proper -# state of NDB injector. +# Several test primitives from mysql-test/extra/rpl_tests +# are shared for test cases for MyISAM, InnoDB, NDB and +# other engines. +# For NDB engine all events will be added by NDB injector +# so tests only can continue after injector is ready, +# this test waits for proper injector thread state. # # ==== Usage ==== # @@ -17,25 +15,12 @@ # ==== Parameters ===== # # $engine_type -# Type of engine. If type is NDB then it waits $wait_time sec -# -# $wait_time -# Test will wait $wait_time seconds - -let $_wait_time= 5; - -if (!$wait_time) { - let $_wait_time= $wait_time; -} +# Type of engine. If type is NDB then it waits for injector +# thread proper state. if (`SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`) { - while (!$_wait_time) { - let $_wait_time_internal= 10; - while (!$_wait_time_internal) { - sleep 0.1; - dec $_wait_time_internal; - } - dec $_wait_time; - } + let $show_statement= SHOW PROCESSLIST; + let $field= State; + let $condition= = 'Waiting for event from ndbcluster'; + source include/wait_show_condition.inc; } - -- cgit v1.2.1 From f8e924b467d099b5d99248c160a2aba59a6ea3ce Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 24 Jan 2012 13:00:13 +0400 Subject: BUG#13458237 - INCONSISTENT HANDLING OF INVALIDE DATES WITH ZERO DAY. SIMILAR TO '2009-10-00' - Reverting the patch for Bug # 12584302 The patch will be reverted in 5.1 and 5.5. The patch will not be reverted in 5.6, the change will be properly documented in 5.6. - Backporting DBUG_ASSERT not to crash on '0000-01-00' (already fixed in mysql-trunk (5.6)) --- mysql-test/r/func_time.result | 184 +++++++++++++++++++++++++++++++++++++++++- mysql-test/t/func_time.test | 61 ++++++++++++++ 2 files changed, 244 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 68c1e667440..ceb9dd4f7ea 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1430,6 +1430,188 @@ NULL # Bug#12584302 AFTER FIX FOR #12403504: ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0, # DO WEEK((DATE_ADD((CAST(0 AS DATE)), INTERVAL 1 YEAR_MONTH)), 5); +# +# BUG#13458237 INCONSISTENT HANDLING OF INVALIDE DATES WITH ZERO DAY +# SIMILAR TO '2009-10-00' +# +SELECT +DATE('20091000'), +STR_TO_DATE('200910','%Y%m'), +LAST_DAY('2009-10-00'), +LAST_DAY(DATE('2009-10-00')), +LAST_DAY(DATE'2009-10-00'), +LAST_DAY(STR_TO_DATE('200910','%Y%m')), +WEEK('2009-10-00'), +WEEK(DATE('2009-10-00')), +WEEK(DATE'2009-10-00'), +WEEK(STR_TO_DATE('200910','%Y%m')), +WEEKOFYEAR('2009-10-00'), +WEEKOFYEAR(DATE('2009-10-00')), +WEEKOFYEAR(DATE'2009-10-00'), +WEEKOFYEAR(STR_TO_DATE('200910','%Y%m')), +DAYOFYEAR('2009-10-00'), +DAYOFYEAR(DATE('2009-10-00')), +DAYOFYEAR(DATE'2009-10-00'), +DAYOFYEAR(STR_TO_DATE('200910','%Y%m')), +WEEKDAY('2009-10-00'), +WEEKDAY(DATE('2009-10-00')), +WEEKDAY(DATE'2009-10-00'), +WEEKDAY(STR_TO_DATE('200910','%Y%m')), +TO_DAYs('2009-10-00'), +TO_DAYs(DATE('2009-10-00')), +TO_DAYs(DATE'2009-10-00'), +TO_DAYs(STR_TO_DATE('200910','%Y%m')); +DATE('20091000') 2009-10-00 +STR_TO_DATE('200910','%Y%m') 2009-10-00 +LAST_DAY('2009-10-00') NULL +LAST_DAY(DATE('2009-10-00')) 2009-10-31 +LAST_DAY(DATE'2009-10-00') NULL +LAST_DAY(STR_TO_DATE('200910','%Y%m')) 2009-10-31 +WEEK('2009-10-00') NULL +WEEK(DATE('2009-10-00')) 39 +WEEK(DATE'2009-10-00') NULL +WEEK(STR_TO_DATE('200910','%Y%m')) NULL +WEEKOFYEAR('2009-10-00') NULL +WEEKOFYEAR(DATE('2009-10-00')) 40 +WEEKOFYEAR(DATE'2009-10-00') NULL +WEEKOFYEAR(STR_TO_DATE('200910','%Y%m')) NULL +DAYOFYEAR('2009-10-00') NULL +DAYOFYEAR(DATE('2009-10-00')) 273 +DAYOFYEAR(DATE'2009-10-00') NULL +DAYOFYEAR(STR_TO_DATE('200910','%Y%m')) NULL +WEEKDAY('2009-10-00') NULL +WEEKDAY(DATE('2009-10-00')) 2 +WEEKDAY(DATE'2009-10-00') NULL +WEEKDAY(STR_TO_DATE('200910','%Y%m')) NULL +TO_DAYs('2009-10-00') NULL +TO_DAYs(DATE('2009-10-00')) 734045 +TO_DAYs(DATE'2009-10-00') NULL +TO_DAYs(STR_TO_DATE('200910','%Y%m')) NULL +Warnings: +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +SELECT +DATE('00000100'), +STR_TO_DATE('000001','%Y%m'), +LAST_DAY('0000-01-00'), +LAST_DAY(DATE('0000-01-00')), +LAST_DAY(DATE'0000-01-00'), +LAST_DAY(STR_TO_DATE('000001','%Y%m')), +WEEK('0000-01-00'), +WEEK(DATE('0000-01-00')), +WEEK(DATE'0000-01-00'), +WEEK(STR_TO_DATE('000001','%Y%m')), +WEEKOFYEAR('0000-01-00'), +WEEKOFYEAR(DATE('0000-01-00')), +WEEKOFYEAR(DATE'0000-01-00'), +WEEKOFYEAR(STR_TO_DATE('000001','%Y%m')), +DAYOFYEAR('0000-01-00'), +DAYOFYEAR(DATE('0000-01-00')), +DAYOFYEAR(DATE'0000-01-00'), +DAYOFYEAR(STR_TO_DATE('000001','%Y%m')), +WEEKDAY('0000-01-00'), +WEEKDAY(DATE('0000-01-00')), +WEEKDAY(DATE'0000-01-00'), +WEEKDAY(STR_TO_DATE('000001','%Y%m')), +TO_DAYs('0000-01-00'), +TO_DAYs(DATE('0000-01-00')), +TO_DAYs(DATE'0000-01-00'), +TO_DAYs(STR_TO_DATE('000001','%Y%m')); +DATE('00000100') 0000-01-00 +STR_TO_DATE('000001','%Y%m') 0000-01-00 +LAST_DAY('0000-01-00') NULL +LAST_DAY(DATE('0000-01-00')) 0000-01-31 +LAST_DAY(DATE'0000-01-00') NULL +LAST_DAY(STR_TO_DATE('000001','%Y%m')) 0000-01-31 +WEEK('0000-01-00') NULL +WEEK(DATE('0000-01-00')) 52 +WEEK(DATE'0000-01-00') NULL +WEEK(STR_TO_DATE('000001','%Y%m')) NULL +WEEKOFYEAR('0000-01-00') NULL +WEEKOFYEAR(DATE('0000-01-00')) 52 +WEEKOFYEAR(DATE'0000-01-00') NULL +WEEKOFYEAR(STR_TO_DATE('000001','%Y%m')) NULL +DAYOFYEAR('0000-01-00') NULL +DAYOFYEAR(DATE('0000-01-00')) 0 +DAYOFYEAR(DATE'0000-01-00') NULL +DAYOFYEAR(STR_TO_DATE('000001','%Y%m')) NULL +WEEKDAY('0000-01-00') NULL +WEEKDAY(DATE('0000-01-00')) 5 +WEEKDAY(DATE'0000-01-00') NULL +WEEKDAY(STR_TO_DATE('000001','%Y%m')) NULL +TO_DAYs('0000-01-00') NULL +TO_DAYs(DATE('0000-01-00')) 0 +TO_DAYs(DATE'0000-01-00') NULL +TO_DAYs(STR_TO_DATE('000001','%Y%m')) NULL Warnings: -Warning 1292 Incorrect datetime value: '0' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' End of 5.1 tests diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 2dcac0d5796..3ea79a7fc94 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -934,4 +934,65 @@ SELECT WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1); DO WEEK((DATE_ADD((CAST(0 AS DATE)), INTERVAL 1 YEAR_MONTH)), 5); +--echo # +--echo # BUG#13458237 INCONSISTENT HANDLING OF INVALIDE DATES WITH ZERO DAY +--echo # SIMILAR TO '2009-10-00' +--echo # + +query_vertical SELECT + DATE('20091000'), + STR_TO_DATE('200910','%Y%m'), + LAST_DAY('2009-10-00'), + LAST_DAY(DATE('2009-10-00')), + LAST_DAY(DATE'2009-10-00'), + LAST_DAY(STR_TO_DATE('200910','%Y%m')), + WEEK('2009-10-00'), + WEEK(DATE('2009-10-00')), + WEEK(DATE'2009-10-00'), + WEEK(STR_TO_DATE('200910','%Y%m')), + WEEKOFYEAR('2009-10-00'), + WEEKOFYEAR(DATE('2009-10-00')), + WEEKOFYEAR(DATE'2009-10-00'), + WEEKOFYEAR(STR_TO_DATE('200910','%Y%m')), + DAYOFYEAR('2009-10-00'), + DAYOFYEAR(DATE('2009-10-00')), + DAYOFYEAR(DATE'2009-10-00'), + DAYOFYEAR(STR_TO_DATE('200910','%Y%m')), + WEEKDAY('2009-10-00'), + WEEKDAY(DATE('2009-10-00')), + WEEKDAY(DATE'2009-10-00'), + WEEKDAY(STR_TO_DATE('200910','%Y%m')), + TO_DAYs('2009-10-00'), + TO_DAYs(DATE('2009-10-00')), + TO_DAYs(DATE'2009-10-00'), + TO_DAYs(STR_TO_DATE('200910','%Y%m')); + +query_vertical SELECT + DATE('00000100'), + STR_TO_DATE('000001','%Y%m'), + LAST_DAY('0000-01-00'), + LAST_DAY(DATE('0000-01-00')), + LAST_DAY(DATE'0000-01-00'), + LAST_DAY(STR_TO_DATE('000001','%Y%m')), + WEEK('0000-01-00'), + WEEK(DATE('0000-01-00')), + WEEK(DATE'0000-01-00'), + WEEK(STR_TO_DATE('000001','%Y%m')), + WEEKOFYEAR('0000-01-00'), + WEEKOFYEAR(DATE('0000-01-00')), + WEEKOFYEAR(DATE'0000-01-00'), + WEEKOFYEAR(STR_TO_DATE('000001','%Y%m')), + DAYOFYEAR('0000-01-00'), + DAYOFYEAR(DATE('0000-01-00')), + DAYOFYEAR(DATE'0000-01-00'), + DAYOFYEAR(STR_TO_DATE('000001','%Y%m')), + WEEKDAY('0000-01-00'), + WEEKDAY(DATE('0000-01-00')), + WEEKDAY(DATE'0000-01-00'), + WEEKDAY(STR_TO_DATE('000001','%Y%m')), + TO_DAYs('0000-01-00'), + TO_DAYs(DATE('0000-01-00')), + TO_DAYs(DATE'0000-01-00'), + TO_DAYs(STR_TO_DATE('000001','%Y%m')); + --echo End of 5.1 tests -- cgit v1.2.1 From 97883d3c0498dfaa17f6f7cbefa373b7cd2c72a3 Mon Sep 17 00:00:00 2001 From: Dmitry Shulga Date: Wed, 25 Jan 2012 15:59:30 +0600 Subject: Fixed bug#11753187 (formerly known as bug 44585): SP_CACHE BEHAVES AS MEMORY LEAK. Background: - There are caches for stored functions and stored procedures (SP-cache); - There is no similar cache for events; - Triggers are cached together with TABLE objects; - Those SP-caches are per-session (i.e. specific to each session); - A stored routine is represented by a sp_head-instance internally; - SP-cache basically contains sp_head-objects of stored routines, which have been executed in a session; - sp_head-object is added into the SP-cache before the corresponding stored routine is executed; - SP-cache is flushed in the end of the session. The problem was that SP-cache might grow without any limit. Although this was not a pure memory leak (the SP-cache is flushed when session is closed), this is still a problem, because the user might take much memory by executing many stored routines. The patch fixes this problem in the least-intrusive way. A soft limit (similar to the size of table definition cache) is introduced. To represent such limit the new runtime configuration parameter 'stored_program_cache' is introduced. The value of this parameter is stored in the new global variable stored_program_cache_size that used to control the size of SP-cache to overflow. The parameter 'stored_program_cache' limits number of cached routines for each thread. It has the following min/default/max values given from support: min = 256, default = 256, max = 512 * 1024. Also it should be noted that this parameter limits the size of each cache (for stored procedures and for stored functions) separately. The SP-cache size is checked after top-level statement is parsed. If SP-cache size exceeds the limit specified by parameter 'stored_program_cache' then SP-cache is flushed and memory allocated for cache objects is freed. Such approach allows to flush cache safely when there are dependencies among stored routines. sql/mysqld.cc: Added global variable stored_program_cache_size to store value of configuration parameter 'stored-program-cache'. sql/mysqld.h: Added declaration of global variable stored_program_cache_size. sql/sp_cache.cc: Extended interface for sp_cache by adding helper routine sp_cache_enforce_limit to control size of stored routines cache for overflow. Also added method enforce_limit into class sp_cache that implements control of cache size for overflow. sql/sp_cache.h: Extended interface for sp_cache by adding standalone routine sp_cache_enforce_limit to control size of stored routines cache for overflow. sql/sql_parse.cc: Added flush of sp_cache after processing of next sql-statement received from a client. sql/sql_prepare.cc: Added flush of sp_cache after preparation/execution of next prepared sql-statement received from a client. sql/sys_vars.cc: Added support for configuration parameter stored-program-cache. --- mysql-test/r/mysqld--help-notwin.result | 4 ++ mysql-test/r/mysqld--help-win.result | 4 ++ .../sys_vars/r/stored_program_cache_basic.result | 59 ++++++++++++++++++++++ .../sys_vars/t/stored_program_cache_basic.test | 59 ++++++++++++++++++++++ 4 files changed, 126 insertions(+) create mode 100644 mysql-test/suite/sys_vars/r/stored_program_cache_basic.result create mode 100644 mysql-test/suite/sys_vars/t/stored_program_cache_basic.test (limited to 'mysql-test') diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index cb727984ec0..8dacb035f36 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -671,6 +671,9 @@ The following options may be given as the first argument: replication. --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual for the complete list of valid sql modes + --stored-program-cache=# + The soft upper limit for number of cached stored routines + for one connection. -s, --symbolic-links Enable symbolic link support. --sync-binlog=# Synchronously flush binary log to disk after every #th @@ -935,6 +938,7 @@ slow-query-log FALSE sort-buffer-size 2097152 sporadic-binlog-dump-fail FALSE sql-mode +stored-program-cache 256 symbolic-links FALSE sync-binlog 0 sync-frm TRUE diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 2ef52355f90..1e7e877e29f 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -679,6 +679,9 @@ The following options may be given as the first argument: --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual for the complete list of valid sql modes --standalone Dummy option to start as a standalone program (NT). + --stored-program-cache=# + The soft upper limit for number of cached stored routines + for one connection. -s, --symbolic-links Enable symbolic link support. --sync-binlog=# Synchronously flush binary log to disk after every #th @@ -946,6 +949,7 @@ slow-start-timeout 15000 sort-buffer-size 2097152 sporadic-binlog-dump-fail FALSE sql-mode +stored-program-cache 256 symbolic-links FALSE sync-binlog 0 sync-frm TRUE diff --git a/mysql-test/suite/sys_vars/r/stored_program_cache_basic.result b/mysql-test/suite/sys_vars/r/stored_program_cache_basic.result new file mode 100644 index 00000000000..f1638520f72 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/stored_program_cache_basic.result @@ -0,0 +1,59 @@ +# Saving initial value of stored_program_cache in a temporary variable +SET @start_value = @@global.stored_program_cache; +SELECT @start_value; +@start_value +256 +# Display the DEFAULT value of stored_program_cache +SET @@global.stored_program_cache = DEFAULT; +SELECT @@global.stored_program_cache; +@@global.stored_program_cache +256 +# Verify default value of variable +SELECT @@global.stored_program_cache = 256; +@@global.stored_program_cache = 256 +1 +# Change the value of stored_program_cache to a valid value +SET @@global.stored_program_cache = 512; +SELECT @@global.stored_program_cache; +@@global.stored_program_cache +512 +# Change the value of stored_program_cache to invalid value +SET @@global.stored_program_cache = -1; +Warnings: +Warning 1292 Truncated incorrect stored_program_cache value: '-1' +SELECT @@global.stored_program_cache; +@@global.stored_program_cache +256 +SET @@global.stored_program_cache =100000000000; +Warnings: +Warning 1292 Truncated incorrect stored_program_cache value: '100000000000' +SELECT @@global.stored_program_cache; +@@global.stored_program_cache +524288 +SET @@global.stored_program_cache = 0; +Warnings: +Warning 1292 Truncated incorrect stored_program_cache value: '0' +SELECT @@global.stored_program_cache; +@@global.stored_program_cache +256 +SET @@global.stored_program_cache = 10000.01; +ERROR 42000: Incorrect argument type to variable 'stored_program_cache' +SET @@global.stored_program_cache = ON; +ERROR 42000: Incorrect argument type to variable 'stored_program_cache' +SET @@global.stored_program_cache= 'test'; +ERROR 42000: Incorrect argument type to variable 'stored_program_cache' +SET @@global.stored_program_cache = ''; +ERROR 42000: Incorrect argument type to variable 'stored_program_cache' +# Test if accessing session stored_program_cache gives error +SET @@session.stored_program_cache = 0; +ERROR HY000: Variable 'stored_program_cache' is a GLOBAL variable and should be set with SET GLOBAL +# Check if accessing variable without SCOPE points to same global variable +SET @@global.stored_program_cache = 512; +SELECT @@stored_program_cache = @@global.stored_program_cache; +@@stored_program_cache = @@global.stored_program_cache +1 +# Restore initial value +SET @@global.stored_program_cache = @start_value; +SELECT @@global.stored_program_cache; +@@global.stored_program_cache +256 diff --git a/mysql-test/suite/sys_vars/t/stored_program_cache_basic.test b/mysql-test/suite/sys_vars/t/stored_program_cache_basic.test new file mode 100644 index 00000000000..9a9ba2ebf81 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/stored_program_cache_basic.test @@ -0,0 +1,59 @@ +# Variable Name: stored_program_cache +# Scope: GLOBAL +# Access Type: Dynamic +# Data Type: numeric +# Default Value: 256 +# Range: 256-524288 + +--source include/load_sysvars.inc + +--echo # Saving initial value of stored_program_cache in a temporary variable +SET @start_value = @@global.stored_program_cache; +SELECT @start_value; + +--echo # Display the DEFAULT value of stored_program_cache +SET @@global.stored_program_cache = DEFAULT; +SELECT @@global.stored_program_cache; + +--echo # Verify default value of variable +SELECT @@global.stored_program_cache = 256; + +--echo # Change the value of stored_program_cache to a valid value +SET @@global.stored_program_cache = 512; +SELECT @@global.stored_program_cache; + +--echo # Change the value of stored_program_cache to invalid value +SET @@global.stored_program_cache = -1; +SELECT @@global.stored_program_cache; + +SET @@global.stored_program_cache =100000000000; +SELECT @@global.stored_program_cache; + +SET @@global.stored_program_cache = 0; +SELECT @@global.stored_program_cache; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.stored_program_cache = 10000.01; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.stored_program_cache = ON; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.stored_program_cache= 'test'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.stored_program_cache = ''; + +--echo # Test if accessing session stored_program_cache gives error + +--Error ER_GLOBAL_VARIABLE +SET @@session.stored_program_cache = 0; + +--echo # Check if accessing variable without SCOPE points to same global variable + +SET @@global.stored_program_cache = 512; +SELECT @@stored_program_cache = @@global.stored_program_cache; + +--echo # Restore initial value + +SET @@global.stored_program_cache = @start_value; +SELECT @@global.stored_program_cache; -- cgit v1.2.1 From 042bd1511d855707f2beff65b9fb803d9dc4fb9e Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Wed, 25 Jan 2012 10:36:25 +0100 Subject: Bug#13463415 63502: INCORRECT RESULTS OF BIGINT AND DECIMAL COMPARISON Bug#11758543 50756: BIGINT '100' MATCHES 1.001E2 Expressions of the form BIGINT_COL should be done either as decimal, or float. Currently however, such comparisons are done as int, which means that the constant may be truncated, and yield false positives/negatives for all queries where compare is '>' '<' '>=' '<=' '=' '!='. BIGINT_COL IN and BIGINT_COL BETWEEN AND are also affected. mysql-test/r/bigint.result: New tests. mysql-test/r/func_in.result: BIGINT <=> string comparison should be done as float, so a warning for the value 'abc' is appropriate. mysql-test/t/bigint.test: New tests. sql/item_cmpfunc.cc: In convert_constant_item() we verify that the constant item can be stored in the given field. For BIGINT columns (MYSQL_TYPE_LONGLONG) we must verify that the stored constant value is actually comparable as int, i.e. that the value was not truncated. For between: compare as int only if both arguments convert correctly to int. --- mysql-test/r/bigint.result | 64 +++++++++++++++++++++++++++++++++++++++++++++ mysql-test/r/func_in.result | 2 ++ mysql-test/t/bigint.test | 47 +++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result index 47a45efa5fd..652c5b96147 100644 --- a/mysql-test/r/bigint.result +++ b/mysql-test/r/bigint.result @@ -438,3 +438,67 @@ Level Code Message Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 0) and ('0' = `test`.`t1`.`b`)) DROP TABLE t1; # End of 5.1 tests +# +# Bug#13463415 63502: INCORRECT RESULTS OF BIGINT AND DECIMAL COMPARISON +# +CREATE TABLE t_bigint(id BIGINT); +INSERT INTO t_bigint VALUES (1), (2); +SELECT id, id >= 1.1 FROM t_bigint; +id id >= 1.1 +1 0 +2 1 +SELECT id, 1.1 <= id FROM t_bigint; +id 1.1 <= id +1 0 +2 1 +SELECT id, id = 1.1 FROM t_bigint; +id id = 1.1 +1 0 +2 0 +SELECT id, 1.1 = id FROM t_bigint; +id 1.1 = id +1 0 +2 0 +SELECT * from t_bigint WHERE id = 1.1; +id +SELECT * from t_bigint WHERE id = 1.1e0; +id +SELECT * from t_bigint WHERE id = '1.1'; +id +SELECT * from t_bigint WHERE id = '1.1e0'; +id +SELECT * from t_bigint WHERE id IN (1.1, 2.2); +id +SELECT * from t_bigint WHERE id IN (1.1e0, 2.2e0); +id +SELECT * from t_bigint WHERE id IN ('1.1', '2.2'); +id +SELECT * from t_bigint WHERE id IN ('1.1e0', '2.2e0'); +id +SELECT * from t_bigint WHERE id BETWEEN 1.1 AND 1.9; +id +SELECT * from t_bigint WHERE id BETWEEN 1.1e0 AND 1.9e0; +id +SELECT * from t_bigint WHERE id BETWEEN '1.1' AND '1.9'; +id +SELECT * from t_bigint WHERE id BETWEEN '1.1e0' AND '1.9e0'; +id +DROP TABLE t_bigint; +# +# Bug#11758543 50756: BIGINT '100' MATCHES 1.001E2 +# +CREATE TABLE t1 (a BIGINT); +INSERT INTO t1 VALUES (1); +SELECT * FROM t1 WHERE coalesce(a) BETWEEN 0 and 0.9; +a +SELECT * FROM t1 WHERE coalesce(a)=0.9; +a +SELECT * FROM t1 WHERE coalesce(a) in (0.8,0.9); +a +SELECT * FROM t1 WHERE a BETWEEN 0 AND 0.9; +a +SELECT * FROM t1 WHERE a=0.9; +a +SELECT * FROM t1 WHERE a IN (0.8,0.9); +a +DROP TABLE t1; diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index 0b6117581f3..279a18e344e 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -469,6 +469,8 @@ SELECT HEX(a) FROM t2 WHERE a IN HEX(a) 7FFFFFFFFFFFFFFE 7FFFFFFFFFFFFFFF +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'abc' CREATE TABLE t3 (a BIGINT UNSIGNED); INSERT INTO t3 VALUES (9223372036854775551); SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42); diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test index e19bba971f9..41f33b8a7f2 100644 --- a/mysql-test/t/bigint.test +++ b/mysql-test/t/bigint.test @@ -361,4 +361,51 @@ DROP TABLE t1; --echo # End of 5.1 tests +--echo # +--echo # Bug#13463415 63502: INCORRECT RESULTS OF BIGINT AND DECIMAL COMPARISON +--echo # + +CREATE TABLE t_bigint(id BIGINT); +INSERT INTO t_bigint VALUES (1), (2); + +SELECT id, id >= 1.1 FROM t_bigint; +SELECT id, 1.1 <= id FROM t_bigint; + +SELECT id, id = 1.1 FROM t_bigint; +SELECT id, 1.1 = id FROM t_bigint; + +SELECT * from t_bigint WHERE id = 1.1; +SELECT * from t_bigint WHERE id = 1.1e0; +SELECT * from t_bigint WHERE id = '1.1'; +SELECT * from t_bigint WHERE id = '1.1e0'; + +SELECT * from t_bigint WHERE id IN (1.1, 2.2); +SELECT * from t_bigint WHERE id IN (1.1e0, 2.2e0); +SELECT * from t_bigint WHERE id IN ('1.1', '2.2'); +SELECT * from t_bigint WHERE id IN ('1.1e0', '2.2e0'); + +SELECT * from t_bigint WHERE id BETWEEN 1.1 AND 1.9; +SELECT * from t_bigint WHERE id BETWEEN 1.1e0 AND 1.9e0; +SELECT * from t_bigint WHERE id BETWEEN '1.1' AND '1.9'; +SELECT * from t_bigint WHERE id BETWEEN '1.1e0' AND '1.9e0'; +DROP TABLE t_bigint; + +--echo # +--echo # Bug#11758543 50756: BIGINT '100' MATCHES 1.001E2 +--echo # + +CREATE TABLE t1 (a BIGINT); +INSERT INTO t1 VALUES (1); + +# a. These queries correctly return 0 rows: +SELECT * FROM t1 WHERE coalesce(a) BETWEEN 0 and 0.9; +SELECT * FROM t1 WHERE coalesce(a)=0.9; +SELECT * FROM t1 WHERE coalesce(a) in (0.8,0.9); + +# b. These queries mistakenely returned 1 row: +SELECT * FROM t1 WHERE a BETWEEN 0 AND 0.9; +SELECT * FROM t1 WHERE a=0.9; +SELECT * FROM t1 WHERE a IN (0.8,0.9); + +DROP TABLE t1; -- cgit v1.2.1 From 4172d5e9a9f1c637914fa99640a30a75b6d517d3 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Wed, 25 Jan 2012 16:11:03 +0100 Subject: Bug#13359121 LARGE NUMBERS, /STRINGS/DTOA.C:662 Bug#12985021 SIMPLE QUERY WITH DECIMAL NUMBERS TAKE AN When parsing the fractional part of a string which is to be converted to double, we can stop after a few digits: the extra digits will not contribute to the actual result anyways. mysql-test/r/func_str.result: New tests. mysql-test/t/func_str.test: New tests. strings/dtoa.c: The problem was s2b() multiplying and adding hundreds-of-thousands of ever smaller fractions. --- mysql-test/r/func_str.result | 36 ++++++++++++++++++++++++++++++++++++ mysql-test/t/func_str.test | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index abf76a533b3..adaa2df3a61 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -2826,5 +2826,41 @@ SELECT ((0xf3) * (rpad(1.0,2048,1)) << (0xcc)); ((0xf3) * (rpad(1.0,2048,1)) << (0xcc)) 0 # +# Bug#13359121 LARGE NUMBERS, /STRINGS/DTOA.C:662: +# BALLOC: ASSERTION `K <= 15' FAILED. +# Bug#12985021 SIMPLE QUERY WITH DECIMAL NUMBERS TAKE AN +# EXTRAORDINARY LONG TIME TO EXECUTE +SELECT @tmp_max:= @@global.max_allowed_packet; +@tmp_max:= @@global.max_allowed_packet +1048576 +SET @@global.max_allowed_packet=1024*1024*1024; +SELECT @@global.max_allowed_packet; +@@global.max_allowed_packet +1073741824 +do +format(rpad('111111111.1', +1111111, +'999999999999999999999999999999999999999999'),0,'be_BY') +; +DO +round( +concat( ( +coalesce( ( +linefromwkb('2147483648', +-b'1111111111111111111111111111111111111111111')), +( convert('[.DC2.]',decimal(30,30)) ), +bit_count('') +) ), +( lpad( ( elt('01','}:K5')), +sha1('P'), +( ( select '-9223372036854775808.1' > all (select ''))) +) +) +) +); +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '[.DC2.]' +SET @@global.max_allowed_packet:= @tmp_max; +# # End of 5.5 tests # diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 083ed396527..27e196e5b0c 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1459,6 +1459,45 @@ SELECT stddev_samp(rpad(1.0,2048,1)); SELECT ((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1))); SELECT ((0xf3) * (rpad(1.0,2048,1)) << (0xcc)); +--echo # +--echo # Bug#13359121 LARGE NUMBERS, /STRINGS/DTOA.C:662: +--echo # BALLOC: ASSERTION `K <= 15' FAILED. +--echo # Bug#12985021 SIMPLE QUERY WITH DECIMAL NUMBERS TAKE AN +--echo # EXTRAORDINARY LONG TIME TO EXECUTE + +SELECT @tmp_max:= @@global.max_allowed_packet; +SET @@global.max_allowed_packet=1024*1024*1024; +# switching connection to allow the new max_allowed_packet take effect +--connect (newconn, localhost, root,,) + +SELECT @@global.max_allowed_packet; + +do +format(rpad('111111111.1', + 1111111, + '999999999999999999999999999999999999999999'),0,'be_BY') +; + +DO +round( + concat( ( + coalesce( ( + linefromwkb('2147483648', + -b'1111111111111111111111111111111111111111111')), + ( convert('[.DC2.]',decimal(30,30)) ), + bit_count('') + ) ), + ( lpad( ( elt('01','}:K5')), + sha1('P'), + ( ( select '-9223372036854775808.1' > all (select ''))) + ) + ) + ) +); + +--connection default +SET @@global.max_allowed_packet:= @tmp_max; +--disconnect newconn --echo # --echo # End of 5.5 tests -- cgit v1.2.1 From dfd38fb5f6cf023af56334015ed8a4eacb1987ef Mon Sep 17 00:00:00 2001 From: Nuno Carvalho Date: Wed, 25 Jan 2012 18:05:10 +0000 Subject: BUG#12403008 RPL_HEARTBEAT_BASIC FAILS SPORADICALLY ON PUSHBUILD rpl_heartbeat_basic test fails sporadically on pushbuild because did not received all heartbeats from slave in circular replication. MASTER_HEARTBEAT_PERIOD had the default value (slave_net_timeout/2) so wait on "Heartbeat event received on master", that only waits for 1 minute, sometimes timeout before heartbeat arrives. Fixed setting a smaller period value. --- mysql-test/suite/rpl/r/rpl_heartbeat_basic.result | 1 + mysql-test/suite/rpl/t/rpl_heartbeat_basic.test | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result index 93faf37053a..d1423dea378 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result @@ -270,6 +270,7 @@ Heartbeat event received include/rpl_reset.inc include/stop_slave.inc include/rpl_change_topology.inc [new topology=1->2->1] +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=1; include/start_slave.inc CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)); INSERT INTO t1 VALUES(1, 'on master'); diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test index b9a170c5bc1..78489449ab8 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test @@ -480,6 +480,12 @@ let $status_var_comparsion= >; --connection master #--replace_result $SLAVE_MYPORT SLAVE_PORT $slave_binlog SLAVE_BINLOG #eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$slave_binlog'; + +# BUG#12403008 RPL_HEARTBEAT_BASIC FAILS SPORADICALLY ON PUSHBUILD +# MASTER_HEARTBEAT_PERIOD had the default value (slave_net_timeout/2) +# so wait on "Heartbeat event received on master", that only waits for +# 1 minute, sometimes timeout before heartbeat arrives. +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=1; --source include/start_slave.inc # Insert data on master and on slave and make sure that it replicated for both directions -- cgit v1.2.1 From 2ed05e38edd82cfb1c1fffbafcca84b7adcdf3a1 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Thu, 26 Jan 2012 08:00:37 +0100 Subject: Bug#11753187 post-push fix: fix .result file --- mysql-test/r/mysqld--help-win.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 1e7e877e29f..d7a06c5b23e 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -679,7 +679,7 @@ The following options may be given as the first argument: --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual for the complete list of valid sql modes --standalone Dummy option to start as a standalone program (NT). - --stored-program-cache=# + --stored-program-cache=# The soft upper limit for number of cached stored routines for one connection. -s, --symbolic-links -- cgit v1.2.1 From 9e0b69c0b7122d2973aa61a4efd9e8d80ad4a970 Mon Sep 17 00:00:00 2001 From: Guilhem Bichot Date: Thu, 26 Jan 2012 10:25:23 +0100 Subject: Fixes for: BUG#13519696 - 62940: SELECT RESULTS VARY WITH VERSION AND WITH/WITHOUT INDEX RANGE SCAN BUG#13453382 - REGRESSION SINCE 5.1.39, RANGE OPTIMIZER WRONG RESULTS WITH DECIMAL CONVERSION BUG#13463488 - 63437: CHAR & BETWEEN WITH INDEX RETURNS WRONG RESULT AFTER MYSQL 5.1. Those are all cases where the range optimizer got it wrong with > and >=. mysql-test/r/range.result: Without the code fix for DECIMAL, "select count(val) from t2 where val > 0.1155" (which uses a range scan) returned 127 instead of 128); Moreover, both select * from t1 force index (primary) where a=1 and c>= 2.9; and select * from t1 force index (primary) where a=1 and c> 2.9; would miss "1 1 3". Without the code fix for strings, both SELECT * FROM t1 WHERE F1 >= 'A '; and SELECT * FROM t1 WHERE F1 BETWEEN 'A ' AND 'AAAAA'; would miss "A A A". sql/item.cc: Preamble to the explanations below: opt_range.cc:get_mm_leaf() does this (this is not changed by the patch): changes column > value to column OP V where: * V is what is in "column" after we stored "value" in it (such store operation may have done rounding...) * OP is > or >=, depending on what's correct. For example, if c is an INT column, c > 2.9 is changed to c OP 3 where OP is >= ('>' would not be correct). The bugs below are cases where we chose OP wrongly. Note that such transformations are visible in the optimizer trace. 1) Fix for STRING. In the scenario with CHAR(5) in range.test, this happens, in get_mm_tree(), for the condition F1>='A ': * value->save_in_field_no_warnings(field, 1) wants to store the right argument (named 'item') into the CHAR(5) field; this stores 'A ' (the item's value) padded with spaces (which changes nothing: still 'A ') * we come to case Item_func::GE_FUNC: /* Don't use open ranges for partial key_segments */ if ((!(key_part->flag & HA_PART_KEY_SEG)) && (stored_field_cmp_to_item(param->thd, field, value) < 0)) tree->min_flag= NEAR_MIN; tree->max_flag=NO_MAX_RANGE; What this wants to do is: if the field's value is strictly smaller than the item's, then ">=" can be changed to ">" (this is an optimization, it can help pruning one useless partition). * stored_field_cmp_to_item() is called; it compares the field's and item's values: the item's value (Item_string::val_str()) is 'A ') and the field's value (Field_string::val_str()) is 'A' (yes val_str() removes end spaces unless sql_mode='PAD_CHAR_TO_FULL_LENGTH'); and the comparison is done with stringcmp() which considers end spaces as relevant; as end spaces differ, function returns a negative number, and ">='A '" becomes ">'A'" (i.e. the NEAR_MIN flag is turned on). During execution the index range scan code will search for "A", find a match, but exclude it (because of ">"), wrongly. The badness is the string comparison done by stored_field_cmp_to_item(): we use the reply of this function to determine where the index search should start, so it should do comparison like index search does comparisons; index search comparisons are ha_key_cmp() which uses a collation-aware comparison (in our case, my_strnncollsp_simple(), which ignores end spaces); so stored_field_cmp_to_item() needs to do the same. When this is fixed, condition becomes ">='A '". 2) Fix for DECIMAL: just like in other comparisons in stored_field_cmp_to_item(), we must first pass the field and then the item; otherwise expectations on what <0 and >0 mean (inferiority, superiority) get violated. In the test in range.test about c>2.9: c is an INT column, so 2.9 gets stored as 3, then stored_field_cmp_to_item() compares 3 and 2.9; because of the wrong order of arguments passed to my_decimal_cmp(), range optimizer thinks that 3 is < 2.9 and thus changes "c> 2.9" to "c> 3". After fixing the order, it changes to the correct "c>= 3". In the test in range.inc for val > 0.1155, it was changed to val > 0.116, now it is changed to val >= 0.116. --- mysql-test/r/range.result | 117 ++++++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/range.test | 76 ++++++++++++++++++++++++++++++ 2 files changed, 193 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index ae63edf87b9..5a964baf2c2 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -1767,4 +1767,121 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk; pk i4 pk i4 DROP TABLE t1; +# +# BUG#13519696 - 62940: SELECT RESULTS VARY WITH VERSION AND +# WITH/WITHOUT INDEX RANGE SCAN +# +create table t1 (id int unsigned not null auto_increment primary key); +insert into t1 values (null); +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +create table t2 ( +id int unsigned not null auto_increment, +val decimal(5,3) not null, +primary key (id,val), +unique key (val,id), +unique key (id)); +insert into t2 select null,id*0.0009 from t1; +select count(val) from t2 ignore index (val) where val > 0.1155; +count(val) +128 +select count(val) from t2 force index (val) where val > 0.1155; +count(val) +128 +drop table t2, t1; +# +# BUG#13453382 - REGRESSION SINCE 5.1.39, RANGE OPTIMIZER WRONG +# RESULTS WITH DECIMAL CONVERSION +# +create table t1 (a int,b int,c int,primary key (a,c)); +insert into t1 values (1,1,2),(1,1,3),(1,1,4); +select convert(3, signed integer) > 2.9; +convert(3, signed integer) > 2.9 +1 +select * from t1 force index (primary) where a=1 and c>= 2.9; +a b c +1 1 3 +1 1 4 +select * from t1 ignore index (primary) where a=1 and c>= 2.9; +a b c +1 1 3 +1 1 4 +select * from t1 force index (primary) where a=1 and c> 2.9; +a b c +1 1 3 +1 1 4 +select * from t1 ignore index (primary) where a=1 and c> 2.9; +a b c +1 1 3 +1 1 4 +drop table t1; +# +# BUG#13463488 - 63437: CHAR & BETWEEN WITH INDEX RETURNS WRONG +# RESULT AFTER MYSQL 5.1. +# +CREATE TABLE t1( +F1 CHAR(5) NOT NULL, +F2 CHAR(5) NOT NULL, +F3 CHAR(5) NOT NULL, +PRIMARY KEY(F1), +INDEX IDX_F2(F2) +); +INSERT INTO t1 VALUES +('A','A','A'),('AA','AA','AA'),('AAA','AAA','AAA'), +('AAAA','AAAA','AAAA'),('AAAAA','AAAAA','AAAAA'); +SELECT * FROM t1 WHERE F1 = 'A '; +F1 F2 F3 +A A A +SELECT * FROM t1 IGNORE INDEX(PRIMARY) WHERE F1 = 'A '; +F1 F2 F3 +A A A +SELECT * FROM t1 WHERE F1 >= 'A '; +F1 F2 F3 +A A A +AA AA AA +AAA AAA AAA +AAAA AAAA AAAA +AAAAA AAAAA AAAAA +SELECT * FROM t1 WHERE F1 > 'A '; +F1 F2 F3 +AA AA AA +AAA AAA AAA +AAAA AAAA AAAA +AAAAA AAAAA AAAAA +SELECT * FROM t1 WHERE F1 BETWEEN 'A ' AND 'AAAAA'; +F1 F2 F3 +A A A +AA AA AA +AAA AAA AAA +AAAA AAAA AAAA +AAAAA AAAAA AAAAA +SELECT * FROM t1 WHERE F2 BETWEEN 'A ' AND 'AAAAA'; +F1 F2 F3 +A A A +AA AA AA +AAA AAA AAA +AAAA AAAA AAAA +AAAAA AAAAA AAAAA +SELECT * FROM t1 WHERE F3 BETWEEN 'A ' AND 'AAAAA'; +F1 F2 F3 +A A A +AA AA AA +AAA AAA AAA +AAAA AAAA AAAA +AAAAA AAAAA AAAAA +SELECT * FROM t1 IGNORE INDEX(PRIMARY) WHERE F1 BETWEEN 'A ' AND +'AAAAA'; +F1 F2 F3 +A A A +AA AA AA +AAA AAA AAA +AAAA AAAA AAAA +AAAAA AAAAA AAAAA +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 6c9320b708a..30d15798336 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -1392,4 +1392,80 @@ SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk; DROP TABLE t1; +--echo # +--echo # BUG#13519696 - 62940: SELECT RESULTS VARY WITH VERSION AND +--echo # WITH/WITHOUT INDEX RANGE SCAN +--echo # + +create table t1 (id int unsigned not null auto_increment primary key); +insert into t1 values (null); +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +create table t2 ( + id int unsigned not null auto_increment, + val decimal(5,3) not null, + primary key (id,val), + unique key (val,id), + unique key (id)); +--disable_warnings +insert into t2 select null,id*0.0009 from t1; +--enable_warnings + +select count(val) from t2 ignore index (val) where val > 0.1155; +select count(val) from t2 force index (val) where val > 0.1155; + +drop table t2, t1; + +--echo # +--echo # BUG#13453382 - REGRESSION SINCE 5.1.39, RANGE OPTIMIZER WRONG +--echo # RESULTS WITH DECIMAL CONVERSION +--echo # + +create table t1 (a int,b int,c int,primary key (a,c)); +insert into t1 values (1,1,2),(1,1,3),(1,1,4); +# show that the integer 3 is bigger than the decimal 2.9, +# which should also apply to comparing "c" with 2.9 +# when c is 3. +select convert(3, signed integer) > 2.9; +select * from t1 force index (primary) where a=1 and c>= 2.9; +select * from t1 ignore index (primary) where a=1 and c>= 2.9; +select * from t1 force index (primary) where a=1 and c> 2.9; +select * from t1 ignore index (primary) where a=1 and c> 2.9; +drop table t1; + +--echo # +--echo # BUG#13463488 - 63437: CHAR & BETWEEN WITH INDEX RETURNS WRONG +--echo # RESULT AFTER MYSQL 5.1. +--echo # + +CREATE TABLE t1( + F1 CHAR(5) NOT NULL, + F2 CHAR(5) NOT NULL, + F3 CHAR(5) NOT NULL, + PRIMARY KEY(F1), + INDEX IDX_F2(F2) +); + +INSERT INTO t1 VALUES +('A','A','A'),('AA','AA','AA'),('AAA','AAA','AAA'), +('AAAA','AAAA','AAAA'),('AAAAA','AAAAA','AAAAA'); + +SELECT * FROM t1 WHERE F1 = 'A '; +SELECT * FROM t1 IGNORE INDEX(PRIMARY) WHERE F1 = 'A '; +SELECT * FROM t1 WHERE F1 >= 'A '; +SELECT * FROM t1 WHERE F1 > 'A '; +SELECT * FROM t1 WHERE F1 BETWEEN 'A ' AND 'AAAAA'; +SELECT * FROM t1 WHERE F2 BETWEEN 'A ' AND 'AAAAA'; +SELECT * FROM t1 WHERE F3 BETWEEN 'A ' AND 'AAAAA'; +SELECT * FROM t1 IGNORE INDEX(PRIMARY) WHERE F1 BETWEEN 'A ' AND +'AAAAA'; + +DROP TABLE t1; + --echo End of 5.1 tests -- cgit v1.2.1