diff options
Diffstat (limited to 'mysql-test')
143 files changed, 883 insertions, 1244 deletions
diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 3bb66c0eb1a..062dddaaf40 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -81,4 +81,3 @@ parts.partition_syntax_ndb parts.partition_alter1_1_2_ndb parts.partition_basic_ndb parts.partition_mgm_lc0_ndb - diff --git a/mysql-test/extra/rpl_tests/rpl_insert_id.test b/mysql-test/extra/rpl_tests/rpl_insert_id.test index bd815d9de02..b076e73a215 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_id.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_id.test @@ -179,7 +179,9 @@ begin end| delimiter ;| +--disable_warnings insert into t1 (last_id) values (0); +--enable_warnings drop trigger t1_bi; @@ -512,7 +514,9 @@ set sql_log_bin=0; insert into t2 (id) values(5),(6),(7); delete from t2 where id>=5; set sql_log_bin=1; +--disable_warnings insert into t1 select insid(); +--enable_warnings select * from t1 order by id; select * from t2 order by id; diff --git a/mysql-test/extra/rpl_tests/rpl_reset_slave.test b/mysql-test/extra/rpl_tests/rpl_reset_slave.test index 1f88c792fce..428554ac598 100644 --- a/mysql-test/extra/rpl_tests/rpl_reset_slave.test +++ b/mysql-test/extra/rpl_tests/rpl_reset_slave.test @@ -22,6 +22,7 @@ source include/show_slave_status2.inc; reset slave; source include/show_slave_status2.inc; +change master to master_user='root'; start slave; sync_with_master; source include/show_slave_status2.inc; diff --git a/mysql-test/extra/rpl_tests/rpl_row_blob.test b/mysql-test/extra/rpl_tests/rpl_row_blob.test index 080df7d75dd..762daa816c0 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_blob.test +++ b/mysql-test/extra/rpl_tests/rpl_row_blob.test @@ -36,7 +36,7 @@ SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3; save_master_pos; connection slave; sync_with_master; -sleep 5; +--source include/wait_for_ndb_to_binlog.inc --echo --echo **** Data Insert Validation Slave Section test.t1 **** --echo @@ -56,12 +56,10 @@ UPDATE t1 set data=repeat('c',17*1024) where c1 = 2; --echo SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1; SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2; -# Sleep is needed for NDB to allow time for -# Injector thread to populate the bin log. save_master_pos; connection slave; sync_with_master; -sleep 5; +--source include/wait_for_ndb_to_binlog.inc --echo --echo **** Data Update Validation Slave Section test.t1 **** --echo @@ -132,7 +130,7 @@ FROM test.t2 WHERE c1=2; save_master_pos; connection slave; sync_with_master; -sleep 5; +--source include/wait_for_ndb_to_binlog.inc --echo --echo **** Data Insert Validation Slave Section test.t2 **** --echo @@ -155,12 +153,10 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) FROM test.t2 WHERE c1=1; SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3) FROM test.t2 WHERE c1=2; -# Sleep is needed for NDB to allow time for -# Injector thread to populate the bin log. save_master_pos; connection slave; sync_with_master; -sleep 5; +--source include/wait_for_ndb_to_binlog.inc --echo --echo **** Data Update Validation Slave Section test.t2 **** --echo diff --git a/mysql-test/extra/rpl_tests/rpl_row_func003.test b/mysql-test/extra/rpl_tests/rpl_row_func003.test index 8ee2d863527..e72ab04aec3 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_func003.test +++ b/mysql-test/extra/rpl_tests/rpl_row_func003.test @@ -3,10 +3,7 @@ # Original Date: Aug/15/2005 # # Update: 08/29/2005 Comment out sleep. Only needed for debugging # ############################################################################# -# Note: Many lines are commented out in this test case. These were used for # -# creating the test case and debugging and are being left for # -# debugging, but they can not be used for the regular testing as the # -# Time changes and is not deteministic, so instead we dump both the # +# Note: Time changes and is not deteministic, so instead we dump both the # # master and slave and diff the dumps. If the dumps differ then the # # test case will fail. To run during diff failuers, comment out the # # diff. # @@ -26,7 +23,6 @@ DROP TABLE IF EXISTS test.t1; --enable_warnings - eval CREATE TABLE test.t1 (a INT NOT NULL AUTO_INCREMENT, c CHAR(16),PRIMARY KEY(a))ENGINE=$engine_type; delimiter |; @@ -44,33 +40,24 @@ END| delimiter ;| INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1()); -sleep 6; INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1()); -sleep 6; - -#Select in this test are used for debugging -#select * from test.t1; -#connection slave; -#select * from test.t1; -connection master; SET AUTOCOMMIT=0; START TRANSACTION; INSERT INTO test.t1 VALUES (null,test.f1()); ROLLBACK; SET AUTOCOMMIT=1; -#select * from test.t1; -#sleep 6; - -#connection slave; -#select * from test.t1; - -#connection master; -#used for debugging -#show binlog events; +# Sync master and slave for all engines except NDB +if (`SELECT UPPER(LEFT('$engine_type', 3)) != 'NDB'`) { + sync_slave_with_master; + connection master; +} +# Sync master and slave for NDB engine +let $wait_time= 6; +--source include/wait_for_ndb_to_binlog.inc -# time to dump the databases and so we can see if they match +# Time to dump the databases and so we can see if they match --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/func003_master.sql --exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/func003_slave.sql @@ -87,5 +74,8 @@ DROP TABLE test.t1; diff_files $MYSQLTEST_VARDIR/tmp/func003_master.sql $MYSQLTEST_VARDIR/tmp/func003_slave.sql; +# Clean up +remove_file $MYSQLTEST_VARDIR/tmp/func003_master.sql; +remove_file $MYSQLTEST_VARDIR/tmp/func003_slave.sql; # End of 5.0 test case diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp003.test b/mysql-test/extra/rpl_tests/rpl_row_sp003.test index 7cf3d0fa19c..7bc326a3791 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_sp003.test +++ b/mysql-test/extra/rpl_tests/rpl_row_sp003.test @@ -41,10 +41,7 @@ CALL test.p2(); SELECT release_lock("test"); SELECT * FROM test.t1; #show binlog events; -# Added sleep for use with NDB to ensure that -# the injector thread will populate log before -# we switch to the slave. -sleep 5; +--source include/wait_for_ndb_to_binlog.inc sync_slave_with_master; connection slave; SELECT * FROM test.t1; diff --git a/mysql-test/extra/rpl_tests/rpl_stm_000001.test b/mysql-test/extra/rpl_tests/rpl_stm_000001.test index 869a9e3b07c..323d626c95f 100644 --- a/mysql-test/extra/rpl_tests/rpl_stm_000001.test +++ b/mysql-test/extra/rpl_tests/rpl_stm_000001.test @@ -68,8 +68,8 @@ enable_query_log; connection slave; lock tables t1 read; start slave; -#hope this is long enough for I/O thread to fetch over 16K relay log data -sleep 3; +connection master; +--source include/sync_slave_io_with_master.inc unlock tables; #test handling of aborted connection in the middle of update diff --git a/mysql-test/extra/rpl_tests/rpl_trig004.test b/mysql-test/extra/rpl_tests/rpl_trig004.test index 45cb11f2787..1a738db27fc 100644 --- a/mysql-test/extra/rpl_tests/rpl_trig004.test +++ b/mysql-test/extra/rpl_tests/rpl_trig004.test @@ -35,9 +35,8 @@ INSERT INTO test.t2 VALUES (1, 0.0); #show binlog events; select * from test.t1; select * from test.t2; -# Have to sleep for a few seconds to allow -# NDB injector thread to populate binlog -sleep 10; +let $wait_time= 10; +--source include/wait_for_ndb_to_binlog.inc sync_slave_with_master; connection slave; select * from test.t1; diff --git a/mysql-test/include/master-slave-reset.inc b/mysql-test/include/master-slave-reset.inc index 938eb2c074a..f54f5b83eb5 100644 --- a/mysql-test/include/master-slave-reset.inc +++ b/mysql-test/include/master-slave-reset.inc @@ -6,12 +6,29 @@ # Since we expect STOP SLAVE to produce a warning as the slave is # stopped (the server was started with skip-slave-start), we disable # warnings when doing STOP SLAVE. +# +# $no_change_master If true, no change master will be done nor any reset slave. +# This is to avoid touching the relay-log.info file allowing +# the test to create one itself. +# $skip_slave_start If true, the slave will not be started connection slave; + +#we expect STOP SLAVE to produce a warning as the slave is stopped +#(the server was started with skip-slave-start) --disable_warnings stop slave; +--disable_query_log +if (!$no_change_master) { + eval CHANGE MASTER TO MASTER_USER='root', + MASTER_CONNECT_RETRY=1, + MASTER_HOST='127.0.0.1', + MASTER_PORT=$MASTER_MYPORT; +} +--enable_query_log source include/wait_for_slave_to_stop.inc; --enable_warnings + connection master; --disable_warnings --disable_query_log @@ -20,17 +37,39 @@ use test; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; --enable_warnings reset master; + --disable_query_log -reset slave; +if (!$no_change_master) { + reset slave; +} --enable_query_log connection slave; -reset slave; + +--disable_warnings +# the first RESET SLAVE may produce a warning about non-existent +# 'ndb_apply_status' table, because this table is created +# asynchronously at the server startup and may not exist yet +# if RESET SLAVE comes too soon after the server startup +if (!$no_change_master) { + reset slave; +} +--enable_warnings + # Clean up old test tables --disable_warnings drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; --enable_warnings + --disable_query_log +#eval CHANGE MASTER TO MASTER_USER='root', +# MASTER_CONNECT_RETRY=1, +# MASTER_HOST='127.0.0.1', +# MASTER_PORT=$MASTER_MYPORT; reset master; --enable_query_log -start slave; -source include/wait_for_slave_to_start.inc; + +if (!$skip_slave_start) { + start slave; + source include/wait_for_slave_to_start.inc; +} + diff --git a/mysql-test/include/master-slave.inc b/mysql-test/include/master-slave.inc index 25e0150dd0a..134bb61ddab 100644 --- a/mysql-test/include/master-slave.inc +++ b/mysql-test/include/master-slave.inc @@ -1,4 +1,6 @@ # Replication tests need binlog +# +# $skip_slave_start If true, the slave will not be started source include/have_log_bin.inc; connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,); @@ -8,7 +10,10 @@ connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,); -- source include/master-slave-reset.inc -connection master; -sync_slave_with_master; +if (!$skip_slave_start) { + connection master; + sync_slave_with_master; +} + # Set the default connection to 'master' connection master; diff --git a/mysql-test/include/not_ndb_default.inc b/mysql-test/include/not_ndb_default.inc index ca3c57a671a..682a2944171 100644 --- a/mysql-test/include/not_ndb_default.inc +++ b/mysql-test/include/not_ndb_default.inc @@ -1,4 +1,4 @@ --require r/not_ndb_default.require disable_query_log; -select convert(@@table_type using latin1) NOT IN ("ndbcluster","NDBCLUSTER") as "TRUE"; +select convert(@@storage_engine using latin1) NOT IN ("ndbcluster","NDBCLUSTER") as "TRUE"; enable_query_log; diff --git a/mysql-test/include/wait_for_ndb_to_binlog.inc b/mysql-test/include/wait_for_ndb_to_binlog.inc new file mode 100644 index 00000000000..77da6d62154 --- /dev/null +++ b/mysql-test/include/wait_for_ndb_to_binlog.inc @@ -0,0 +1,41 @@ +# ==== 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. +# +# ==== Usage ==== +# +# let $engine_type= NDB; +# --source include/wait_for_ndb_to_binlog.inc +# +# ==== 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; +} + +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; + } +} + diff --git a/mysql-test/include/wait_show_condition.inc b/mysql-test/include/wait_show_condition.inc index 253101d1e07..f683ca7b47b 100644 --- a/mysql-test/include/wait_show_condition.inc +++ b/mysql-test/include/wait_show_condition.inc @@ -2,13 +2,16 @@ # # SUMMARY # -# Waits until the show statement ($show_statement) has at least within one of -# the rows of the result set for the field ($field) a value which fulfils +# Waits until the show statement ($show_statement) has one or all of the +# rows of the result set for the field ($field) a value which fulfils # a condition ($condition), or the operation times out. # # # USAGE # +# All rows of the result must fulfil the condition if $all_rows_fulfil is 1 +# else at least one of the result must fulfil the condition. +# let $wait_for_all= 1; # let $show_statement= SHOW PROCESSLIST; # let $field= State; # let $condition= = 'Updating'; @@ -46,27 +49,56 @@ inc $max_run_time; let $found= 0; let $max_end_time= `SELECT UNIX_TIMESTAMP() + $max_run_time`; -while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`) + +if (`SELECT '$wait_for_all' != '1'`) { - # Sleep a bit to avoid too heavy load. - real_sleep 0.2; - let $rowno= 1; - let $process_result= 1; - while (`SELECT $process_result = 1 AND $found = 0`) - { - let $field_value= query_get_value($show_statement, $field, $rowno); - if (`SELECT '$field_value' $condition`) - { - let $found= 1; - } - if (`SELECT '$field_value' = 'No such row'`) - { - # We are behind the last row of the result set. - let $process_result= 0; - } - inc $rowno; - } + while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`) + { + # Sleep a bit to avoid too heavy load. + real_sleep 0.2; + let $rowno= 1; + let $process_result= 1; + while (`SELECT $process_result = 1 AND $found = 0`) + { + let $field_value= query_get_value($show_statement, $field, $rowno); + if (`SELECT '$field_value' $condition`) + { + let $found= 1; + } + if (`SELECT '$field_value' = 'No such row'`) + { + # We are behind the last row of the result set. + let $process_result= 0; + } + inc $rowno; + } + } } + +if (`SELECT '$wait_for_all' = '1'`) +{ + while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`) + { + # Sleep a bit to avoid too heavy load. + real_sleep 0.2; + let $rowno= 1; + let $process_result= 1; + while (`SELECT $process_result = 1 AND $found = 0`) + { + let $field_value= query_get_value($show_statement, $field, $rowno); + if (`SELECT '$field_value' = 'No such row'`) + { + let $found= 1; + } + if (`SELECT $found = 0 AND NOT '$field_value' $condition`) + { + let process_result= 0; + } + inc $rowno; + } + } +} + if (!$found) { echo # Timeout in include/wait_show_condition.inc for $wait_condition; diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl index 86ad5c485c1..9ae3208fc24 100755 --- a/mysql-test/lib/v1/mysql-test-run.pl +++ b/mysql-test/lib/v1/mysql-test-run.pl @@ -4024,15 +4024,26 @@ sub mysqld_arguments ($$$$) { } else { - if ($mysql_version_id < 50200) - { - mtr_add_arg($args, "%s--master-user=root", $prefix); - mtr_add_arg($args, "%s--master-connect-retry=1", $prefix); - mtr_add_arg($args, "%s--master-host=127.0.0.1", $prefix); - mtr_add_arg($args, "%s--master-password=", $prefix); - mtr_add_arg($args, "%s--master-port=%d", $prefix, - $master->[0]->{'port'}); # First master - } +# NOTE: the backport (see BUG#48048) originally removed the +# commented out lines below. However, given that they are +# protected with a version check (< 50200) now, it should be +# safe to keep them. The problem is that the backported patch +# was into a 5.1 GA codebase - mysql-5.1-rep+2 tree - so +# version is 501XX, consequently check becomes worthless. It +# should be safe to uncomment them when merging up to 5.5. +# +# RQG semisync test runs on the 5.1 GA tree and needs MTR v1. +# This was causing the test to fail (slave would not start +# due to unrecognized option(s)). +# if ($mysql_version_id < 50200) +# { +# mtr_add_arg($args, "%s--master-user=root", $prefix); +# mtr_add_arg($args, "%s--master-connect-retry=1", $prefix); +# mtr_add_arg($args, "%s--master-host=127.0.0.1", $prefix); +# mtr_add_arg($args, "%s--master-password=", $prefix); +# mtr_add_arg($args, "%s--master-port=%d", $prefix, +# $master->[0]->{'port'}); # First master +# } my $slave_server_id= 2 + $idx; my $slave_rpl_rank= $slave_server_id; mtr_add_arg($args, "%s--server-id=%d", $prefix, $slave_server_id); diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index f76cb008c3c..a99989137e2 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -68,7 +68,7 @@ use My::File::Path; # Patched version of File::Path use File::Basename; use File::Copy; use File::Find; -use File::Temp qw / tempdir /; +use File::Temp qw /tempdir/; use File::Spec::Functions qw / splitdir /; use My::Platform; use My::SafeProcess; diff --git a/mysql-test/r/deprecated_features.result b/mysql-test/r/deprecated_features.result new file mode 100644 index 00000000000..ecfb830542d --- /dev/null +++ b/mysql-test/r/deprecated_features.result @@ -0,0 +1,26 @@ +set global log_bin_trust_routine_creators=1; +ERROR HY000: Unknown system variable 'log_bin_trust_routine_creators' +set table_type='MyISAM'; +ERROR HY000: Unknown system variable 'table_type' +select @@table_type='MyISAM'; +ERROR HY000: Unknown system variable 'table_type' +backup table t1 to 'data.txt'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'backup table t1 to 'data.txt'' at line 1 +restore table t1 from 'data.txt'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'restore table t1 from 'data.txt'' at line 1 +show plugin; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'plugin' at line 1 +load table t1 from master; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table t1 from master' at line 1 +load data from master; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from master' at line 1 +SHOW INNODB STATUS; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNODB STATUS' at line 1 +create table t1 (t6 timestamp(6)); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(6))' at line 1 +create table t1 (t6 timestamp) type=myisam; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type=myisam' at line 1 +show table types; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'types' at line 1 +show mutex status; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mutex status' at line 1 diff --git a/mysql-test/r/flush2.result b/mysql-test/r/flush2.result index 5056955c7b7..13bcc371ef6 100644 --- a/mysql-test/r/flush2.result +++ b/mysql-test/r/flush2.result @@ -4,11 +4,9 @@ show variables like 'log_bin%'; Variable_name Value log_bin OFF log_bin_trust_function_creators ON -log_bin_trust_routine_creators ON flush logs; show variables like 'log_bin%'; Variable_name Value log_bin OFF log_bin_trust_function_creators ON -log_bin_trust_routine_creators ON set global expire_logs_days = 0; diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 3ab65c24040..1603ecec127 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -412,8 +412,6 @@ prepare stmt1 from ' optimize table t1 ' ; prepare stmt1 from ' analyze table t1 ' ; prepare stmt1 from ' checksum table t1 ' ; prepare stmt1 from ' repair table t1 ' ; -prepare stmt1 from ' restore table t1 from ''<MYSQLTEST_VARDIR>/tmp/data.txt'' ' ; -ERROR HY000: This command is not supported in the prepared statement protocol yet prepare stmt1 from ' handler t1 open '; ERROR HY000: This command is not supported in the prepared statement protocol yet prepare stmt3 from ' commit ' ; diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 091d932a6fc..50384149a26 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -808,7 +808,6 @@ show plugins; show columns in t1; show slave hosts; show keys in t1; -show table types; show storage engines; show authors; show contributors; @@ -1291,11 +1290,6 @@ delete from mysql.db where user='mysqltest_4'; delete from mysql.tables_priv where user='mysqltest_4'; flush privileges; drop database mysqltest; -show full plugin; -show warnings; -Level Code Message -Warning 1287 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 6.0. Please use 'SHOW PLUGINS' instead -show plugin; show plugins; create database `mysqlttest\1`; create table `mysqlttest\1`.`a\b` (a int); @@ -1447,7 +1441,6 @@ DROP PROCEDURE p1; DROP FUNCTION f1; DROP TABLE t1; DROP EVENT ev1; -SHOW TABLE TYPES; CREATE USER test_u@localhost; GRANT PROCESS ON *.* TO test_u@localhost; SHOW ENGINE MYISAM MUTEX; diff --git a/mysql-test/r/signal_code.result b/mysql-test/r/signal_code.result index 8cda8877216..2ecba4701fa 100644 --- a/mysql-test/r/signal_code.result +++ b/mysql-test/r/signal_code.result @@ -20,16 +20,16 @@ return 0; end $$ show procedure code signal_proc; Pos Instruction -0 stmt 135 "SIGNAL foo" -1 stmt 135 "SIGNAL foo SET MESSAGE_TEXT = "This i..." -2 stmt 136 "RESIGNAL foo" -3 stmt 136 "RESIGNAL foo SET MESSAGE_TEXT = "This..." +0 stmt 131 "SIGNAL foo" +1 stmt 131 "SIGNAL foo SET MESSAGE_TEXT = "This i..." +2 stmt 132 "RESIGNAL foo" +3 stmt 132 "RESIGNAL foo SET MESSAGE_TEXT = "This..." drop procedure signal_proc; show function code signal_func; Pos Instruction -0 stmt 135 "SIGNAL foo" -1 stmt 135 "SIGNAL foo SET MESSAGE_TEXT = "This i..." -2 stmt 136 "RESIGNAL foo" -3 stmt 136 "RESIGNAL foo SET MESSAGE_TEXT = "This..." +0 stmt 131 "SIGNAL foo" +1 stmt 131 "SIGNAL foo SET MESSAGE_TEXT = "This i..." +2 stmt 132 "RESIGNAL foo" +3 stmt 132 "RESIGNAL foo SET MESSAGE_TEXT = "This..." 4 freturn 3 0 drop function signal_func; diff --git a/mysql-test/r/sp-code.result b/mysql-test/r/sp-code.result index 949976719ea..0a0f620b80a 100644 --- a/mysql-test/r/sp-code.result +++ b/mysql-test/r/sp-code.result @@ -155,11 +155,11 @@ Pos Instruction 0 stmt 9 "drop temporary table if exists sudoku..." 1 stmt 1 "create temporary table sudoku_work ( ..." 2 stmt 1 "create temporary table sudoku_schedul..." -3 stmt 93 "call sudoku_init()" +3 stmt 89 "call sudoku_init()" 4 jump_if_not 7(8) p_naive@0 5 stmt 4 "update sudoku_work set cnt = 0 where ..." 6 jump 8 -7 stmt 93 "call sudoku_count()" +7 stmt 89 "call sudoku_count()" 8 stmt 6 "insert into sudoku_schedule (row,col)..." 9 set v_scounter@2 0 10 set v_i@3 1 diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 7a3cb55858b..00ae7dd4eca 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -921,10 +921,6 @@ CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN DROP TRIGGER test1; EN ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. CREATE FUNCTION bug_13627_f() returns int BEGIN DROP TRIGGER test1; return 1; END | ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. -CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN load table t1 from master; END | -ERROR 0A000: LOAD TABLE is not allowed in stored procedures -CREATE FUNCTION bug_13627_f() returns int BEGIN load table t1 from master; return 1; END | -ERROR 0A000: LOAD TABLE is not allowed in stored procedures CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create table t2 (a int); END | ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. CREATE FUNCTION bug_13627_f() returns int BEGIN create table t2 (a int); return 1; END | @@ -1115,18 +1111,6 @@ REPAIR TABLE t1; RETURN 1; END| ERROR 0A000: Not allowed to return a result set from a function -CREATE FUNCTION bug13012() RETURNS INT -BEGIN -BACKUP TABLE t1 TO '/tmp'; -RETURN 1; -END| -ERROR 0A000: Not allowed to return a result set from a function -CREATE FUNCTION bug13012() RETURNS INT -BEGIN -RESTORE TABLE t1 FROM '/tmp'; -RETURN 1; -END| -ERROR 0A000: Not allowed to return a result set from a function create table t1 (a int)| CREATE PROCEDURE bug13012_1() REPAIR TABLE t1| CREATE FUNCTION bug13012_2() RETURNS INT @@ -1639,11 +1623,9 @@ DROP TABLE t1| drop procedure if exists p1; create procedure p1() begin -create table t1 (a int) type=MyISAM; +create table t1 (a int) engine=MyISAM; drop table t1; end| -Warnings: -Warning 1287 The syntax 'TYPE=storage_engine' is deprecated and will be removed in MySQL 6.0. Please use 'ENGINE=storage_engine' instead call p1(); call p1(); drop procedure p1; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index a73abf787d8..4d8bcaf6589 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -4305,19 +4305,10 @@ drop procedure if exists bug13012| create procedure bug13012() BEGIN REPAIR TABLE t1; -BACKUP TABLE t1 to '<MYSQLTEST_VARDIR>/tmp/'; -DROP TABLE t1; -RESTORE TABLE t1 FROM '<MYSQLTEST_VARDIR>/tmp/'; END| call bug13012()| Table Op Msg_type Msg_text test.t1 repair status OK -Table Op Msg_type Msg_text -test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead -test.t1 backup status OK -Table Op Msg_type Msg_text -test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead -test.t1 restore status OK drop procedure bug13012| create view v1 as select * from t1| create procedure bug13012() diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result index be45e5ff5d7..f55e535a293 100644 --- a/mysql-test/r/sp_trans.result +++ b/mysql-test/r/sp_trans.result @@ -533,9 +533,7 @@ set @@session.max_heap_table_size=default| CREATE DATABASE db_bug7787| use db_bug7787| CREATE PROCEDURE p1() -SHOW INNODB STATUS; | -Warnings: -Warning 1287 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 6.0. Please use 'SHOW ENGINE INNODB STATUS' instead +SHOW ENGINE INNODB STATUS; | GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost| DROP DATABASE db_bug7787| drop user user_bug7787@localhost| diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index d11ab236c34..b7464ae8ad6 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -889,28 +889,12 @@ CREATE TABLE b15776 (a year(0)); DROP TABLE b15776; CREATE TABLE b15776 (a year(-2)); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-2))' at line 1 -CREATE TABLE b15776 (a timestamp(4294967294)); -Warnings: -Warning 1287 The syntax 'TIMESTAMP(4294967294)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead -DROP TABLE b15776; -CREATE TABLE b15776 (a timestamp(4294967295)); -Warnings: -Warning 1287 The syntax 'TIMESTAMP(4294967295)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead -DROP TABLE b15776; -CREATE TABLE b15776 (a timestamp(4294967296)); -ERROR 42000: Display width out of range for column 'a' (max = 4294967295) -CREATE TABLE b15776 (a timestamp(-1)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1))' at line 1 -CREATE TABLE b15776 (a timestamp(-2)); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-2))' at line 1 CREATE TABLE b15776 (a int(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); ERROR 42000: Display width out of range for column 'a' (max = 4294967295) CREATE TABLE b15776 (a char(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); ERROR 42000: Display width out of range for column 'a' (max = 4294967295) CREATE TABLE b15776 (a year(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); ERROR 42000: Display width out of range for column 'a' (max = 4294967295) -CREATE TABLE b15776 (a timestamp(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); -ERROR 42000: Display width out of range for column 'a' (max = 4294967295) CREATE TABLE b15776 select cast(null as char(4294967295)); show columns from b15776; Field Type Null Key Default Extra diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 24cb725de9f..fd13f53d02b 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -97,30 +97,6 @@ date date_time time_stamp 2005-01-01 2005-01-01 00:00:00 2005-01-01 00:00:00 2030-01-01 2030-01-01 00:00:00 2030-01-01 00:00:00 drop table t1; -create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6), -t8 timestamp(8), t10 timestamp(10), t12 timestamp(12), -t14 timestamp(14)); -Warnings: -Warning 1287 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead -Warning 1287 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead -Warning 1287 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead -Warning 1287 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead -Warning 1287 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead -Warning 1287 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead -Warning 1287 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead -insert t1 values (0,0,0,0,0,0,0), -("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", -"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", -"1997-12-31 23:47:59"); -select * from t1; -t2 t4 t6 t8 t10 t12 t14 -0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 -1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 -select * from t1; -t2 t4 t6 t8 t10 t12 t14 -0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 -1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 -drop table t1; create table t1 (ix timestamp); insert into t1 values (0),(20030101010160),(20030101016001),(20030101240101),(20030132010101),(20031301010101),(20031200000000),(20030000000000); Warnings: @@ -436,7 +412,7 @@ max(t) 2004-02-01 00:00:00 drop table t1; set sql_mode='maxdb'; -create table t1 (a timestamp, b timestamp(19)); +create table t1 (a timestamp, b timestamp); show create table t1; Table Create Table t1 CREATE TABLE "t1" ( diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index e2bce537179..8e70ea8b53d 100644 --- a/mysql-test/r/warnings.result +++ b/mysql-test/r/warnings.result @@ -166,9 +166,6 @@ show variables like 'max_error_count'; Variable_name Value max_error_count 10 drop table t1; -set table_type=MYISAM; -Warnings: -Warning 1287 The syntax '@@table_type' is deprecated and will be removed in MySQL 6.0. Please use '@@storage_engine' instead create table t1 (a int); insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); update t1 set a='abc'; diff --git a/mysql-test/suite/binlog/r/binlog_max_extension.result b/mysql-test/suite/binlog/r/binlog_max_extension.result new file mode 100644 index 00000000000..af341db4536 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_max_extension.result @@ -0,0 +1,8 @@ +call mtr.add_suppression("Next log extension: 2147483647. Remaining log filename extensions: 0."); +call mtr.add_suppression("Log filename extension number exhausted:"); +call mtr.add_suppression("Can't generate a unique log-filename"); +RESET MASTER; +FLUSH LOGS; +Warnings: +Warning 1098 Can't generate a unique log-filename master-bin.(1-999) + diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result index 06c57fba2e7..ea081183cd1 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result @@ -456,7 +456,11 @@ return n; end| reset master; insert into t2 values (bug27417(1)); +Warnings: +Note 1592 Statement may not be safe to log in statement format. insert into t2 select bug27417(2); +Warnings: +Note 1592 Statement may not be safe to log in statement format. reset master; insert into t2 values (bug27417(2)); ERROR 23000: Duplicate entry '2' for key 'PRIMARY' @@ -473,6 +477,8 @@ select count(*) from t2; count(*) 2 delete from t2 where a=bug27417(3); +Warnings: +Note 1592 Statement may not be safe to log in statement format. select count(*) from t2 /* nothing got deleted */; count(*) 2 @@ -486,6 +492,8 @@ count(*) 5 delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */; affected rows: 0 +Warnings: +Note 1592 Statement may not be safe to log in statement format. select count(*) from t1 /* must be 7 */; count(*) 7 @@ -700,7 +708,11 @@ return n; end| reset master; insert into t2 values (bug27417(1)); +Warnings: +Note 1592 Statement may not be safe to log in statement format. insert into t2 select bug27417(2); +Warnings: +Note 1592 Statement may not be safe to log in statement format. reset master; insert into t2 values (bug27417(2)); ERROR 23000: Duplicate entry '2' for key 'PRIMARY' @@ -716,6 +728,8 @@ select count(*) from t2; count(*) 2 delete from t2 where a=bug27417(3); +Warnings: +Note 1592 Statement may not be safe to log in statement format. select count(*) from t2 /* nothing got deleted */; count(*) 2 @@ -728,6 +742,8 @@ count(*) 5 delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */; affected rows: 0 +Warnings: +Note 1592 Statement may not be safe to log in statement format. select count(*) from t1 /* must be 7 */; count(*) 7 diff --git a/mysql-test/suite/binlog/r/binlog_tmp_table.result b/mysql-test/suite/binlog/r/binlog_tmp_table.result index 14b1963ffd9..e4928432324 100644 --- a/mysql-test/suite/binlog/r/binlog_tmp_table.result +++ b/mysql-test/suite/binlog/r/binlog_tmp_table.result @@ -1,4 +1,3 @@ -RESET MASTER; create table foo (a int); flush logs; create temporary table tmp1_foo like foo; diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result index 3047ff54cf0..58738a0d97c 100644 --- a/mysql-test/suite/binlog/r/binlog_unsafe.result +++ b/mysql-test/suite/binlog/r/binlog_unsafe.result @@ -300,4 +300,59 @@ Warnings: Note 1592 Statement may not be safe to log in statement format. DROP TABLE t1, t2; SET @@SESSION.SQL_MODE = @save_sql_mode; +CREATE TABLE t1 (a INT, b INT PRIMARY KEY AUTO_INCREMENT); +CREATE TABLE t2 (a INT, b INT PRIMARY KEY AUTO_INCREMENT); +CREATE FUNCTION func_modify_t1 () +RETURNS INT +BEGIN +INSERT INTO t1 SET a = 1; +RETURN 0; +END| +# The following statement causes auto-incrementation +# of both t1 and t2. It is logged in statement format, +# so it should produce unsafe warning. +INSERT INTO t2 SET a = func_modify_t1(); +Warnings: +Note 1592 Statement may not be safe to log in statement format. +SET SESSION binlog_format = MIXED; +# Check if the statement is logged in row format. +INSERT INTO t2 SET a = func_modify_t1(); +SHOW BINLOG EVENTS FROM 12283; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 12283 Query 1 12351 BEGIN +master-bin.000001 12351 Table_map 1 12393 table_id: 44 (test.t2) +master-bin.000001 12393 Table_map 1 12435 table_id: 45 (test.t1) +master-bin.000001 12435 Write_rows 1 12473 table_id: 45 +master-bin.000001 12473 Write_rows 1 12511 table_id: 44 flags: STMT_END_F +master-bin.000001 12511 Query 1 12580 COMMIT +DROP TABLE t1,t2; +DROP FUNCTION func_modify_t1; +SET SESSION binlog_format = STATEMENT; +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT, b INT PRIMARY KEY AUTO_INCREMENT); +CREATE TABLE t3 (a INT, b INT PRIMARY KEY AUTO_INCREMENT); +create trigger tri_modify_two_tables before insert on t1 for each row begin +insert into t2(a) values(new.a); +insert into t3(a) values(new.a); +end | +# The following statement causes auto-incrementation +# of both t2 and t3. It is logged in statement format, +# so it should produce unsafe warning +INSERT INTO t1 SET a = 1; +Warnings: +Note 1592 Statement may not be safe to log in statement format. +SET SESSION binlog_format = MIXED; +# Check if the statement is logged in row format. +INSERT INTO t1 SET a = 2; +SHOW BINLOG EVENTS FROM 13426; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 13426 Query 1 13494 BEGIN +master-bin.000001 13494 Table_map 1 13535 table_id: 47 (test.t1) +master-bin.000001 13535 Table_map 1 13577 table_id: 48 (test.t3) +master-bin.000001 13577 Table_map 1 13619 table_id: 49 (test.t2) +master-bin.000001 13619 Write_rows 1 13657 table_id: 49 +master-bin.000001 13657 Write_rows 1 13695 table_id: 48 +master-bin.000001 13695 Write_rows 1 13729 table_id: 47 flags: STMT_END_F +master-bin.000001 13729 Query 1 13798 COMMIT +DROP TABLE t1,t2,t3; "End of tests" diff --git a/mysql-test/suite/binlog/t/binlog_max_extension.test b/mysql-test/suite/binlog/t/binlog_max_extension.test new file mode 100644 index 00000000000..9f52d195e21 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_max_extension.test @@ -0,0 +1,92 @@ +# BUG#40611: MySQL cannot make a binary log after sequential number beyond +# unsigned long. +# +# Problem statement +# ================= +# +# Extension for log file names might be created with negative +# numbers (when counter used would wrap around), causing server +# failure when incrementing -00001 (reaching number 000000 +# extension). +# +# Test +# ==== +# This tests aims at testing the a patch that removes negatives +# numbers from log name extensions and checks that the server +# reports gracefully that the limit has been reached. +# +# It instruments index file to point to a log file close to +# the new maximum and calls flush logs to get warning. +# + +call mtr.add_suppression("Next log extension: 2147483647. Remaining log filename extensions: 0."); +call mtr.add_suppression("Log filename extension number exhausted:"); +call mtr.add_suppression("Can't generate a unique log-filename"); + + +-- source include/have_log_bin.inc +RESET MASTER; + +-- let $MYSQLD_DATADIR= `select @@datadir` + +############################################### +# check hitting maximum file name extension: +############################################### + +########## +# Prepare +########## + +# 1. Stop master server +-- write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait +EOF +-- shutdown_server 10 +-- source include/wait_until_disconnected.inc + +# 2. Prepare log and index file +-- copy_file $MYSQLD_DATADIR/master-bin.index $MYSQLD_DATADIR/master-bin.index.orig +-- copy_file $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.2147483646 +-- append_file $MYSQLD_DATADIR/master-bin.index +master-bin.2147483646 +EOF + +# 3. Restart the server +-- append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart +EOF +-- enable_reconnect +-- source include/wait_until_connected_again.inc + +########### +# Assertion +########### + +# assertion: should throw warning +FLUSH LOGS; + +############## +# Clean up +############## + +# 1. Stop the server +-- write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait +EOF +-- shutdown_server 10 +-- source include/wait_until_disconnected.inc + +# 2. Undo changes to index and log files +-- remove_file $MYSQLD_DATADIR/master-bin.index +-- copy_file $MYSQLD_DATADIR/master-bin.index.orig $MYSQLD_DATADIR/master-bin.index +-- remove_file $MYSQLD_DATADIR/master-bin.index.orig + +-- remove_file $MYSQLD_DATADIR/master-bin.2147483646 +-- remove_file $MYSQLD_DATADIR/master-bin.2147483647 + +# 3. Restart the server +-- append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart +EOF +-- enable_reconnect +-- source include/wait_until_connected_again.inc diff --git a/mysql-test/suite/binlog/t/binlog_tmp_table.test b/mysql-test/suite/binlog/t/binlog_tmp_table.test index 54af8a8cb68..6947959a5e0 100644 --- a/mysql-test/suite/binlog/t/binlog_tmp_table.test +++ b/mysql-test/suite/binlog/t/binlog_tmp_table.test @@ -30,7 +30,6 @@ source include/have_binlog_format_mixed_or_statement.inc; connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,); connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,); -RESET MASTER; create table foo (a int); diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test index c4e1f31cbce..1cda75cdb6d 100644 --- a/mysql-test/suite/binlog/t/binlog_unsafe.test +++ b/mysql-test/suite/binlog/t/binlog_unsafe.test @@ -388,4 +388,72 @@ DELETE FROM t1 LIMIT 1; DROP TABLE t1, t2; SET @@SESSION.SQL_MODE = @save_sql_mode; + +# +# BUG#45827 +# The test verifies if stmt that have more than one +# different tables to update with autoinc columns +# will produce unsafe warning +# + +# Test case1: stmt that have more than one different tables +# to update with autoinc columns should produce +# unsafe warning when calling a function +CREATE TABLE t1 (a INT, b INT PRIMARY KEY AUTO_INCREMENT); +CREATE TABLE t2 (a INT, b INT PRIMARY KEY AUTO_INCREMENT); + +# The purpose of this function is to insert into t1 so that the second +# column is auto_increment'ed. +DELIMITER |; +CREATE FUNCTION func_modify_t1 () +RETURNS INT +BEGIN + INSERT INTO t1 SET a = 1; + RETURN 0; +END| +DELIMITER ;| +--echo # The following statement causes auto-incrementation +--echo # of both t1 and t2. It is logged in statement format, +--echo # so it should produce unsafe warning. +INSERT INTO t2 SET a = func_modify_t1(); + +SET SESSION binlog_format = MIXED; +--echo # Check if the statement is logged in row format. +let $pos0_master= query_get_value(SHOW MASTER STATUS, Position, 1); +INSERT INTO t2 SET a = func_modify_t1(); +eval SHOW BINLOG EVENTS FROM $pos0_master; + +# clean up +DROP TABLE t1,t2; +DROP FUNCTION func_modify_t1; + +# Test case2: stmt that have more than one different tables +# to update with autoinc columns should produce +# unsafe warning when invoking a trigger +SET SESSION binlog_format = STATEMENT; +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT, b INT PRIMARY KEY AUTO_INCREMENT); +CREATE TABLE t3 (a INT, b INT PRIMARY KEY AUTO_INCREMENT); +# The purpose of this function is to insert into t1 so that the second +# column is auto_increment'ed. +delimiter |; +create trigger tri_modify_two_tables before insert on t1 for each row begin + insert into t2(a) values(new.a); + insert into t3(a) values(new.a); +end | +delimiter ;| +--echo # The following statement causes auto-incrementation +--echo # of both t2 and t3. It is logged in statement format, +--echo # so it should produce unsafe warning +INSERT INTO t1 SET a = 1; + +SET SESSION binlog_format = MIXED; +--echo # Check if the statement is logged in row format. +let $pos1_master= query_get_value(SHOW MASTER STATUS, Position, 1); +INSERT INTO t1 SET a = 2; +eval SHOW BINLOG EVENTS FROM $pos1_master; + +# clean up +DROP TABLE t1,t2,t3; + --echo "End of tests" diff --git a/mysql-test/suite/rpl/my.cnf b/mysql-test/suite/rpl/my.cnf index 4d0e5e51664..74233b056c7 100644 --- a/mysql-test/suite/rpl/my.cnf +++ b/mysql-test/suite/rpl/my.cnf @@ -3,13 +3,6 @@ !include rpl_1slave_base.cnf !include include/default_client.cnf + [mysqld.2] -# Hardcode the host to 127.0.0.1 until running on more -# than one host and it need to be masked -# master-host= @mysqld.1.#host -master-host= 127.0.0.1 -master-port= @mysqld.1.port -master-password= @mysqld.1.#password -master-user= @mysqld.1.#user -master-connect-retry= 1 diff --git a/mysql-test/suite/rpl/r/rpl000017.result b/mysql-test/suite/rpl/r/rpl000017.result index 1c611357e64..403f4d4d4fe 100644 --- a/mysql-test/suite/rpl/r/rpl000017.result +++ b/mysql-test/suite/rpl/r/rpl000017.result @@ -1,10 +1,7 @@ stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; -reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -stop slave; grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab'; grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab'; start slave; diff --git a/mysql-test/suite/rpl/r/rpl_000015.result b/mysql-test/suite/rpl/r/rpl_000015.result index d6cb544df7c..1b1249bc979 100644 --- a/mysql-test/suite/rpl/r/rpl_000015.result +++ b/mysql-test/suite/rpl/r/rpl_000015.result @@ -4,50 +4,8 @@ File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB> reset slave; SHOW SLAVE STATUS; -change master to master_host='127.0.0.1'; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User test -Master_Port 3306 -Connect_Retry 7 -Master_Log_File -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error -Replicate_Ignore_Server_Ids -Master_Server_Id 0 change master to master_host='127.0.0.1',master_user='root', -master_password='',master_port=MASTER_PORT; +master_password='',master_port=MASTER_PORT, MASTER_CONNECT_RETRY=7; SHOW SLAVE STATUS; Slave_IO_State # Master_Host 127.0.0.1 diff --git a/mysql-test/suite/rpl/r/rpl_bug33931.result b/mysql-test/suite/rpl/r/rpl_bug33931.result index ba3c3ebafe6..256238d35cd 100644 --- a/mysql-test/suite/rpl/r/rpl_bug33931.result +++ b/mysql-test/suite/rpl/r/rpl_bug33931.result @@ -1,7 +1,6 @@ reset master; -call mtr.add_suppression("Failed during slave I/O thread initialization"); -stop slave; reset slave; +call mtr.add_suppression("Failed during slave I/O thread initialization"); SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init"; start slave; show slave status; diff --git a/mysql-test/suite/rpl/r/rpl_bug41902.result b/mysql-test/suite/rpl/r/rpl_bug41902.result new file mode 100644 index 00000000000..c65773708cc --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_bug41902.result @@ -0,0 +1,34 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +stop slave; +SET @@debug="d,simulate_find_log_pos_error"; +reset slave; +ERROR HY000: Target log not found in binlog index +show warnings; +Level Code Message +Error 1373 Target log not found in binlog index +Error 1371 Failed purging old relay logs: Failed during log reset +SET @@debug=""; +reset slave; +change master to master_host='dummy'; +SET @@debug="d,simulate_find_log_pos_error"; +change master to master_host='dummy'; +ERROR HY000: Target log not found in binlog index +SET @@debug=""; +reset slave; +change master to master_host='dummy'; +SET @@debug="d,simulate_find_log_pos_error"; +reset master; +ERROR HY000: Target log not found in binlog index +SET @@debug=""; +reset master; +SET @@debug="d,simulate_find_log_pos_error"; +purge binary logs to 'master-bin.000001'; +ERROR HY000: Target log not found in binlog index +SET @@debug=""; +purge binary logs to 'master-bin.000001'; +End of the tests diff --git a/mysql-test/suite/rpl/r/rpl_empty_master_crash.result b/mysql-test/suite/rpl/r/rpl_empty_master_crash.result deleted file mode 100644 index f0d84f85069..00000000000 --- a/mysql-test/suite/rpl/r/rpl_empty_master_crash.result +++ /dev/null @@ -1,11 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -SHOW SLAVE STATUS; -load table t1 from master; -ERROR 08S01: Error connecting to master: Master is not configured -load table t1 from master; -ERROR HY000: Error from master: 'Table 'test.t1' doesn't exist' diff --git a/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result b/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result index 5f2a55b5e35..6b9166834e2 100644 --- a/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result +++ b/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result @@ -4,9 +4,10 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +call mtr.add_suppression("Slave I/O: .* failed with error: Lost connection to MySQL server at 'reading initial communication packet'"); +call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again"); call mtr.add_suppression("Get master clock failed with error: "); call mtr.add_suppression("Get master SERVER_ID failed with error: "); -call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again"); call mtr.add_suppression("Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; .*"); SELECT IS_FREE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP"); IS_FREE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP") diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat.result b/mysql-test/suite/rpl/r/rpl_heartbeat.result index b79545b8336..92ba8549ee4 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat.result @@ -1,8 +1,6 @@ reset master; set @restore_slave_net_timeout= @@global.slave_net_timeout; set @@global.slave_net_timeout= 10; -Warnings: -Warning 1624 The currect value for master_heartbeat_period exceeds the new value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout. change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; show status like 'Slave_heartbeat_period';; Variable_name Slave_heartbeat_period @@ -59,7 +57,7 @@ Slave_IO_State # Master_Host 127.0.0.1 Master_User root Master_Port MASTER_PORT -Connect_Retry 1 +Connect_Retry 60 Master_Log_File master-bin.000001 Read_Master_Log_Pos 280 Relay_Log_File # @@ -100,7 +98,7 @@ Slave_IO_State # Master_Host 127.0.0.1 Master_User root Master_Port MASTER_PORT -Connect_Retry 1 +Connect_Retry 60 Master_Log_File master-bin.000001 Read_Master_Log_Pos 280 Relay_Log_File # diff --git a/mysql-test/suite/rpl/r/rpl_load_from_master.result b/mysql-test/suite/rpl/r/rpl_load_from_master.result deleted file mode 100644 index e1c2ecb35be..00000000000 --- a/mysql-test/suite/rpl/r/rpl_load_from_master.result +++ /dev/null @@ -1,133 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -drop database if exists mysqltest; -drop database if exists mysqltest2; -drop database if exists mysqltest3; -drop database if exists mysqltest; -drop database if exists mysqltest2; -drop database if exists mysqltest3; -create database mysqltest2; -create database mysqltest; -create database mysqltest2; -create table mysqltest2.foo (n int)ENGINE=MyISAM; -insert into mysqltest2.foo values(4); -create table mysqltest2.foo (n int)ENGINE=MyISAM; -insert into mysqltest2.foo values(5); -create table mysqltest.bar (m int)ENGINE=MyISAM; -insert into mysqltest.bar values(15); -select mysqltest2.foo.n,mysqltest.bar.m from mysqltest2.foo,mysqltest.bar; -n m -4 15 -drop database mysqltest; -drop database if exists mysqltest2; -drop database mysqltest; -ERROR HY000: Can't drop database 'mysqltest'; database doesn't exist -drop database mysqltest2; -set sql_log_bin = 0; -create database mysqltest2; -create database mysqltest; -show databases like 'mysql%'; -Database (mysql%) -mysql -mysqltest -mysqltest2 -create table mysqltest2.t1(n int, s char(20))ENGINE=MyISAM; -create table mysqltest2.t2(n int, s text)ENGINE=MyISAM; -insert into mysqltest2.t1 values (1, 'one'), (2, 'two'), (3, 'three'); -insert into mysqltest2.t2 values (11, 'eleven'), (12, 'twelve'), (13, 'thirteen'); -create table mysqltest.t1(n int, s char(20))ENGINE=MyISAM; -create table mysqltest.t2(n int, s text)ENGINE=MyISAM; -insert into mysqltest.t1 values (1, 'one test'), (2, 'two test'), (3, 'three test'); -insert into mysqltest.t2 values (11, 'eleven test'), (12, 'twelve test'), -(13, 'thirteen test'); -set sql_log_bin = 1; -show databases like 'mysql%'; -Database (mysql%) -mysql -create database mysqltest2; -create table mysqltest2.t1(n int, s char(20))ENGINE=MyISAM; -insert into mysqltest2.t1 values (1, 'original foo.t1'); -create table mysqltest2.t3(n int, s char(20))ENGINE=MyISAM; -insert into mysqltest2.t3 values (1, 'original foo.t3'); -create database mysqltest3; -create table mysqltest3.t1(n int, s char(20))ENGINE=MyISAM; -insert into mysqltest3.t1 values (1, 'original foo2.t1'); -create database mysqltest; -create table mysqltest.t1(n int, s char(20))ENGINE=MyISAM; -insert into mysqltest.t1 values (1, 'original bar.t1'); -create table mysqltest.t3(n int, s char(20))ENGINE=MyISAM; -insert into mysqltest.t3 values (1, 'original bar.t3'); -load data from master; -show databases like 'mysql%'; -Database (mysql%) -mysql -mysqltest -mysqltest2 -mysqltest3 -use mysqltest2; -show tables; -Tables_in_mysqltest2 -t1 -t3 -select * from t1; -n s -1 original foo.t1 -use mysqltest3; -show tables; -Tables_in_mysqltest3 -t1 -select * from t1; -n s -1 original foo2.t1 -use mysqltest; -show tables; -Tables_in_mysqltest -t1 -t2 -t3 -select * from mysqltest.t1; -n s -1 one test -2 two test -3 three test -select * from mysqltest.t2; -n s -11 eleven test -12 twelve test -13 thirteen test -select * from mysqltest.t3; -n s -1 original bar.t3 -insert into mysqltest.t1 values (4, 'four test'); -select * from mysqltest.t1; -n s -1 one test -2 two test -3 three test -4 four test -stop slave; -reset slave; -load data from master; -start slave; -insert into mysqltest.t1 values (5, 'five bar'); -select * from mysqltest.t1; -n s -1 one test -2 two test -3 three test -4 four test -5 five bar -load table mysqltest.t1 from master; -ERROR 42S01: Table 't1' already exists -drop table mysqltest.t1; -load table mysqltest.t1 from master; -load table bar.t1 from master; -ERROR HY000: Error from master: 'Table 'bar.t1' doesn't exist' -drop database mysqltest; -drop database mysqltest2; -drop database mysqltest2; -drop database mysqltest3; diff --git a/mysql-test/suite/rpl/r/rpl_load_table_from_master.result b/mysql-test/suite/rpl/r/rpl_load_table_from_master.result deleted file mode 100644 index 9d9a1d7d6cb..00000000000 --- a/mysql-test/suite/rpl/r/rpl_load_table_from_master.result +++ /dev/null @@ -1,51 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -"******************** Test Requirment 1 *************" -SET SQL_LOG_BIN=0,timestamp=200006; -CREATE TABLE t1(t TIMESTAMP NOT NULL,a CHAR(1))ENGINE=MyISAM; -INSERT INTO t1 ( a) VALUE ('F'); -select unix_timestamp(t) from t1; -unix_timestamp(t) -200006 -load table t1 from master; -select unix_timestamp(t) from t1; -unix_timestamp(t) -200006 -set SQL_LOG_BIN=1,timestamp=default; -drop table t1; -set SQL_LOG_BIN=0; -"******************** Test Requirment 2 *************" -CREATE TABLE t1 (a INT NOT NULL) ENGINE=MyISAM MAX_ROWS=4000 CHECKSUM=1; -INSERT INTO t1 VALUES (1); -load table t1 from master; -check table t1; -Table Op Msg_type Msg_text -test.t1 check status OK -drop table t1; -drop table t1; -set SQL_LOG_BIN=0; -create table t1 (word char(20) not null, index(word))ENGINE=MyISAM; -load data infile '../../std_data/words.dat' into table t1; -create table t2 (word char(20) not null)ENGINE=MyISAM; -load data infile '../../std_data/words.dat' into table t2; -create table t3 (word char(20) not null primary key)ENGINE=MyISAM; -load table t1 from master; -load table t2 from master; -load table t3 from master; -check table t1; -Table Op Msg_type Msg_text -test.t1 check status OK -select count(*) from t2; -count(*) -70 -select count(*) from t3; -count(*) -0 -set SQL_LOG_BIN=1; -drop table if exists t1,t2,t3; -create table t1(n int); -drop table t1; diff --git a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result index 08d3241c48f..a353ee73d3f 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result @@ -13,8 +13,8 @@ n 2001 2002 show slave hosts; -Server_id Host Port Rpl_recovery_rank Master_id -2 127.0.0.1 9999 0 1 +Server_id Host Port Master_id +2 127.0.0.1 9999 1 drop table t1; stop slave; create table t2(id int auto_increment primary key, created datetime); diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result index 501749e12f9..028b73e6153 100644 --- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result +++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result @@ -92,7 +92,7 @@ reset slave; SHOW SLAVE STATUS; Slave_IO_State # Master_Host 127.0.0.1 -Master_User root +Master_User test Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File @@ -130,6 +130,7 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 +change master to master_user='root'; start slave; SHOW SLAVE STATUS; Slave_IO_State # diff --git a/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result b/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result new file mode 100644 index 00000000000..9838d8b08a8 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result @@ -0,0 +1,17 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +RESET SLAVE; +CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_PORT,master_user='root'; +START SLAVE IO_THREAD; +SHOW SLAVE HOSTS; +Server_id Host Port Master_id +3 slave2 DEFAULT_PORT 1 +2 SLAVE_PORT 1 +STOP SLAVE IO_THREAD; +SHOW SLAVE HOSTS; +Server_id Host Port Master_id +2 SLAVE_PORT 1 diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result index e2946bb487a..58c0280aafe 100644 --- a/mysql-test/suite/rpl/r/rpl_sp.result +++ b/mysql-test/suite/rpl/r/rpl_sp.result @@ -191,14 +191,9 @@ begin return unix_timestamp(); end| ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) -set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators; set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; -set global log_bin_trust_routine_creators=1; -Warnings: -Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead set global log_bin_trust_function_creators=0; set global log_bin_trust_function_creators=1; -set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators; set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; set global log_bin_trust_function_creators=1; create function fn2() @@ -557,13 +552,7 @@ insert into t values (1); return 0; end master-bin.000001 # Query # # use `mysqltest`; SELECT `mysqltest2`.`f1`() -set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators; -Warnings: -Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; -set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators; -Warnings: -Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; drop database mysqltest; drop database mysqltest2; diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result index d18ca563b7b..94e8a31390d 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result @@ -92,7 +92,7 @@ reset slave; SHOW SLAVE STATUS; Slave_IO_State # Master_Host 127.0.0.1 -Master_User root +Master_User test Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File @@ -130,6 +130,7 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 +change master to master_user='root'; start slave; SHOW SLAVE STATUS; Slave_IO_State # diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index bed019f9c79..485ba229257 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -10,6 +10,5 @@ # ############################################################################## -rpl_get_master_version_and_clock: # Bug#46931 2009-10-17 joro rpl.rpl_get_master_version_and_clock fails rpl_cross_version : BUG#43913 2009-10-22 luis rpl_cross_version fails with symptom in described in bug report rpl_spec_variables : BUG#47661 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux diff --git a/mysql-test/suite/rpl/t/rpl000010.test b/mysql-test/suite/rpl/t/rpl000010.test index 261b9148774..a95cded6496 100644 --- a/mysql-test/suite/rpl/t/rpl000010.test +++ b/mysql-test/suite/rpl/t/rpl000010.test @@ -6,14 +6,10 @@ source include/master-slave.inc; create table t1 (n int not null auto_increment primary key); insert into t1 values(NULL); insert into t1 values(2); -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; select n from t1; connection master; drop table t1; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl000011.test b/mysql-test/suite/rpl/t/rpl000011.test index 32f6227f7c5..baff7c1a1b5 100644 --- a/mysql-test/suite/rpl/t/rpl000011.test +++ b/mysql-test/suite/rpl/t/rpl000011.test @@ -4,7 +4,9 @@ create table t1 (n int); insert into t1 values(1); sync_slave_with_master; stop slave; +--source include/wait_for_slave_to_stop.inc start slave; +--source include/wait_for_slave_to_start.inc connection master; insert into t1 values(2); #let slave catch up diff --git a/mysql-test/suite/rpl/t/rpl000013.test b/mysql-test/suite/rpl/t/rpl000013.test index 69a102e84ce..c5a3285733a 100644 --- a/mysql-test/suite/rpl/t/rpl000013.test +++ b/mysql-test/suite/rpl/t/rpl000013.test @@ -9,9 +9,7 @@ --source include/have_binlog_format_mixed_or_statement.inc source include/master-slave.inc; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; connection master; create table t2(n int); @@ -46,8 +44,6 @@ connection master2; # exist in this connection. drop table if exists t1,t2; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl000017-slave.opt b/mysql-test/suite/rpl/t/rpl000017-slave.opt deleted file mode 100644 index 58a964c90d0..00000000000 --- a/mysql-test/suite/rpl/t/rpl000017-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---skip-slave-start diff --git a/mysql-test/suite/rpl/t/rpl000017-slave.sh b/mysql-test/suite/rpl/t/rpl000017-slave.sh index 1d95798260a..1d95798260a 100755..100644 --- a/mysql-test/suite/rpl/t/rpl000017-slave.sh +++ b/mysql-test/suite/rpl/t/rpl000017-slave.sh diff --git a/mysql-test/suite/rpl/t/rpl000017.test b/mysql-test/suite/rpl/t/rpl000017.test index d6b3e46fa31..a65189657cc 100644 --- a/mysql-test/suite/rpl/t/rpl000017.test +++ b/mysql-test/suite/rpl/t/rpl000017.test @@ -1,12 +1,23 @@ +# The test manually replaces the relay-log.info file with connection +# information which the slave then should pick up. However, to avoid +# overwriting the file, no CHANGE MASTER TO nor RESET SLAVE statements +# should be executed. +# +# Starting replication before granting a replication user privileges +# to replicate will cause the start slave to fail, so we shouldn't do +# that. + +let $no_change_master = 1; +let $skip_slave_start = 1; source include/master-slave.inc; -connection slave; -stop slave; + connection master; grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab'; grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab'; connection slave; start slave; source include/wait_for_slave_to_start.inc; + connection master; --disable_warnings drop table if exists t1; diff --git a/mysql-test/suite/rpl/t/rpl_000015-slave.opt b/mysql-test/suite/rpl/t/rpl_000015-slave.opt index 28bc753dd56..178e9d781f6 100644 --- a/mysql-test/suite/rpl/t/rpl_000015-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_000015-slave.opt @@ -1 +1 @@ ---server-id=22 --master-connect-retry=7 +--server-id=22 diff --git a/mysql-test/suite/rpl/t/rpl_000015.test b/mysql-test/suite/rpl/t/rpl_000015.test index 45a43cd38d0..446c2f06ae5 100644 --- a/mysql-test/suite/rpl/t/rpl_000015.test +++ b/mysql-test/suite/rpl/t/rpl_000015.test @@ -15,14 +15,12 @@ connection slave; reset slave; source include/show_slave_status2.inc; -change master to master_host='127.0.0.1'; -# The following needs to be cleaned up when change master is fixed -source include/show_slave_status2.inc; --replace_result $MASTER_MYPORT MASTER_PORT eval change master to master_host='127.0.0.1',master_user='root', - master_password='',master_port=$MASTER_MYPORT; + master_password='',master_port=$MASTER_MYPORT, MASTER_CONNECT_RETRY=7; source include/show_slave_status2.inc; start slave; +--source include/wait_for_slave_to_start.inc sync_with_master; source include/show_slave_status2.inc; connection master; diff --git a/mysql-test/suite/rpl/t/rpl_alter.test b/mysql-test/suite/rpl/t/rpl_alter.test index 576376a0264..6a6da9c9f24 100644 --- a/mysql-test/suite/rpl/t/rpl_alter.test +++ b/mysql-test/suite/rpl/t/rpl_alter.test @@ -10,15 +10,11 @@ insert into mysqltest.t1 values (1,2); create table mysqltest.t2 (n int); insert into mysqltest.t2 values (45); rename table mysqltest.t2 to mysqltest.t3, mysqltest.t1 to mysqltest.t2; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; select * from mysqltest.t2; select * from mysqltest.t3; connection master; drop database mysqltest; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test b/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test index d4b7872fb2b..8c95e158847 100644 --- a/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test +++ b/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test @@ -51,9 +51,7 @@ CALL simpleproc3(); select * from t1; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; use test1; select * from t1; diff --git a/mysql-test/suite/rpl/t/rpl_bit.test b/mysql-test/suite/rpl/t/rpl_bit.test index 07b0778296c..c648159ff3a 100644 --- a/mysql-test/suite/rpl/t/rpl_bit.test +++ b/mysql-test/suite/rpl/t/rpl_bit.test @@ -78,10 +78,8 @@ SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1; SELECT hex(bit1) FROM test.t1 ORDER BY bit1; SELECT hex(bit2) from test.t1 ORDER BY bit2; SELECT hex(bit3) from test.t1 ORDER BY bit3; -save_master_pos; +sync_slave_with_master; -connection slave; -sync_with_master; SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1; SELECT hex(bit1) FROM test.t1 ORDER BY bit1; SELECT hex(bit2) from test.t1 ORDER BY bit2; diff --git a/mysql-test/suite/rpl/t/rpl_bit_npk.test b/mysql-test/suite/rpl/t/rpl_bit_npk.test index 12b587919f9..1df7341eafc 100644 --- a/mysql-test/suite/rpl/t/rpl_bit_npk.test +++ b/mysql-test/suite/rpl/t/rpl_bit_npk.test @@ -76,10 +76,8 @@ SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 SELECT hex(bit1) from test.t1 ORDER BY bit1; SELECT hex(bit2) from test.t1 ORDER BY bit2; SELECT hex(bit3) from test.t1 ORDER BY bit3; -save_master_pos; +sync_slave_with_master; -connection slave; -sync_with_master; SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1 ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034; @@ -100,10 +98,8 @@ UPDATE test.t3 SET a = 2 WHERE b = 0; SELECT a, hex(b) FROM test.t2 ORDER BY a,b; SELECT * FROM test.t3 ORDER BY a,b; -save_master_pos; +sync_slave_with_master; -connection slave; -sync_with_master; SELECT a, hex(b) FROM test.t2 ORDER BY a,b; SELECT * FROM test.t3 ORDER BY a,b; diff --git a/mysql-test/suite/rpl/t/rpl_bug33931.test b/mysql-test/suite/rpl/t/rpl_bug33931.test index 1316ddb7401..42d86a7fc1e 100644 --- a/mysql-test/suite/rpl/t/rpl_bug33931.test +++ b/mysql-test/suite/rpl/t/rpl_bug33931.test @@ -8,23 +8,25 @@ source include/have_log_bin.inc; connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,); connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,); - connection master; reset master; connection slave; +reset slave; # Add suppression for expected warnings in slaves error log call mtr.add_suppression("Failed during slave I/O thread initialization"); ---disable_warnings -stop slave; ---enable_warnings -reset slave; - # Set debug flags on slave to force errors to occur SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init"; +--disable_query_log +eval CHANGE MASTER TO MASTER_USER='root', + MASTER_CONNECT_RETRY=1, + MASTER_HOST='127.0.0.1', + MASTER_PORT=$MASTER_MYPORT; +--enable_query_log + start slave; connection master; diff --git a/mysql-test/suite/rpl/t/rpl_bug41902-slave.opt b/mysql-test/suite/rpl/t/rpl_bug41902-slave.opt new file mode 100644 index 00000000000..37fc56036fb --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_bug41902-slave.opt @@ -0,0 +1 @@ +--loose-debug=-d,simulate_find_log_pos_error diff --git a/mysql-test/suite/rpl/t/rpl_bug41902.test b/mysql-test/suite/rpl/t/rpl_bug41902.test new file mode 100644 index 00000000000..05f13bbc848 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_bug41902.test @@ -0,0 +1,61 @@ +# Test for Bug #41902 MYSQL_BIN_LOG::reset_logs() doesn't call my_error() +# in face of an error +# + +source include/have_debug.inc; +source include/master-slave.inc; + +# +# test checks that +# a. there is no crash when find_log_pos() returns with an error +# that tests expect to receive; +# b. in the case of multiple error messages the first error message is +# reported to the user and others are available as warnings. +# + +connection slave; +stop slave; + +SET @@debug="d,simulate_find_log_pos_error"; + +--error ER_UNKNOWN_TARGET_BINLOG +reset slave; +show warnings; + +SET @@debug=""; +reset slave; +change master to master_host='dummy'; + +SET @@debug="d,simulate_find_log_pos_error"; + +--error ER_UNKNOWN_TARGET_BINLOG +change master to master_host='dummy'; + +SET @@debug=""; +reset slave; +change master to master_host='dummy'; + +connection master; +SET @@debug="d,simulate_find_log_pos_error"; +--error ER_UNKNOWN_TARGET_BINLOG +reset master; + +SET @@debug=""; +reset master; + +SET @@debug="d,simulate_find_log_pos_error"; +--error ER_UNKNOWN_TARGET_BINLOG +purge binary logs to 'master-bin.000001'; + +SET @@debug=""; +purge binary logs to 'master-bin.000001'; + +--disable_query_log +call mtr.add_suppression("Failed to locate old binlog or relay log files"); +call mtr.add_suppression("MYSQL_LOG::purge_logs was called with file ./master-bin.000001 not listed in the index"); +connection slave; +call mtr.add_suppression("Failed to locate old binlog or relay log files"); +call mtr.add_suppression("MYSQL_LOG::purge_logs was called with file ./master-bin.000001 not listed in the index"); +--enable_query_log + +--echo End of the tests diff --git a/mysql-test/suite/rpl/t/rpl_change_master.test b/mysql-test/suite/rpl/t/rpl_change_master.test index c1ef417ea78..997cca42e82 100644 --- a/mysql-test/suite/rpl/t/rpl_change_master.test +++ b/mysql-test/suite/rpl/t/rpl_change_master.test @@ -28,9 +28,7 @@ sync_with_master; select * from t1; connection master; drop table t1; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test index a49253f90c1..37420b13805 100644 --- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test +++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test @@ -7,6 +7,9 @@ ############################################################# --source include/have_innodb.inc +# Use wait_for_slave_to_(start|stop) for current connections +let $keep_connection= 1; + # Set up circular ring and new names for servers --echo *** Set up circular ring by schema A->B->C->D->A *** --source include/circular_rpl_for_4_hosts_init.inc diff --git a/mysql-test/suite/rpl/t/rpl_colSize.test b/mysql-test/suite/rpl/t/rpl_colSize.test index c20f2c3fd35..07fd8041b18 100644 --- a/mysql-test/suite/rpl/t/rpl_colSize.test +++ b/mysql-test/suite/rpl/t/rpl_colSize.test @@ -16,6 +16,7 @@ DROP TABLE IF EXISTS t1; --echo *** Create "wider" table on slave *** sync_slave_with_master; STOP SLAVE; +--source include/wait_for_slave_to_stop.inc RESET SLAVE; eval CREATE TABLE t1 ( @@ -69,6 +70,7 @@ RESET MASTER; --echo *** Start replication *** connection slave; START SLAVE; +--source include/wait_for_slave_to_start.inc --echo *** Insert data on master and display it. *** connection master; diff --git a/mysql-test/suite/rpl/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test index a13adf28b95..1cd36d35931 100644 --- a/mysql-test/suite/rpl/t/rpl_do_grant.test +++ b/mysql-test/suite/rpl/t/rpl_do_grant.test @@ -8,9 +8,7 @@ connection master; delete from mysql.user where user=_binary'rpl_do_grant'; delete from mysql.db where user=_binary'rpl_do_grant'; flush privileges; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; # if these DELETE did nothing on the master, we need to do them manually on the # slave. delete from mysql.user where user=_binary'rpl_ignore_grant'; @@ -21,17 +19,13 @@ flush privileges; connection master; grant select on *.* to rpl_do_grant@localhost; grant drop on test.* to rpl_do_grant@localhost; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; show grants for rpl_do_grant@localhost; # test replication of SET PASSWORD connection master; set password for rpl_do_grant@localhost=password("does it work?"); -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant'; # @@ -44,9 +38,7 @@ select password<>'' from mysql.user where user='rpl_do_grant'; set sql_mode='ANSI_QUOTES'; set password for rpl_do_grant@localhost=password('does it work?'); set sql_mode=''; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; select password<>'' from mysql.user where user='rpl_do_grant'; diff --git a/mysql-test/suite/rpl/t/rpl_drop.test b/mysql-test/suite/rpl/t/rpl_drop.test index b38007a755f..6f586d90de3 100644 --- a/mysql-test/suite/rpl/t/rpl_drop.test +++ b/mysql-test/suite/rpl/t/rpl_drop.test @@ -7,10 +7,6 @@ drop table if exists t1, t2; create table t1 (a int); --error 1051 drop table t1, t2; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; # End of 4.1 tests - - diff --git a/mysql-test/suite/rpl/t/rpl_drop_view.test b/mysql-test/suite/rpl/t/rpl_drop_view.test index 11633a0a7e8..05bf112b8b8 100644 --- a/mysql-test/suite/rpl/t/rpl_drop_view.test +++ b/mysql-test/suite/rpl/t/rpl_drop_view.test @@ -20,9 +20,7 @@ drop view v1, not_exist_view; --error 1146 select * from v1; drop view v2, v3; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; --error 1146 select * from v1; --error 1146 diff --git a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test index 9efb3d16d2b..b2530e83b89 100644 --- a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test +++ b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test @@ -22,6 +22,7 @@ connection master; eval change master to master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root"; start slave; +--source include/wait_for_slave_to_start.inc # now we test it @@ -38,12 +39,11 @@ sync_with_master; # log-slave-updates and circul repl # stop slave; +--source include/wait_for_slave_to_stop.inc create table t2 (n int); # create one ignored event -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; connection slave; @@ -85,6 +85,7 @@ start slave until master_log_file="slave-bin.000001",master_log_pos=663; select * from t3; start slave; +--source include/wait_for_slave_to_start.inc # BUG#13023 is that Exec_master_log_pos may stay too low "forever": @@ -94,9 +95,7 @@ create table t4 (n int); # create 3 ignored events create table t5 (n int); create table t6 (n int); -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; connection slave; @@ -114,11 +113,10 @@ show tables; # cleanup stop slave; +--source include/wait_for_slave_to_stop.inc reset slave; drop table t1,t2,t3,t4,t5,t6; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_empty_master_crash-master.opt b/mysql-test/suite/rpl/t/rpl_empty_master_crash-master.opt deleted file mode 100644 index cef79bc8585..00000000000 --- a/mysql-test/suite/rpl/t/rpl_empty_master_crash-master.opt +++ /dev/null @@ -1 +0,0 @@ ---force-restart diff --git a/mysql-test/suite/rpl/t/rpl_empty_master_crash.test b/mysql-test/suite/rpl/t/rpl_empty_master_crash.test deleted file mode 100644 index f8e7870ae3c..00000000000 --- a/mysql-test/suite/rpl/t/rpl_empty_master_crash.test +++ /dev/null @@ -1,14 +0,0 @@ -source include/master-slave.inc; - -source include/show_slave_status.inc; - -# -# Load table should not succeed on the master as this is not a slave -# ---error 1218 -load table t1 from master; -connection slave; ---error 1188 -load table t1 from master; - -# End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test index e77cd308f39..a955de02c0f 100644 --- a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test +++ b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test @@ -14,19 +14,15 @@ create table t4 (a int primary key); --error 1022, ER_DUP_ENTRY insert into t1 values (1),(1); insert into t4 values (1),(2); -save_master_pos; -connection slave; # as the t1 table is ignored on the slave, the slave should be able to sync -sync_with_master; +sync_slave_with_master; # check that the table has been ignored, because otherwise the test is nonsense show tables like 't1'; show tables like 't4'; SELECT * FROM test.t4 ORDER BY a; connection master; drop table t1; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; # Now test that even critical errors (connection killed) # are ignored if rules allow it. @@ -53,15 +49,11 @@ connection master; --error 0,1317,2013 reap; connection master1; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SELECT * FROM test.t4 ORDER BY a; connection master1; DROP TABLE test.t4; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; # End of 4.1 tests # Adding comment for force manual merge 5.0 -> wl1012. delete me if needed diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh index a321dd690cd..a321dd690cd 100755..100644 --- a/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh +++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh index e46ea6d400b..e46ea6d400b 100755..100644 --- a/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh +++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test index a8befe612c2..a873c1fa3a9 100644 --- a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test +++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test @@ -1,6 +1,8 @@ # Testing if "flush logs" command bouncing resulting in logs created in a loop # in case of bi-directional replication -- source include/master-slave.inc +# Use wait_for_slave_to_(start|stop) for current connections +let $keep_connection= 1; let $MYSQLD_DATADIR= `select @@datadir`; --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR/ @@ -9,18 +11,20 @@ show variables like 'relay_log%'; connection slave; --disable_warnings stop slave; +--source include/wait_for_slave_to_stop.inc --enable_warnings --replace_result $MASTER_MYPORT MASTER_PORT eval change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=$MASTER_MYPORT; start slave; - +--source include/wait_for_slave_to_start.inc # # Start replication slave -> master # connection master; --disable_warnings stop slave; +--source include/wait_for_slave_to_stop.inc --enable_warnings --replace_result $SLAVE_MYPORT SLAVE_PORT eval change master to master_host='127.0.0.1',master_user='root', 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 b300603f454..60bccaad0d3 100644 --- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test +++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test @@ -34,12 +34,14 @@ SELECT * FROM t1; # restart replication for the next testcase stop slave; +--source include/wait_for_slave_to_stop.inc reset slave; connection master; reset master; drop table t1; connection slave; start slave; +--source include/wait_for_slave_to_start.inc # testcase with INSERT SELECT connection master; diff --git a/mysql-test/suite/rpl/t/rpl_load_from_master.test b/mysql-test/suite/rpl/t/rpl_load_from_master.test deleted file mode 100644 index 0f085457817..00000000000 --- a/mysql-test/suite/rpl/t/rpl_load_from_master.test +++ /dev/null @@ -1,181 +0,0 @@ -# This one assumes we are ignoring updates on tables in database mysqltest2, -# but doing the ones in database mysqltest -################################################################# -# Change Author: JBM -# Change Date: 2006-02-02 -# Change: Added ENGINE=MyISAM -# Reason: LOAD from master is only supported by MyISAM -################################################################# - -source include/master-slave.inc; ---disable_warnings -drop database if exists mysqltest; -drop database if exists mysqltest2; -drop database if exists mysqltest3; -connection slave; -drop database if exists mysqltest; -drop database if exists mysqltest2; -drop database if exists mysqltest3; -connection master; -create database mysqltest2; -create database mysqltest; ---enable_warnings - -save_master_pos; -connection slave; -sync_with_master; -create database mysqltest2; -create table mysqltest2.foo (n int)ENGINE=MyISAM; -insert into mysqltest2.foo values(4); -connection master; -create table mysqltest2.foo (n int)ENGINE=MyISAM; -insert into mysqltest2.foo values(5); -create table mysqltest.bar (m int)ENGINE=MyISAM; -insert into mysqltest.bar values(15); -save_master_pos; -connection slave; -sync_with_master; -select mysqltest2.foo.n,mysqltest.bar.m from mysqltest2.foo,mysqltest.bar; -connection master; -drop database mysqltest; -drop database if exists mysqltest2; -save_master_pos; -connection slave; -sync_with_master; ---error 1008 -drop database mysqltest; -drop database mysqltest2; - -# Now let's test load data from master - -# First create some databases and tables on the master - -connection master; -set sql_log_bin = 0; -create database mysqltest2; -create database mysqltest; -show databases like 'mysql%'; -create table mysqltest2.t1(n int, s char(20))ENGINE=MyISAM; -create table mysqltest2.t2(n int, s text)ENGINE=MyISAM; -insert into mysqltest2.t1 values (1, 'one'), (2, 'two'), (3, 'three'); -insert into mysqltest2.t2 values (11, 'eleven'), (12, 'twelve'), (13, 'thirteen'); - -create table mysqltest.t1(n int, s char(20))ENGINE=MyISAM; -create table mysqltest.t2(n int, s text)ENGINE=MyISAM; -insert into mysqltest.t1 values (1, 'one test'), (2, 'two test'), (3, 'three test'); -insert into mysqltest.t2 values (11, 'eleven test'), (12, 'twelve test'), - (13, 'thirteen test'); -set sql_log_bin = 1; -save_master_pos; -connection slave; -sync_with_master; - -# This should show that the slave is empty at this point -show databases like 'mysql%'; -# Create mysqltest2 and mysqltest3 on slave; we expect that LOAD DATA FROM -# MASTER will neither touch database mysqltest nor mysqltest3 -create database mysqltest2; -create table mysqltest2.t1(n int, s char(20))ENGINE=MyISAM; -insert into mysqltest2.t1 values (1, 'original foo.t1'); -create table mysqltest2.t3(n int, s char(20))ENGINE=MyISAM; -insert into mysqltest2.t3 values (1, 'original foo.t3'); -create database mysqltest3; -create table mysqltest3.t1(n int, s char(20))ENGINE=MyISAM; -insert into mysqltest3.t1 values (1, 'original foo2.t1'); - -# Create mysqltest, and mysqltest.t1, to check that it gets replaced, -# and mysqltest.t3 to check that it is not touched (there is no -# mysqltest.t3 on master) -create database mysqltest; -create table mysqltest.t1(n int, s char(20))ENGINE=MyISAM; -insert into mysqltest.t1 values (1, 'original bar.t1'); -create table mysqltest.t3(n int, s char(20))ENGINE=MyISAM; -insert into mysqltest.t3 values (1, 'original bar.t3'); - -load data from master; - -# Now let's check if we have the right tables and the right data in them -show databases like 'mysql%'; -use mysqltest2; - -# LOAD DATA FROM MASTER uses only replicate_*_db rules to decide which -# databases have to be copied. So it thinks "mysqltest" has to be -# copied. Before 4.0.16 it would first drop "mysqltest", then create -# "mysqltest". This "drop" is a bug; in that case t3 would disappear. So -# here the effect of this bug (BUG#1248) would be to leave an empty -# "mysqltest" on the slave. - -show tables; # should be t1 & t3 -select * from t1; # should be slave's original -use mysqltest3; -show tables; # should be t1 -select * from t1; # should be slave's original -use mysqltest; -show tables; # should contain master's copied t1&t2, slave's original t3 -select * from mysqltest.t1; -select * from mysqltest.t2; -select * from mysqltest.t3; - -# Now let's see if replication works -connection master; -insert into mysqltest.t1 values (4, 'four test'); -save_master_pos; -connection slave; -sync_with_master; -select * from mysqltest.t1; - -# Check that LOAD DATA FROM MASTER is able to create master.info -# if needed (if RESET SLAVE was used before), before writing to it (BUG#2922). - -stop slave; -reset slave; -load data from master; -start slave; -# see if replication coordinates were restored fine -connection master; -insert into mysqltest.t1 values (5, 'five bar'); -save_master_pos; -connection slave; -sync_with_master; -select * from mysqltest.t1; - -# Check that LOAD DATA FROM MASTER reports the error if it can't drop a -# table to be overwritten. -# DISABLED FOR NOW AS chmod IS NOT PORTABLE ON NON-UNIX -# insert into mysqltest.t1 values(10, 'should be there'); -# flush tables; -let $MYSQLD_SLAVE_DATADIR= `select @@datadir`; -# system chmod 500 $MYSQLD_SLAVE_DATADIR/mysqltest/; -# --error 6 -# load data from master; # should fail (errno 13) -# system chmod 700 $MYSQLD_SLAVE_DATADIR/mysqltest/; -# select * from mysqltest.t1; # should contain the row (10, ...) - - -# Check that LOAD TABLE FROM MASTER fails if the table exists on slave ---error 1050 -load table mysqltest.t1 from master; -drop table mysqltest.t1; -load table mysqltest.t1 from master; - -# Check what happens when requestion not existing table -# ---error 1188 -load table bar.t1 from master; - -# as LOAD DATA FROM MASTER failed it did not restart slave threads -# DISABLED FOR NOW -# start slave; - -# Now time for cleanup -connection master; -drop database mysqltest; -drop database mysqltest2; -save_master_pos; -connection slave; -sync_with_master; -# These have to be dropped on slave because they are not replicated -drop database mysqltest2; -drop database mysqltest3; - -# End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_load_table_from_master.test b/mysql-test/suite/rpl/t/rpl_load_table_from_master.test deleted file mode 100644 index aad113878d3..00000000000 --- a/mysql-test/suite/rpl/t/rpl_load_table_from_master.test +++ /dev/null @@ -1,98 +0,0 @@ -########################################################### -# Change Author: JBM -# Change Date: 2006-2-2 -# Change: Added ENGINE=$engine_type for first create table -# Reason: Only MyISAM supports load from master no need to -# run test case for other engines, in addition test will -# fail if other engines are set as default engine -########################################################### -# Change Author: JBM -# Change Date: 2006-2-3 -# Change: removed ENGINE=$engine_type for first create table -# and renamed test file to rpl_load_table_from_master.test. -# In addition added test requirements. -# Reason: Request from review. -############################################################ -# REQUIREMENT TEST 1: -# LOAD TABLE FROM MASTER must work with a forced timestamp. -############################################################ -# -# Test forced timestamp -# --- source include/master-slave.inc - --- echo "******************** Test Requirment 1 *************" - -# Don't log table creating to the slave as we want to test LOAD TABLE -SET SQL_LOG_BIN=0,timestamp=200006; -eval CREATE TABLE t1(t TIMESTAMP NOT NULL,a CHAR(1))ENGINE=MyISAM; -INSERT INTO t1 ( a) VALUE ('F'); -select unix_timestamp(t) from t1; -connection slave; -load table t1 from master; -select unix_timestamp(t) from t1; - -# Delete the created table on master and slave -connection master; -set SQL_LOG_BIN=1,timestamp=default; -drop table t1; -save_master_pos; -connection slave; -sync_with_master; -connection master; - -# -# Test copying table with checksum -# - -# Don't log table creating to the slave as we want to test LOAD TABLE -set SQL_LOG_BIN=0; - -####################################################### -# REQUIREMENTi TEST 2: -#LOAD TABLE FROM MASTER must work with table checksum -####################################################### --- echo "******************** Test Requirment 2 *************" - -eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=MyISAM MAX_ROWS=4000 CHECKSUM=1; -INSERT INTO t1 VALUES (1); -save_master_pos; -connection slave; -sync_with_master; -load table t1 from master; -check table t1; -drop table t1; -connection master; -drop table t1; -save_master_pos; -connection slave; -sync_with_master; - -connection master; -set SQL_LOG_BIN=0; -create table t1 (word char(20) not null, index(word))ENGINE=MyISAM; -load data infile '../../std_data/words.dat' into table t1; -create table t2 (word char(20) not null)ENGINE=MyISAM; -load data infile '../../std_data/words.dat' into table t2; -create table t3 (word char(20) not null primary key)ENGINE=MyISAM; -connection slave; -load table t1 from master; -load table t2 from master; -load table t3 from master; -check table t1; -select count(*) from t2; -select count(*) from t3; -connection master; -set SQL_LOG_BIN=1; -drop table if exists t1,t2,t3; -save_master_pos; -connection slave; -sync_with_master; -create table t1(n int); -drop table t1; - - - - - -# End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_charset.test b/mysql-test/suite/rpl/t/rpl_loaddata_charset.test index 031a0f6c351..3e1bc917a41 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_charset.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_charset.test @@ -23,9 +23,7 @@ load data infile '../../std_data/loaddata6.dat' into table t1 character set koi8 select hex(a) from t1; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; select hex(a) from t1; connection master; diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test index b7d9995c834..979f09f64e6 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test @@ -16,7 +16,7 @@ connection master; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1; connection slave; -wait_for_slave_to_stop; +--source include/wait_for_slave_sql_to_stop.inc source include/show_slave_status.inc; connection slave; diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_m.test b/mysql-test/suite/rpl/t/rpl_loaddata_m.test index 42c3ad99f33..48451c4aee1 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_m.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_m.test @@ -28,9 +28,7 @@ LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE mysqltest.t1; SELECT COUNT(*) FROM mysqltest.t1; # Now lets check the slave to see what we have :-) -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SHOW DATABASES; diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_s.test b/mysql-test/suite/rpl/t/rpl_loaddata_s.test index 2dd2218eb5c..91ebcf058a6 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_s.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_s.test @@ -16,9 +16,7 @@ load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; # Test logging on slave; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; select count(*) from test.t1; # check that LOAD was replicated source include/show_binlog_events.inc; diff --git a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test index a93a82d6d9f..ed556f3aedf 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test +++ b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test @@ -27,15 +27,11 @@ truncate table t1; --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1; --remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; select a,count(*) from t1 group by a; connection master; drop table t1; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test index 2f7b18ae04b..ea107a28954 100644 --- a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test +++ b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test @@ -1,9 +1,7 @@ # See if master_pos_wait(,,timeout) # Terminates with "timeout expired" (-1) source include/master-slave.inc; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; # Ask for a master log that has certainly not been reached yet # timeout= 2 seconds select master_pos_wait('master-bin.999999',0,2); diff --git a/mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh b/mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh index 8ce79797822..8ce79797822 100755..100644 --- a/mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh +++ b/mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh diff --git a/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test b/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test index 6a1f81abed3..85335d47c3a 100644 --- a/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test +++ b/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test @@ -18,6 +18,7 @@ show slave hosts; drop table t1; sync_slave_with_master; stop slave; +--source include/wait_for_slave_to_stop.inc connection master; # Test replication of timestamp @@ -35,6 +36,7 @@ create table t5 select * from t4; save_master_pos; connection slave; start slave; +--source include/wait_for_slave_to_start.inc sync_with_master; select * from t2; show create table t3; diff --git a/mysql-test/suite/rpl/t/rpl_multi_delete.test b/mysql-test/suite/rpl/t/rpl_multi_delete.test index a251cbf8833..568a8a578a9 100644 --- a/mysql-test/suite/rpl/t/rpl_multi_delete.test +++ b/mysql-test/suite/rpl/t/rpl_multi_delete.test @@ -19,8 +19,6 @@ select * from t2; connection master; drop table t1,t2; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_multi_delete2.test b/mysql-test/suite/rpl/t/rpl_multi_delete2.test index e91fad1872a..c3f939276e0 100644 --- a/mysql-test/suite/rpl/t/rpl_multi_delete2.test +++ b/mysql-test/suite/rpl/t/rpl_multi_delete2.test @@ -27,11 +27,9 @@ SELECT * FROM a; insert into a values(2),(3); delete alias FROM a alias where alias.i=2; select * from a; -save_master_pos; -connection slave; +sync_slave_with_master; use mysqltest_to; -sync_with_master; select * from a; # BUG#3461 diff --git a/mysql-test/suite/rpl/t/rpl_optimize.test b/mysql-test/suite/rpl/t/rpl_optimize.test index f4582ba1167..3c677a95463 100644 --- a/mysql-test/suite/rpl/t/rpl_optimize.test +++ b/mysql-test/suite/rpl/t/rpl_optimize.test @@ -47,8 +47,7 @@ sync_with_master; # won't work if slave SQL thread stopped connection master; # cleanup drop table t1; -connection slave; -sync_with_master; +sync_slave_with_master; # If the machine is so fast that slave syncs before OPTIMIZE # starts, this test wil demonstrate nothing but will pass. diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test index bfc144c759b..61a1ad9d987 100644 --- a/mysql-test/suite/rpl/t/rpl_packet.test +++ b/mysql-test/suite/rpl/t/rpl_packet.test @@ -38,20 +38,15 @@ select @@net_buffer_length, @@max_allowed_packet; create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM; INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023'); -save_master_pos; +sync_slave_with_master; -connection slave; -sync_with_master; eval select count(*) from `$db`.`t1` /* must be 1 */; SHOW STATUS LIKE 'Slave_running'; select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING'; connection master; eval drop database $db; -save_master_pos; - -connection slave; -sync_with_master; +sync_slave_with_master; # # Bug #23755: Replicated event larger that max_allowed_packet infinitely re-transmits diff --git a/mysql-test/suite/rpl/t/rpl_ps.test b/mysql-test/suite/rpl/t/rpl_ps.test index b00dec6b80c..143f75e5477 100644 --- a/mysql-test/suite/rpl/t/rpl_ps.test +++ b/mysql-test/suite/rpl/t/rpl_ps.test @@ -6,9 +6,7 @@ ########################################################### source include/master-slave.inc; -#save_master_pos; -#connection slave; -#sync_with_master; +#sync_slave_with_master; #reset master; #connection master; @@ -30,20 +28,16 @@ prepare stmt2 from @var2; set @var1='from-master-3'; execute stmt2 using @var1; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SELECT * FROM t1 ORDER BY n; connection master; drop table t1; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; stop slave; - +source include/wait_for_slave_to_stop.inc; # End of 4.1 tests # @@ -102,13 +96,12 @@ use mysqltest1; EXECUTE stmt_d_1; --echo ---save_master_pos +--sync_slave_with_master + --echo --echo # Connection: slave --echo ---connection slave ---sync_with_master --echo SELECT * FROM t1; @@ -125,13 +118,12 @@ DROP DATABASE mysqltest1; use test; DROP TABLE t1; --echo ---save_master_pos +--sync_slave_with_master + --echo --echo # Connection: slave --echo ---connection slave ---sync_with_master --echo STOP SLAVE; diff --git a/mysql-test/suite/rpl/t/rpl_relayspace.test b/mysql-test/suite/rpl/t/rpl_relayspace.test index 0fc564cdb46..45b46674c05 100644 --- a/mysql-test/suite/rpl/t/rpl_relayspace.test +++ b/mysql-test/suite/rpl/t/rpl_relayspace.test @@ -4,6 +4,7 @@ source include/master-slave.inc; connection slave; stop slave; +--source include/wait_for_slave_to_stop.inc connection master; # This will generate a master's binlog > 10 bytes create table t1 (a int); diff --git a/mysql-test/suite/rpl/t/rpl_replicate_do.test b/mysql-test/suite/rpl/t/rpl_replicate_do.test index fea168ee9f1..3e22984aef8 100644 --- a/mysql-test/suite/rpl/t/rpl_replicate_do.test +++ b/mysql-test/suite/rpl/t/rpl_replicate_do.test @@ -18,18 +18,14 @@ insert into t1 values(15),(16),(17); update t1 set m=20 where m=16; delete from t1 where m=17; create table t11 select * from t1; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; select * from t1 ORDER BY m; select * from t2; --error 1146 select * from t11; connection master; drop table if exists t1,t2,t11; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; # show slave status, just to see of it prints replicate-do-table --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh b/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh index 81490a54b4b..81490a54b4b 100755..100644 --- a/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh +++ b/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test index e06099fd707..2490471018b 100644 --- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test +++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test @@ -56,6 +56,7 @@ connection master; reset master; connection slave; start slave; +--source include/wait_for_slave_to_start.inc connection master; # @@ -100,6 +101,7 @@ connection slave; #restart slave skipping one event set global sql_slave_skip_counter=1; start slave; +--source include/wait_for_slave_to_start.inc connection master; @@ -161,9 +163,7 @@ select count(*) from t3 where n >= 4; create table t4 select * from temp_table; source include/show_binary_logs.inc; source include/show_master_status.inc; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; select * from t4; source include/show_slave_status2.inc; diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test index 0d91d855a57..33457d759b8 100644 --- a/mysql-test/suite/rpl/t/rpl_row_create_table.test +++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test @@ -25,8 +25,10 @@ sync_slave_with_master; --disable_query_log set @storage_engine = @@global.storage_engine; STOP SLAVE; +--source include/wait_for_slave_to_stop.inc SET GLOBAL storage_engine=memory; START SLAVE; +--source include/wait_for_slave_to_start.inc --enable_query_log --source include/reset_master_and_slave.inc @@ -129,8 +131,10 @@ DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9; sync_slave_with_master; # Here we reset the value of the default storage engine STOP SLAVE; +--source include/wait_for_slave_to_stop.inc SET GLOBAL storage_engine=@storage_engine; START SLAVE; +--source include/wait_for_slave_to_start.inc --enable_ps_protocol # BUG#22864 (Rollback following CREATE ... SELECT discards 'CREATE @@ -138,11 +142,13 @@ START SLAVE; --echo ================ BUG#22864 ================ connection slave; STOP SLAVE; +--source include/wait_for_slave_to_stop.inc RESET SLAVE; connection master; RESET MASTER; connection slave; START SLAVE; +--source include/wait_for_slave_to_start.inc connection master; SET AUTOCOMMIT=0; CREATE TABLE t1 (a INT); @@ -190,6 +196,7 @@ sync_slave_with_master; # Some tests with temporary tables connection slave; STOP SLAVE; +--source include/wait_for_slave_to_stop.inc RESET SLAVE; connection master; @@ -197,6 +204,7 @@ RESET MASTER; connection slave; START SLAVE; +--source include/wait_for_slave_to_start.inc connection master; CREATE TABLE t1 (a INT); diff --git a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test index a7967f6643a..9a645baead0 100644 --- a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test +++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test @@ -116,16 +116,14 @@ sync_slave_with_master; #(the server was started with skip-slave-start) --disable_warnings stop slave; +--source include/wait_for_slave_to_stop.inc --enable_warnings ---require r/slave-stopped.result -show status like 'Slave_running'; connection master; reset master; connection slave; reset slave; start slave; ---require r/slave-running.result -show status like 'Slave_running'; +--source include/wait_for_slave_to_start.inc connection master; # We should be clean at this point, now we will run in the file from above. @@ -164,7 +162,7 @@ remove_file $MYSQLTEST_VARDIR/tmp/master.sql; # this test for position option -# By setting this position to 417, we should only get the create of t3 +# By setting this position to 416, we should only get the create of t3 --disable_query_log select "--- Test 2 position test --" as ""; --enable_query_log @@ -181,9 +179,7 @@ select "--- Test 3 First Remote test --" as ""; # This is broken now --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --stop-position=570 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 - -# This part is disabled due to bug #17654 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --stop-position=569 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- Test 4 Second Remote test --" as ""; @@ -206,16 +202,14 @@ sync_slave_with_master; --disable_warnings stop slave; +--source include/wait_for_slave_to_stop.inc --enable_warnings ---require r/slave-stopped.result -show status like 'Slave_running'; connection master; reset master; connection slave; reset slave; start slave; ---require r/slave-running.result -show status like 'Slave_running'; +--source include/wait_for_slave_to_start.inc connection master; # We should be clean at this point, now we will run in the file from above. @@ -272,8 +266,8 @@ let $MYSQLD_DATADIR= `select @@datadir;`; select "--- Test 7 reading stdin w/position --" as ""; --enable_query_log --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR ---exec $MYSQL_BINLOG --short-form --position=417 --stop-position=569 - < $MYSQLD_DATADIR/master-bin.000001 - +--exec $MYSQL_BINLOG --short-form --position=417 --stop-position=570 - < $MYSQLD_DATADIR/master-bin.000001 + # Bug#16217 (mysql client did not know how not switch its internal charset) --disable_query_log select "--- Test 8 switch internal charset --" as ""; @@ -285,16 +279,14 @@ sync_slave_with_master; --disable_warnings stop slave; +--source include/wait_for_slave_to_stop.inc --enable_warnings ---require r/slave-stopped.result -show status like 'Slave_running'; connection master; reset master; connection slave; reset slave; start slave; ---require r/slave-running.result -show status like 'Slave_running'; +--source include/wait_for_slave_to_start.inc connection master; create table t4 (f text character set utf8); diff --git a/mysql-test/suite/rpl/t/rpl_row_sp001.test b/mysql-test/suite/rpl/t/rpl_row_sp001.test index 1595c4a21d5..34d42d985f9 100644 --- a/mysql-test/suite/rpl/t/rpl_row_sp001.test +++ b/mysql-test/suite/rpl/t/rpl_row_sp001.test @@ -90,9 +90,7 @@ delimiter ;// INSERT INTO test.t2 VALUES(NULL,'NEW'),(NULL,'NEW'),(NULL,'NEW'),(NULL,'NEW'); SELECT * FROM t2 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SELECT * FROM t2 ORDER BY a; connection master; @@ -105,17 +103,13 @@ SELECT * FROM t2 ORDER BY a; connection master; call test.p2(2); SELECT * FROM t2 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SELECT * FROM t2 ORDER BY a; connection master; call test.p2(3); SELECT * FROM t2 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SELECT * FROM t2 ORDER BY a; ##Used for debugging diff --git a/mysql-test/suite/rpl/t/rpl_row_sp005.test b/mysql-test/suite/rpl/t/rpl_row_sp005.test index f5a74325b7c..abc7fb4f490 100644 --- a/mysql-test/suite/rpl/t/rpl_row_sp005.test +++ b/mysql-test/suite/rpl/t/rpl_row_sp005.test @@ -74,9 +74,7 @@ SELECT * FROM test.t2 ORDER BY id2; let $message=< ---- Slave selects-- >; --source include/show_msg.inc -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SELECT * FROM test.t1 ORDER BY id; SELECT * FROM test.t2 ORDER BY id2; @@ -92,8 +90,7 @@ SELECT * FROM test.t3 ORDER BY id3; let $message=< ---- Slave selects-- >; --source include/show_msg.inc -connection slave; -sync_with_master; +sync_slave_with_master; SELECT * FROM test.t3 ORDER BY id3; connection master; diff --git a/mysql-test/suite/rpl/t/rpl_row_sp008.test b/mysql-test/suite/rpl/t/rpl_row_sp008.test index b1295820c99..80603c28d27 100644 --- a/mysql-test/suite/rpl/t/rpl_row_sp008.test +++ b/mysql-test/suite/rpl/t/rpl_row_sp008.test @@ -41,9 +41,7 @@ SELECT * FROM test.t2; let $message=< ---- Slave selects-- >; --source include/show_msg.inc -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SELECT * FROM test.t2; # Cleanup diff --git a/mysql-test/suite/rpl/t/rpl_row_sp009.test b/mysql-test/suite/rpl/t/rpl_row_sp009.test index 92d47c6f50f..77860621961 100644 --- a/mysql-test/suite/rpl/t/rpl_row_sp009.test +++ b/mysql-test/suite/rpl/t/rpl_row_sp009.test @@ -71,9 +71,7 @@ delimiter ;| CALL test.p1('a'); SELECT * FROM test.t2 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SELECT * FROM test.t2 ORDER BY a; connection master; truncate test.t2; @@ -81,17 +79,13 @@ truncate test.t2; # this next call fails, but should not call test.p1('b'); select * from test.t2 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SELECT * FROM test.t2 ORDER BY a; connection master; truncate test.t2; SELECT * FROM test.t2 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SELECT * FROM test.t2 ORDER BY a; # Cleanup diff --git a/mysql-test/suite/rpl/t/rpl_row_sp010.test b/mysql-test/suite/rpl/t/rpl_row_sp010.test index 28b82217517..7fa0077f117 100644 --- a/mysql-test/suite/rpl/t/rpl_row_sp010.test +++ b/mysql-test/suite/rpl/t/rpl_row_sp010.test @@ -39,9 +39,7 @@ delimiter ;| CALL test.p2(); SELECT * FROM test.t1 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; show tables; connection master; @@ -61,9 +59,7 @@ delimiter ;| CALL test.p4(); SELECT * FROM test.t2 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SELECT * FROM test.t2 ORDER BY a; # Cleanup diff --git a/mysql-test/suite/rpl/t/rpl_row_trig002.test b/mysql-test/suite/rpl/t/rpl_row_trig002.test index 7ca8a68f060..1ea245498d5 100644 --- a/mysql-test/suite/rpl/t/rpl_row_trig002.test +++ b/mysql-test/suite/rpl/t/rpl_row_trig002.test @@ -39,9 +39,7 @@ INSERT INTO test.t1 VALUES (1, 'example.com'),(2, 'mysql.com'),(3, 'earthmotherw SELECT * FROM test.t1 ORDER BY id; #show binlog events; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SELECT * FROM test.t1 ORDER BY id; connection master; @@ -51,9 +49,7 @@ INSERT INTO test.t2 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming'); select * from test.t2; select * from test.t3; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; select * from test.t2; select * from test.t3; connection master; @@ -63,9 +59,7 @@ DELETE FROM test.t1 WHERE id = 1; SELECT * FROM test.t1 ORDER BY id; connection master; SELECT * FROM test.t1 ORDER BY id; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SELECT * FROM test.t1 ORDER BY id; # Cleanup diff --git a/mysql-test/suite/rpl/t/rpl_row_trig003.test b/mysql-test/suite/rpl/t/rpl_row_trig003.test index 5d667e29d69..781862161c1 100644 --- a/mysql-test/suite/rpl/t/rpl_row_trig003.test +++ b/mysql-test/suite/rpl/t/rpl_row_trig003.test @@ -120,9 +120,7 @@ DELETE FROM test.t1 WHERE id = 1; DELETE FROM test.t2 WHERE id = 1; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; connection master; # time to dump the databases and so we can see if they match diff --git a/mysql-test/suite/rpl/t/rpl_server_id2.test b/mysql-test/suite/rpl/t/rpl_server_id2.test index 488a3aa6ab6..5c51a7fc08e 100644 --- a/mysql-test/suite/rpl/t/rpl_server_id2.test +++ b/mysql-test/suite/rpl/t/rpl_server_id2.test @@ -7,9 +7,11 @@ create table t1 (n int); reset master; # replicate ourselves stop slave; +--source include/wait_for_slave_to_stop.inc --replace_result $SLAVE_MYPORT SLAVE_PORT eval change master to master_port=$SLAVE_MYPORT; start slave; +--source include/wait_for_slave_to_start.inc insert into t1 values (1); save_master_pos; sync_with_master; @@ -18,6 +20,7 @@ select * from t1; # check that indeed 2 were inserted # 'drop table t1' executed twice, so an error in the slave.err # (not critical). stop slave; +--source include/wait_for_slave_to_stop.inc drop table t1; diff --git a/mysql-test/suite/rpl/t/rpl_session_var.test b/mysql-test/suite/rpl/t/rpl_session_var.test index 50efc8930a1..ee9f7e0585a 100644 --- a/mysql-test/suite/rpl/t/rpl_session_var.test +++ b/mysql-test/suite/rpl/t/rpl_session_var.test @@ -9,9 +9,7 @@ insert into t1 values('My'||'SQL', 1); set @@session.sql_mode=default; insert into t1 values('1'||'2', 2); select * from t1 where b<3 order by a; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; select * from t1 where b<3 order by a; connection master; # if the slave does the next sync_with_master fine, then it means it accepts the @@ -31,15 +29,11 @@ set @@session.sql_auto_is_null=0; insert into t1 values(null); insert into t2 select 2,a from t1 where a is null; select * from t2 order by b; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; select * from t2 order by b; connection master; drop table t1,t2; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; # # Bug #29878 Garbage data generation when executing SESSION_USER() on a slave. @@ -54,12 +48,9 @@ CREATE TABLE t1 ( --disable_warnings INSERT INTO t1(data) VALUES(SESSION_USER()); --enable_warnings -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SELECT length(data) < 100 FROM t1; connection master; drop table t1; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; + diff --git a/mysql-test/suite/rpl/t/rpl_set_charset.test b/mysql-test/suite/rpl/t/rpl_set_charset.test index c70eb2681f5..241c1c5738b 100644 --- a/mysql-test/suite/rpl/t/rpl_set_charset.test +++ b/mysql-test/suite/rpl/t/rpl_set_charset.test @@ -20,16 +20,12 @@ INSERT INTO t1 VALUES ('àáâãäåæçèéêëìíîï','E0'); INSERT INTO t1 VALUES ('ðñòóôõö÷øùúûüýþÿ','F0'); select "--- on master ---"; select hex(a),b from t1 order by b; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; use mysqltest1; select "--- on slave ---"; select hex(a),b from t1 order by b; connection master; drop database mysqltest1; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_show_slave_hosts.cnf b/mysql-test/suite/rpl/t/rpl_show_slave_hosts.cnf new file mode 100644 index 00000000000..288f0132fba --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_show_slave_hosts.cnf @@ -0,0 +1,20 @@ +!include ../my.cnf + +[mysqld.1] +server_id=1 + +[mysqld.2] +server_id=2 +report-host= +report-user= + +[mysqld.3] +server_id=3 +report-host=slave2 +slave-net-timeout=5 + +[ENV] +SLAVE_MYPORT2= @mysqld.3.port +SLAVE_MYSOCK2= @mysqld.3.socket + + diff --git a/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test b/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test new file mode 100644 index 00000000000..9f202487968 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test @@ -0,0 +1,47 @@ +############################################################################### +# Bug#13963 SHOW SLAVE HOSTS is unreliable +# +# Slaves only appear in the output of SHOW SLAVE HOSTS when report-host option +# is set. If an expected slave does not appear in the list, nobody knows +# whether the slave does not connect or has started without the "report-host" +# option. +# +# Remove the "Rpl_recovery_rank" column from SHOW SLAVE HOSTS, It is not +# implemented. +####################################################################### +source include/master-slave.inc; +connect (slave2,127.0.0.1,root,,test,$SLAVE_MYPORT2,); + +connection slave2; +RESET SLAVE; +--replace_result $MASTER_MYPORT MASTER_PORT +--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$MASTER_MYPORT,master_user='root' +START SLAVE IO_THREAD; +source include/wait_for_slave_io_to_start.inc; + +connection master; +let $show_statement= SHOW SLAVE HOSTS; +let $field= Server_id; +# 3 is server_id of slave2. +let $connection= ='3'; +source include/wait_show_condition.inc; +--replace_result $SLAVE_MYPORT SLAVE_PORT $DEFAULT_MASTER_PORT DEFAULT_PORT +SHOW SLAVE HOSTS; + +connection slave2; +STOP SLAVE IO_THREAD; +source include/wait_for_slave_io_to_stop.inc; + +connection master; +let $show_statement= SHOW SLAVE HOSTS; +let $field= Server_id; +# 3 is server_id of slave2. +let $condition= <> '3'; +# All rows of 'SHOW SLAVE HOSTS' are not equal to 3. It mean that master has +# knew the leave of slave2 and has unregistered it. +let $wait_for_all= 1; +source include/wait_show_condition.inc; +--replace_result $SLAVE_MYPORT SLAVE_PORT +SHOW SLAVE HOSTS; + +source include/master-slave-end.inc; diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test index 6336e775af1..5ef58892ef6 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_skip.test +++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test @@ -5,6 +5,7 @@ source include/have_innodb.inc; connection slave; source include/have_innodb.inc; STOP SLAVE; +--source include/wait_for_slave_to_stop.inc --echo **** On Master **** connection master; @@ -27,7 +28,7 @@ connection slave; # Stop when reaching the the first table map event. START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=762; --- source include/wait_for_slave_sql_to_stop.inc +--source include/wait_for_slave_sql_to_stop.inc --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 8 # 9 # 23 # 33 # 35 # 36 # query_vertical SHOW SLAVE STATUS; @@ -37,6 +38,7 @@ query_vertical SHOW SLAVE STATUS; # changed. SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; +--source include/wait_for_slave_to_start.inc sync_with_master; # These values should be what was inserted, not what was @@ -47,6 +49,7 @@ SELECT * FROM t1; SELECT * FROM t2; STOP SLAVE; +--source include/wait_for_slave_to_stop.inc RESET SLAVE; connection master; RESET MASTER; @@ -59,9 +62,10 @@ source include/show_binlog_events.inc; connection slave; START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=106; --- source include/wait_for_slave_sql_to_stop.inc +--source include/wait_for_slave_sql_to_stop.inc SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; +--source include/wait_for_slave_to_start.inc sync_with_master; --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 8 # 9 # 23 # 33 # 35 # 36 # diff --git a/mysql-test/suite/rpl/t/rpl_sp-master.opt b/mysql-test/suite/rpl/t/rpl_sp-master.opt index 709a224fd92..18c5c96955f 100644 --- a/mysql-test/suite/rpl/t/rpl_sp-master.opt +++ b/mysql-test/suite/rpl/t/rpl_sp-master.opt @@ -1 +1 @@ ---log_bin_trust_routine_creators=0 +--log_bin_trust_function_creators=0 diff --git a/mysql-test/suite/rpl/t/rpl_sp-slave.opt b/mysql-test/suite/rpl/t/rpl_sp-slave.opt index 709a224fd92..18c5c96955f 100644 --- a/mysql-test/suite/rpl/t/rpl_sp-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_sp-slave.opt @@ -1 +1 @@ ---log_bin_trust_routine_creators=0 +--log_bin_trust_function_creators=0 diff --git a/mysql-test/suite/rpl/t/rpl_sp.test b/mysql-test/suite/rpl/t/rpl_sp.test index 2811db8ef1e..96a41d9a9ad 100644 --- a/mysql-test/suite/rpl/t/rpl_sp.test +++ b/mysql-test/suite/rpl/t/rpl_sp.test @@ -3,11 +3,6 @@ # Test of replication of stored procedures (WL#2146 for MySQL 5.0) # Modified by WL#2971. -# Note that in the .opt files we still use the old variable name -# log-bin-trust-routine-creators so that this test checks that it's -# still accepted (this test also checks that the new name is -# accepted). The old name could be removed in 5.1 or 6.0. - source include/have_binlog_format_mixed.inc; source include/master-slave.inc; @@ -241,16 +236,11 @@ begin end| delimiter ;| connection master; -set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators; set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; -# test old variable name: -set global log_bin_trust_routine_creators=1; -# now use new name: set global log_bin_trust_function_creators=0; set global log_bin_trust_function_creators=1; # slave needs it too otherwise will not execute what master allowed: connection slave; -set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators; set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; set global log_bin_trust_function_creators=1; @@ -466,9 +456,7 @@ DROP FUNCTION IF EXISTS f1; --echo --echo ---> Synchronizing slave with master... ---save_master_pos ---connection slave ---sync_with_master +--sync_slave_with_master --echo --echo ---> connection: master @@ -492,9 +480,7 @@ SHOW CREATE FUNCTION f1; --echo --echo ---> Synchronizing slave with master... ---save_master_pos ---connection slave ---sync_with_master +--sync_slave_with_master --echo ---> connection: master @@ -516,9 +502,7 @@ SHOW CREATE FUNCTION f1; DROP PROCEDURE p1; DROP FUNCTION f1; ---save_master_pos ---connection slave ---sync_with_master +--sync_slave_with_master --connection master @@ -575,10 +559,8 @@ source include/show_binlog_events.inc; # This is a cleanup for all parts above where we tested stored # functions and triggers. connection slave; -set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators; set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; connection master; -set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators; set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; # Clean up diff --git a/mysql-test/suite/rpl/t/rpl_sp004.test b/mysql-test/suite/rpl/t/rpl_sp004.test index 967e7007c15..2f9b329eb66 100644 --- a/mysql-test/suite/rpl/t/rpl_sp004.test +++ b/mysql-test/suite/rpl/t/rpl_sp004.test @@ -46,9 +46,7 @@ delimiter ;| CALL test.p1(); SELECT * FROM test.t1 ORDER BY a; SELECT * FROM test.t2 ORDER BY a; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SELECT * FROM test.t1 ORDER BY a; SELECT * FROM test.t2 ORDER BY a; @@ -57,9 +55,7 @@ CALL test.p2(); USE test; SHOW TABLES; #SELECT * FROM test.t3; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; USE test; SHOW TABLES; #SELECT * FROM test.t3; @@ -69,9 +65,7 @@ CALL test.p1(); SELECT * FROM test.t1 ORDER BY a; SELECT * FROM test.t2 ORDER BY a; #SELECT * FROM test.t3; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; SELECT * FROM test.t1 ORDER BY a; SELECT * FROM test.t2 ORDER BY a; #SELECT * FROM test.t3; diff --git a/mysql-test/suite/rpl/t/rpl_sporadic_master.test b/mysql-test/suite/rpl/t/rpl_sporadic_master.test index 824f7abc9f5..6640544b0ed 100644 --- a/mysql-test/suite/rpl/t/rpl_sporadic_master.test +++ b/mysql-test/suite/rpl/t/rpl_sporadic_master.test @@ -14,7 +14,9 @@ truncate table t1; insert into t1 values (4),(NULL); sync_slave_with_master; stop slave; +--source include/wait_for_slave_to_stop.inc start slave; +--source include/wait_for_slave_to_start.inc connection master; insert into t1 values (NULL),(NULL); flush logs; diff --git a/mysql-test/suite/rpl/t/rpl_ssl1.test b/mysql-test/suite/rpl/t/rpl_ssl1.test index b5355d737d5..85f073d9c09 100644 --- a/mysql-test/suite/rpl/t/rpl_ssl1.test +++ b/mysql-test/suite/rpl/t/rpl_ssl1.test @@ -9,14 +9,13 @@ source include/master-slave.inc; connection master; grant replication slave on *.* to replssl@localhost require ssl; create table t1 (t int); -save_master_pos; #syncing with master -connection slave; -sync_with_master; +sync_slave_with_master; #trying to use this user without ssl stop slave; +--source include/wait_for_slave_to_stop.inc change master to master_user='replssl',master_password=''; start slave; @@ -31,15 +30,15 @@ select * from t1; #showing that replication could work with ssl params stop slave; +--source include/wait_for_slave_to_stop.inc --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR eval change master to master_ssl=1 , master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem'; start slave; +--source include/wait_for_slave_to_start.inc #avoiding unneeded sleeps connection master; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; #checking that replication is ok select * from t1; @@ -51,14 +50,14 @@ query_vertical show slave status; #checking if replication works without ssl also performing clean up stop slave; +--source include/wait_for_slave_to_stop.inc change master to master_user='root',master_password='', master_ssl=0; start slave; +--source include/wait_for_slave_to_start.inc connection master; drop user replssl@localhost; drop table t1; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT --replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 # query_vertical show slave status; @@ -68,6 +67,7 @@ query_vertical show slave status; # Start replication with ssl_verify_server_cert turned on connection slave; stop slave; +--source include/wait_for_slave_to_stop.inc --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR eval change master to master_host="localhost", @@ -77,6 +77,7 @@ eval change master to master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem', master_ssl_verify_server_cert=1; start slave; +--source include/wait_for_slave_to_start.inc connection master; create table t1 (t int); diff --git a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test index d9b87427321..d599e88c840 100644 --- a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test @@ -9,6 +9,7 @@ connection master; create table t1(n int); sync_slave_with_master; stop slave; +--source include/wait_for_slave_to_stop.inc connection master; let $1=5000; disable_query_log; @@ -31,10 +32,7 @@ sync_with_master; connection master; drop table t1; -save_master_pos; - -connection slave; -sync_with_master; +sync_slave_with_master; # diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test index 07a3b27763d..6b731780163 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_until.test +++ b/mysql-test/suite/rpl/t/rpl_stm_until.test @@ -22,6 +22,9 @@ # Test is dependent on binlog positions +# prepare version for substitutions +let $VERSION=`select version()`; + # Stop slave before it starts replication. Also sync with master # to avoid nondeterministic behaviour. --echo [on slave] diff --git a/mysql-test/suite/rpl/t/rpl_temp_table.test b/mysql-test/suite/rpl/t/rpl_temp_table.test index 9b73961aeea..dc24f2fc87b 100644 --- a/mysql-test/suite/rpl/t/rpl_temp_table.test +++ b/mysql-test/suite/rpl/t/rpl_temp_table.test @@ -54,6 +54,4 @@ show status like 'Slave_open_temp_tables'; connect (master2,localhost,root,,); connection master2; drop table if exists t1,t2; -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; diff --git a/mysql-test/suite/rpl/t/rpl_temporary.test b/mysql-test/suite/rpl/t/rpl_temporary.test index a59e4f2fd21..3f9f5c19a25 100644 --- a/mysql-test/suite/rpl/t/rpl_temporary.test +++ b/mysql-test/suite/rpl/t/rpl_temporary.test @@ -1,6 +1,5 @@ # Test need anonymous user when connection are made as "zedjzlcsjhd" source include/add_anonymous_users.inc; - -- source include/master-slave.inc # Clean up old slave's binlogs. diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test index a3929458026..a7547a14433 100644 --- a/mysql-test/suite/rpl/t/rpl_trigger.test +++ b/mysql-test/suite/rpl/t/rpl_trigger.test @@ -38,10 +38,12 @@ insert into t3 values(100,"log",0,0,0); SET @@RAND_SEED1=658490765, @@RAND_SEED2=635893186; # Emulate that we have rows 2-9 deleted on the slave +--disable_warnings insert into t1 values(1,1,rand()),(NULL,2,rand()); insert into t2 (b) values(last_insert_id()); insert into t2 values(3,0),(NULL,0); insert into t2 values(NULL,0),(500,0); +--enable_warnings select a,b, truncate(rand_value,4) from t1; select * from t2; diff --git a/mysql-test/suite/rpl/t/rpl_user_variables.test b/mysql-test/suite/rpl/t/rpl_user_variables.test index 8d570f28f64..0eae78fcb9f 100644 --- a/mysql-test/suite/rpl/t/rpl_user_variables.test +++ b/mysql-test/suite/rpl/t/rpl_user_variables.test @@ -20,9 +20,7 @@ # test the slave immediately writes DROP TEMPORARY TABLE this_old_table). # We wait for the slave to have written all he wants to the binlog # (otherwise RESET MASTER may come too early). -save_master_pos; -connection slave; -sync_with_master; +sync_slave_with_master; reset master; connection master; diff --git a/mysql-test/suite/rpl/t/rpl_variables_stm.test b/mysql-test/suite/rpl/t/rpl_variables_stm.test index 85152ae878a..67f2e50e041 100644 --- a/mysql-test/suite/rpl/t/rpl_variables_stm.test +++ b/mysql-test/suite/rpl/t/rpl_variables_stm.test @@ -471,7 +471,9 @@ BEGIN END| DELIMITER ;| +--disable_warnings INSERT INTO trigger_table VALUES ('bye.'); +--enable_warnings --echo ==== Insert variables from a prepared statement ==== diff --git a/mysql-test/suite/rpl/t/rpl_view.test b/mysql-test/suite/rpl/t/rpl_view.test index 1053514bfec..01b4dc5ef55 100644 --- a/mysql-test/suite/rpl/t/rpl_view.test +++ b/mysql-test/suite/rpl/t/rpl_view.test @@ -74,9 +74,7 @@ DROP VIEW IF EXISTS v1; --echo --echo ---> Synchronizing slave with master... ---save_master_pos ---connection slave ---sync_with_master +--sync_slave_with_master --echo --echo ---> connection: master @@ -104,9 +102,7 @@ SELECT * FROM t1; --echo --echo ---> Synchronizing slave with master... ---save_master_pos ---connection slave ---sync_with_master +--sync_slave_with_master --echo ---> connection: master @@ -127,9 +123,7 @@ SELECT * FROM t1; DROP VIEW v1; DROP TABLE t1; ---save_master_pos ---connection slave ---sync_with_master +--sync_slave_with_master --connection master # diff --git a/mysql-test/suite/rpl_ndb/my.cnf b/mysql-test/suite/rpl_ndb/my.cnf index a0ec3659c18..191683fc9df 100644 --- a/mysql-test/suite/rpl_ndb/my.cnf +++ b/mysql-test/suite/rpl_ndb/my.cnf @@ -30,16 +30,6 @@ log-bin= master-bin # starting the mysqld #!use-slave-opt -# Connect mysqld in the second cluster as save to first mysqld -# Hardcode the host to 127.0.0.1 until running on more -# than one host and it probably need to be masked anyway -# master-host= @mysqld.1.#host -master-host= 127.0.0.1 -master-port= @mysqld.1.1.port -master-password= @mysqld.1.1.#password -master-user= @mysqld.1.1.#user -master-connect-retry= 1 - log-bin= slave-bin relay-log= slave-relay-bin diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf index b1b010ef0f3..58f8555afd1 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf @@ -15,11 +15,6 @@ skip-slave-start [mysqld.2.slave] server-id= 2 -master-host= 127.0.0.1 -master-port= @mysqld.2.1.port -master-password= @mysqld.2.1.#password -master-user= @mysqld.2.1.#user -master-connect-retry= 1 init-rpl-role= slave log-bin skip-slave-start diff --git a/mysql-test/t/backup-master.sh b/mysql-test/t/backup-master.sh deleted file mode 100755 index c099064f6b7..00000000000 --- a/mysql-test/t/backup-master.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -if [ "$MYSQL_TEST_DIR" ] -then - rm -f $MYSQLTEST_VARDIR/tmp/*.frm $MYSQLTEST_VARDIR/tmp/*.MY? -fi diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test deleted file mode 100644 index c761f48cbcb..00000000000 --- a/mysql-test/t/backup.test +++ /dev/null @@ -1,104 +0,0 @@ - -# The server need to be started in $MYSQLTEST_VARDIR since it -# uses ../../std_data/ ---source include/uses_vardir.inc - -# Save the initial number of concurrent sessions ---source include/count_sessions.inc - -# -# This test is a bit tricky as we can't use backup table to overwrite an old -# table -# -connect (con1,localhost,root,,); -connect (con2,localhost,root,,); -connection con1; -set SQL_LOG_BIN=0; ---disable_warnings -drop table if exists t1, t2, t3, t4; ---enable_warnings -create table t4(n int); ---replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -backup table t4 to '../../bogus'; -backup table t4 to '../../tmp'; ---replace_result ": 7" ": X" ": 17" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -backup table t4 to '../../tmp'; -drop table t4; -restore table t4 from '../../tmp'; -select count(*) from t4; - -create table t1(n int); -insert into t1 values (23),(45),(67); -backup table t1 to '../../tmp'; -drop table t1; ---replace_result ": 1" ": X" ": 2" ": X" ": 22" ": X" ": 23" ": X" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -restore table t1 from '../../bogus'; -restore table t1 from '../../tmp'; -select n from t1; -create table t2(m int not null primary key); -create table t3(k int not null primary key); -insert into t2 values (123),(145),(167); -insert into t3 values (223),(245),(267); -backup table t2,t3 to '../../tmp'; -drop table t1,t2,t3; -restore table t1,t2,t3 from '../../tmp'; -select n from t1; -select m from t2; -select k from t3; -drop table t1,t2,t3,t4; -restore table t1 from '../../tmp'; -connection con2; -rename table t1 to t5; ---send -lock tables t5 write; -connection con1; ---send -backup table t5 to '../../tmp'; -connection con2; -reap; -unlock tables; -connection con1; -reap; -drop table t5; -connection default; -disconnect con1; -disconnect con2; -remove_file $MYSQLTEST_VARDIR/tmp/t1.MYD; -remove_file $MYSQLTEST_VARDIR/tmp/t2.MYD; -remove_file $MYSQLTEST_VARDIR/tmp/t3.MYD; -remove_file $MYSQLTEST_VARDIR/tmp/t4.MYD; -remove_file $MYSQLTEST_VARDIR/tmp/t5.MYD; -remove_file $MYSQLTEST_VARDIR/tmp/t1.frm; -remove_file $MYSQLTEST_VARDIR/tmp/t2.frm; -remove_file $MYSQLTEST_VARDIR/tmp/t3.frm; -remove_file $MYSQLTEST_VARDIR/tmp/t4.frm; -remove_file $MYSQLTEST_VARDIR/tmp/t5.frm; - - -# End of 4.1 tests -# End of 5.0 tests - -# -# Bug#18775 - Temporary table from alter table visible to other threads -# -# Backup did not encode table names. ---disable_warnings -DROP TABLE IF EXISTS `t+1`; ---enable_warnings -CREATE TABLE `t+1` (c1 INT); -INSERT INTO `t+1` VALUES (1), (2), (3); -BACKUP TABLE `t+1` TO '../../tmp'; -DROP TABLE `t+1`; -# -# Same for restore. -RESTORE TABLE `t+1` FROM '../../tmp'; -SELECT * FROM `t+1`; -DROP TABLE `t+1`; -# -remove_file $MYSQLTEST_VARDIR/tmp/t@002b1.frm; -remove_file $MYSQLTEST_VARDIR/tmp/t@002b1.MYD; - - -# Wait till all disconnects are completed ---source include/wait_until_count_sessions.inc - diff --git a/mysql-test/t/deprecated_features.test b/mysql-test/t/deprecated_features.test new file mode 100644 index 00000000000..002f4ad1122 --- /dev/null +++ b/mysql-test/t/deprecated_features.test @@ -0,0 +1,27 @@ +--error ER_UNKNOWN_SYSTEM_VARIABLE +set global log_bin_trust_routine_creators=1; +--error ER_UNKNOWN_SYSTEM_VARIABLE +set table_type='MyISAM'; +--error ER_UNKNOWN_SYSTEM_VARIABLE +select @@table_type='MyISAM'; +--error ER_PARSE_ERROR +backup table t1 to 'data.txt'; +--error ER_PARSE_ERROR +restore table t1 from 'data.txt'; +--error ER_PARSE_ERROR +show plugin; +--error ER_PARSE_ERROR +load table t1 from master; +--error ER_PARSE_ERROR +load data from master; +--error ER_PARSE_ERROR +SHOW INNODB STATUS; +--error ER_PARSE_ERROR +create table t1 (t6 timestamp(6)); +--error ER_PARSE_ERROR +create table t1 (t6 timestamp) type=myisam; +--error ER_PARSE_ERROR +show table types; +--error ER_PARSE_ERROR +show mutex status; + diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index 387b3ebdd05..b9e84d8d7df 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -458,9 +458,6 @@ prepare stmt1 from ' analyze table t1 ' ; prepare stmt1 from ' checksum table t1 ' ; prepare stmt1 from ' repair table t1 ' ; ---replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR> ---error ER_UNSUPPORTED_PS -eval prepare stmt1 from ' restore table t1 from ''$datafile'' ' ; --remove_file $datafile ## handler diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 0e4af16dd1f..6e07f717db6 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -629,7 +629,6 @@ show plugins; show columns in t1; show slave hosts; show keys in t1; -show table types; show storage engines; show authors; show contributors; @@ -1008,11 +1007,6 @@ disconnect con4; # --disable_result_log -show full plugin; ---enable_result_log -show warnings; ---disable_result_log -show plugin; show plugins; --enable_result_log @@ -1180,14 +1174,6 @@ DROP TABLE t1; DROP EVENT ev1; # -# Bug#30036 SHOW TABLE TYPES causes the debug client to crash -# ---disable_result_log -SHOW TABLE TYPES; ---enable_result_log - - -# # Bug#32710 SHOW INNODB STATUS requires SUPER # diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index a9bb80647bc..e33adf56284 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -1325,11 +1325,6 @@ CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN DROP TRIGGER test1; EN -- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG CREATE FUNCTION bug_13627_f() returns int BEGIN DROP TRIGGER test1; return 1; END | --- error ER_SP_BADSTATEMENT -CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN load table t1 from master; END | --- error ER_SP_BADSTATEMENT -CREATE FUNCTION bug_13627_f() returns int BEGIN load table t1 from master; return 1; END | - -- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create table t2 (a int); END | -- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG @@ -1580,18 +1575,6 @@ BEGIN REPAIR TABLE t1; RETURN 1; END| ---error ER_SP_NO_RETSET -CREATE FUNCTION bug13012() RETURNS INT -BEGIN - BACKUP TABLE t1 TO '/tmp'; - RETURN 1; -END| ---error ER_SP_NO_RETSET -CREATE FUNCTION bug13012() RETURNS INT -BEGIN - RESTORE TABLE t1 FROM '/tmp'; - RETURN 1; -END| create table t1 (a int)| CREATE PROCEDURE bug13012_1() REPAIR TABLE t1| CREATE FUNCTION bug13012_2() RETURNS INT @@ -2386,7 +2369,7 @@ drop procedure if exists p1; delimiter |; create procedure p1() begin - create table t1 (a int) type=MyISAM; + create table t1 (a int) engine=MyISAM; drop table t1; end| delimiter ;| diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index b0342491a34..da59f0d9a7f 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -5214,20 +5214,15 @@ drop procedure bug5967| --disable_warnings drop procedure if exists bug13012| +--enable_warnings # Disable warnings also for BACKUP/RESTORE: they are deprecated. ---replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR> eval create procedure bug13012() BEGIN REPAIR TABLE t1; - BACKUP TABLE t1 to '$backupdir'; - DROP TABLE t1; - RESTORE TABLE t1 FROM '$backupdir'; END| call bug13012()| --enable_warnings ---remove_file $backupdir/t1.frm ---remove_file $backupdir/t1.MYD drop procedure bug13012| diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test index ce18b2b578e..bd465a1a09b 100644 --- a/mysql-test/t/sp_trans.test +++ b/mysql-test/t/sp_trans.test @@ -565,7 +565,7 @@ use db_bug7787| # Test. CREATE PROCEDURE p1() - SHOW INNODB STATUS; | + SHOW ENGINE INNODB STATUS; | GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost| diff --git a/mysql-test/t/system_mysql_db_fix40123.test b/mysql-test/t/system_mysql_db_fix40123.test index 440fcc8aa8a..818993e5f27 100644 --- a/mysql-test/t/system_mysql_db_fix40123.test +++ b/mysql-test/t/system_mysql_db_fix40123.test @@ -26,7 +26,7 @@ use test; # create system tables as in mysql-4.1.23 # created by executing "./mysql_create_system_tables real ." -set table_type=myisam; +set storage_engine=myisam; CREATE TABLE db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); @@ -41,8 +41,8 @@ INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y',' CREATE TABLE func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; -CREATE TABLE tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; -CREATE TABLE columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; +CREATE TABLE tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; +CREATE TABLE columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; CREATE TABLE help_topic ( help_topic_id int unsigned not null, name varchar(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, url varchar(128) not null, primary key (help_topic_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help topics'; CREATE TABLE help_category ( help_category_id smallint unsigned not null, name varchar(64) not null, parent_category_id smallint unsigned null, url varchar(128) not null, primary key (help_category_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help categories'; diff --git a/mysql-test/t/system_mysql_db_fix50030.test b/mysql-test/t/system_mysql_db_fix50030.test index 4924c625d57..45084177570 100644 --- a/mysql-test/t/system_mysql_db_fix50030.test +++ b/mysql-test/t/system_mysql_db_fix50030.test @@ -26,7 +26,7 @@ use test; # create system tables as in mysql-5.0.30 # created by executing "./mysql_create_system_tables real ." -set table_type=myisam; +set storage_engine=myisam; CREATE TABLE db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N'); @@ -39,9 +39,9 @@ INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y',' CREATE TABLE func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; -CREATE TABLE tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; +CREATE TABLE tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; -CREATE TABLE columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; +CREATE TABLE columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; CREATE TABLE help_topic ( help_topic_id int unsigned not null, name char(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, url char(128) not null, primary key (help_topic_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help topics'; CREATE TABLE help_category ( help_category_id smallint unsigned not null, name char(64) not null, parent_category_id smallint unsigned null, url char(128) not null, primary key (help_category_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help categories'; @@ -60,7 +60,7 @@ CREATE TABLE time_zone_leap_second ( Transition_time bigint signed NOT NULL, CREATE TABLE proc ( db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum('CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA' ) DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob DEFAULT '' NOT NULL, returns char(64) DEFAULT '' NOT NULL, body longblob DEFAULT '' NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, PRIMARY KEY (db,name,type) ) engine=MyISAM character set utf8 comment='Stored Procedures'; -CREATE TABLE procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; +CREATE TABLE procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; CREATE TABLE servers ( Server_name char(64) NOT NULL DEFAULT '', Host char(64) NOT NULL DEFAULT '', Db char(64) NOT NULL DEFAULT '', Username char(64) NOT NULL DEFAULT '', Password char(64) NOT NULL DEFAULT '', Port INT(4) NOT NULL DEFAULT '0', Socket char(64) NOT NULL DEFAULT '', Wrapper char(64) NOT NULL DEFAULT '', Owner char(64) NOT NULL DEFAULT '', PRIMARY KEY (Server_name)) CHARACTER SET utf8 comment='MySQL Foreign Servers table'; diff --git a/mysql-test/t/system_mysql_db_fix50117.test b/mysql-test/t/system_mysql_db_fix50117.test index d88c4edba93..bed00239081 100644 --- a/mysql-test/t/system_mysql_db_fix50117.test +++ b/mysql-test/t/system_mysql_db_fix50117.test @@ -44,9 +44,9 @@ CREATE TABLE IF NOT EXISTS plugin ( name char(64) binary DEFAULT '' NOT NULL, dl CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', Host char(64) NOT NULL DEFAULT '', Db char(64) NOT NULL DEFAULT '', Username char(64) NOT NULL DEFAULT '', Password char(64) NOT NULL DEFAULT '', Port INT(4) NOT NULL DEFAULT '0', Socket char(64) NOT NULL DEFAULT '', Wrapper char(64) NOT NULL DEFAULT '', Owner char(64) NOT NULL DEFAULT '', PRIMARY KEY (Server_name)) CHARACTER SET utf8 comment='MySQL Foreign Servers table'; -CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; +CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; -CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; +CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, name char(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, url char(128) not null, primary key (help_topic_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help topics'; @@ -79,7 +79,7 @@ CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint sign CREATE TABLE IF NOT EXISTS proc ( db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum('CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA' ) DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns char(64) DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, PRIMARY KEY (db,name,type) ) engine=MyISAM character set utf8 comment='Stored Procedures'; -CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; +CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index 460da1c1614..17ffade5f63 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -534,18 +534,6 @@ DROP TABLE b15776; --error ER_PARSE_ERROR CREATE TABLE b15776 (a year(-2)); -## For timestamp, we silently rewrite widths to 14 or 19. -CREATE TABLE b15776 (a timestamp(4294967294)); -DROP TABLE b15776; -CREATE TABLE b15776 (a timestamp(4294967295)); -DROP TABLE b15776; ---error ER_TOO_BIG_DISPLAYWIDTH -CREATE TABLE b15776 (a timestamp(4294967296)); ---error ER_PARSE_ERROR -CREATE TABLE b15776 (a timestamp(-1)); ---error ER_PARSE_ERROR -CREATE TABLE b15776 (a timestamp(-2)); - # We've already tested the case, but this should visually show that # widths that are too large to be interpreted cause DISPLAYWIDTH errors. @@ -555,8 +543,6 @@ CREATE TABLE b15776 (a int(99999999999999999999999999999999999999999999999999999 CREATE TABLE b15776 (a char(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); --error ER_TOO_BIG_DISPLAYWIDTH CREATE TABLE b15776 (a year(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); ---error ER_TOO_BIG_DISPLAYWIDTH -CREATE TABLE b15776 (a timestamp(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); ## Do not select, too much memory needed. CREATE TABLE b15776 select cast(null as char(4294967295)); diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index e8374e0ebfc..2a49e0def1a 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -67,17 +67,6 @@ INSERT INTO t1 VALUES ("2030-01-01","2030-01-01 00:00:00",20300101000000); SELECT * FROM t1; drop table t1; -create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6), - t8 timestamp(8), t10 timestamp(10), t12 timestamp(12), - t14 timestamp(14)); -insert t1 values (0,0,0,0,0,0,0), -("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", -"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", -"1997-12-31 23:47:59"); -select * from t1; -select * from t1; -drop table t1; - # # Let us check if we properly treat wrong datetimes and produce proper warnings # (for both strings and numbers) @@ -298,7 +287,7 @@ drop table t1; # mode regardless of whether a display width is given. # set sql_mode='maxdb'; -create table t1 (a timestamp, b timestamp(19)); +create table t1 (a timestamp, b timestamp); show create table t1; # restore default mode set sql_mode=''; diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test index 176f320e390..98e1db62d84 100644 --- a/mysql-test/t/warnings.test +++ b/mysql-test/t/warnings.test @@ -112,11 +112,6 @@ show variables like 'max_error_count'; drop table t1; # -# Test for deprecated table_type variable -# -set table_type=MYISAM; - -# # Tests for show warnings limit a, b # create table t1 (a int); |