diff options
author | Bjorn Munch <Bjorn.Munch@sun.com> | 2009-09-02 18:58:17 +0200 |
---|---|---|
committer | Bjorn Munch <Bjorn.Munch@sun.com> | 2009-09-02 18:58:17 +0200 |
commit | 588e9930b4067bd712ca30c063ccb09dbcfc6c40 (patch) | |
tree | 5558803a46329d136748a32e38c66c6ff19b5b09 /mysql-test/extra | |
parent | d65168fddab05ed08d95eb5fead7cb1aad38edd5 (diff) | |
parent | c4fa4f31ae7389a51d33e871951a236e57f1e19c (diff) | |
download | mariadb-git-588e9930b4067bd712ca30c063ccb09dbcfc6c40.tar.gz |
first merge from main
Diffstat (limited to 'mysql-test/extra')
-rw-r--r-- | mysql-test/extra/binlog_tests/binlog.test | 12 | ||||
-rw-r--r-- | mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test | 63 | ||||
-rw-r--r-- | mysql-test/extra/rpl_tests/rpl_reset_slave.test | 54 |
3 files changed, 129 insertions, 0 deletions
diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test index d72dc693cee..5d898d41a54 100644 --- a/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-test/extra/binlog_tests/binlog.test @@ -258,3 +258,15 @@ dec $it; } show master status /* must show new binlog index after rotating */; drop table t3; + +--echo # +--echo # Bug #45998: database crashes when running "create as select" +--echo # +CREATE DATABASE test1; +USE test1; +DROP DATABASE test1; +CREATE TABLE test.t1(a int); +INSERT INTO test.t1 VALUES (1), (2); +CREATE TABLE test.t2 SELECT * FROM test.t1; +USE test; +DROP TABLES t1, t2; diff --git a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test new file mode 100644 index 00000000000..c79ccdd044f --- /dev/null +++ b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test @@ -0,0 +1,63 @@ +# +# BUG#45214 +# The common part of the "rpl_get_master_version_and_clock" test. +# Restart slave under network disconnection between slave and master +# following the steps: +# 1 - Got DBUG_SYNC_POINT lock +# 2 - Set DBUG_SYNC_POINT before call mysql_real_query(...) function in get_master_version_and_clock(...) function and hang here +# 3 - shutdown master server for simulating network disconnection +# 4 - Release DBUG_SYNC_POINT lock +# 5 - Check if the slave I/O thread tries to reconnect to master. +# +# Note: Please make sure initialize the $debug_lock when call the test script. +# +connection slave; +if (`SELECT '$debug_lock' = ''`) +{ + --die Cannot continue. Please set value for $debug_lock. +} + +# Restart slave +--disable_warnings +stop slave; +source include/wait_for_slave_to_stop.inc; +start slave; +source include/wait_for_slave_to_start.inc; +connection master; +# Write file to make mysql-test-run.pl expect the "crash", but don't start +# it until it's told to +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait +EOF + +# Send shutdown to the connected server and give +# it 10 seconds to die before zapping it +shutdown_server 10; + +connection slave; +eval SELECT RELEASE_LOCK($debug_lock); + +# Show slave last IO errno +connection slave; +source include/wait_for_slave_io_error.inc; +let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1); +echo Slave_IO_Errno= $last_io_errno; + +# Write file to make mysql-test-run.pl start up the server again +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart +EOF + +connection master; +# Turn on reconnect +--enable_reconnect + +# Call script that will poll the server waiting for it to be back online again +--source include/wait_until_connected_again.inc + +# Turn off reconnect again +--disable_reconnect + +connection slave; +source include/wait_for_slave_to_start.inc; + diff --git a/mysql-test/extra/rpl_tests/rpl_reset_slave.test b/mysql-test/extra/rpl_tests/rpl_reset_slave.test index 2cc041a35e1..1f88c792fce 100644 --- a/mysql-test/extra/rpl_tests/rpl_reset_slave.test +++ b/mysql-test/extra/rpl_tests/rpl_reset_slave.test @@ -41,3 +41,57 @@ reset slave; start slave; sync_with_master; show status like 'slave_open_temp_tables'; + +# +#Bug#34654 RESET SLAVE does not clear LAST_IO_Err* +# + +# clearing the status +stop slave; +reset slave; +let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1); +echo *** errno must be zero: $last_io_errno ***; + +# +# verifying start slave resets Last_IO_Error and Last_IO_Errno. +# + +change master to master_user='impossible_user_name'; +start slave; +source include/wait_for_slave_io_error.inc; +let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1); +--disable_query_log +eval SELECT $last_io_errno > 0 as ONE; +--enable_query_log + +source include/stop_slave.inc; +change master to master_user='root'; +source include/start_slave.inc; +let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1); +let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1); +--echo *** last errno must be zero: $last_io_errno *** +--echo *** last error must be blank: $last_io_error *** + +# +# verifying reset slave resets Last_{IO,SQL}_Err{or,no} +# + +source include/stop_slave.inc; +change master to master_user='impossible_user_name'; +start slave; +source include/wait_for_slave_io_error.inc; +let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1); +--disable_query_log +eval SELECT $last_io_errno > 0 as ONE; +--enable_query_log + +source include/stop_slave.inc; +reset slave; +let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1); +let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1); +let $last_sql_errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1); +let $last_sql_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1); +--echo *** io last errno must be zero: $last_io_errno *** +--echo *** io last error must be blank: $last_io_error *** +--echo *** sql last errno must be zero: $last_sql_errno *** +--echo *** sql last error must be blank: $last_sql_error *** |