Make sure tests drops objects created and restore variables to default

parent a49d6c5f
......@@ -80,7 +80,7 @@ SET AUTOCOMMIT=1;
--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
# First lets cleanupi
# First lets cleanup
DROP FUNCTION test.f1;
DROP TABLE test.t1;
......
......@@ -12,6 +12,7 @@ DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t9;
--enable_warnings
sync_slave_with_master;
STOP SLAVE;
SET @my_sql_mode= @@global.sql_mode;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
START SLAVE;
......@@ -238,3 +239,6 @@ DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
--enable_warnings
sync_slave_with_master;
# Restore sql_mode
SET @@global.sql_mode= @my_sql_mode;
......@@ -97,3 +97,4 @@ DROP TABLE slow_event_test;
SET GLOBAL long_query_time =@old_global_long_query_time;
SET SESSION long_query_time =@old_session_long_query_time;
DROP DATABASE events_test;
SET GLOBAL event_scheduler=off;
......@@ -83,3 +83,4 @@ DROP TABLE table_2;
DROP TABLE table_3;
DROP TABLE table_4;
DROP DATABASE events_test;
SET GLOBAL event_scheduler=OFF;
......@@ -383,3 +383,4 @@ id data
7 130
8 140
9 150
drop table t1;
......@@ -113,3 +113,4 @@ ERROR HY000: The MySQL server is running with the --read-only option so it canno
drop user test;
drop table t1;
drop table t2;
set global read_only=0;
......@@ -26,3 +26,4 @@ END|
INSERT INTO mysqltest1.t1 SET n = NULL, a = now();
DROP TABLE IF EXISTS mysqltest1.t1;
DROP FUNCTION mysqltest1.f1;
DROP DATABASE mysqltest1;
......@@ -34,3 +34,5 @@ a users
DROP DATABASE mysqltest1;
REVOKE ALL ON mysqltest1.* FROM 'tester'@'%';
REVOKE ALL ON mysqltest1.* FROM ''@'localhost%';
DROP USER tester@'%';
DROP USER ''@'localhost%';
......@@ -97,6 +97,7 @@ a
7
8
9
SET GLOBAL QUERY_CACHE_SIZE=0;
================ Test for BUG#22550 ================
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
......@@ -118,3 +119,4 @@ HEX(a) b
SELECT HEX(a),b FROM t1;
HEX(a) b
0 2
DROP TABLE t1;
......@@ -23,3 +23,4 @@ SET TIMESTAMP=333300000;
INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP);
DROP FUNCTION test.f1;
DROP TABLE test.t1;
DROP TABLE test.t2;
......@@ -31,3 +31,4 @@ a
2
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
......@@ -56,3 +56,4 @@ DROP PROCEDURE IF EXISTS test.p3;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP USER user1@localhost;
......@@ -5,6 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
STOP SLAVE;
SET @my_sql_mode= @@global.sql_mode;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
START SLAVE;
CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
......@@ -379,3 +380,4 @@ a b x
**** Cleanup ****
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
SET @@global.sql_mode= @my_sql_mode;
......@@ -5,6 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
STOP SLAVE;
SET @my_sql_mode= @@global.sql_mode;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
START SLAVE;
CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
......@@ -379,3 +380,4 @@ a b x
**** Cleanup ****
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
SET @@global.sql_mode= @my_sql_mode;
......@@ -5,6 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
STOP SLAVE;
SET @my_sql_mode= @@global.sql_mode;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
START SLAVE;
CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='NDB';
......@@ -284,3 +285,4 @@ SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t9;
SET @@global.sql_mode= @my_sql_mode;
......@@ -98,3 +98,4 @@ DROP TABLE IF EXISTS mysqltest1.t3;
DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t4;
DROP DATABASE mysqltest1;
......@@ -53,4 +53,5 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master NULL
drop table t1;
delete from mysql.user where user='rpl';
drop table t1;
......@@ -7,6 +7,7 @@ start slave;
drop database if exists mysqltest1;
create database mysqltest1;
use mysqltest1;
set @my_binlog_format= @@global.binlog_format;
set session binlog_format=row;
set global binlog_format=row;
show global variables like "binlog_format%";
......@@ -1003,3 +1004,4 @@ master-bin.000001 # Query 1 # use `mysqltest1`; CREATE TABLE t12 (data LONG)
master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t12)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
drop database mysqltest1;
set global binlog_format =@my_binlog_format;
......@@ -5801,6 +5801,7 @@ bug23760_rc_test(ROW_COUNT())
DROP TABLE bug23760, bug23760_log|
DROP PROCEDURE bug23760_update_log|
DROP PROCEDURE bug23760_test_row_count|
DROP PROCEDURE bug23760_test_row_count2|
DROP FUNCTION bug23760_rc_test|
DROP PROCEDURE IF EXISTS bug24117|
DROP TABLE IF EXISTS t3|
......
......@@ -78,3 +78,4 @@ alter table t1 modify a varchar(255);
select length(a) from t1;
length(a)
6
drop table t1;
......@@ -9,12 +9,11 @@ set @my_key_buffer_size =@@global.key_buffer_size;
set @my_max_binlog_cache_size =@@global.max_binlog_cache_size;
set @my_max_binlog_size =@@global.max_binlog_size;
set @my_max_connect_errors =@@global.max_connect_errors;
set @my_max_connections =@@global.max_connections;
set @my_max_delayed_threads =@@global.max_delayed_threads;
set @my_max_heap_table_size =@@global.max_heap_table_size;
set @my_max_insert_delayed_threads=@@global.max_insert_delayed_threads;
set @my_max_join_size =@@global.max_join_size;
set @my_max_user_connections =@@global.max_user_connections;
set @my_max_write_lock_count =@@global.max_write_lock_count;
set @my_myisam_data_pointer_size =@@global.myisam_data_pointer_size;
set @my_net_buffer_length =@@global.net_buffer_length;
set @my_net_write_timeout =@@global.net_write_timeout;
......@@ -922,12 +921,13 @@ set global key_buffer_size =@my_key_buffer_size;
set global max_binlog_cache_size =default;
set global max_binlog_size =@my_max_binlog_size;
set global max_connect_errors =@my_max_connect_errors;
set global max_connections =@my_max_connections;
set global max_delayed_threads =@my_max_delayed_threads;
set global max_heap_table_size =@my_max_heap_table_size;
set global max_insert_delayed_threads=@my_max_insert_delayed_threads;
set global max_join_size =@my_max_join_size;
set global max_user_connections =@my_max_user_connections;
set global max_write_lock_count =@my_max_write_lock_count;
set global max_user_connections =default;
set global max_write_lock_count =default;
set global myisam_data_pointer_size =@my_myisam_data_pointer_size;
set global net_buffer_length =@my_net_buffer_length;
set global net_write_timeout =@my_net_write_timeout;
......
......@@ -104,3 +104,5 @@ SET GLOBAL long_query_time =@old_global_long_query_time;
SET SESSION long_query_time =@old_session_long_query_time;
DROP DATABASE events_test;
SET GLOBAL event_scheduler=off;
......@@ -63,3 +63,4 @@ DROP TABLE table_2;
DROP TABLE table_3;
DROP TABLE table_4;
DROP DATABASE events_test;
SET GLOBAL event_scheduler=OFF;
......@@ -248,3 +248,5 @@ insert ignore into t1 values(NULL,100),(NULL,110),(NULL,120);
insert ignore into t1 values(NULL,10),(NULL,20),(NULL,110),(NULL,120),(NULL,100),(NULL,90);
insert ignore into t1 values(NULL,130),(NULL,140),(500,110),(550,120),(450,100),(NULL,150);
select * from t1 order by id;
drop table t1;
......@@ -108,4 +108,6 @@ drop user test;
drop table t1;
drop table t2;
sync_slave_with_master;
set global read_only=0;
......@@ -56,6 +56,7 @@ connection master;
# lets cleanup
DROP TABLE IF EXISTS mysqltest1.t1;
DROP FUNCTION mysqltest1.f1;
DROP DATABASE mysqltest1;
# Lets compare. Note: If they match test will pass, if they do not match
# the test will show that the diff statement failed and not reject file
......
......@@ -2,7 +2,7 @@
# Original Author: JBM #
# Original Date: Aug/18/2005 #
#############################################################################
# TEST: To test the UUID() in rbr #
# TEST: To test the USER() and CURRENT_USER() in rbr #
#############################################################################
# Change Author: JBM
# Change Date: 2006-01-16
......@@ -52,6 +52,8 @@ connection master;
DROP DATABASE mysqltest1;
REVOKE ALL ON mysqltest1.* FROM 'tester'@'%';
REVOKE ALL ON mysqltest1.* FROM ''@'localhost%';
DROP USER tester@'%';
DROP USER ''@'localhost%';
sync_slave_with_master;
......
......@@ -92,6 +92,8 @@ INSERT INTO t1 VALUES (7),(8),(9);
sync_slave_with_master;
SELECT * FROM t1;
SET GLOBAL QUERY_CACHE_SIZE=0;
# Bug#22550: Replication of BIT columns failing
--echo ================ Test for BUG#22550 ================
--disable_query_log
......@@ -113,3 +115,7 @@ UPDATE t1 SET a=0 WHERE b=2;
SELECT HEX(a),b FROM t1;
sync_slave_with_master;
SELECT HEX(a),b FROM t1;
connection master;
DROP TABLE t1;
sync_slave_with_master;
......@@ -90,6 +90,7 @@ connection master;
# Cleanup
DROP FUNCTION test.f1;
DROP TABLE test.t1;
DROP TABLE test.t2;
sync_slave_with_master;
# the test will show that the diff statement failed and no reject file
......
......@@ -51,6 +51,7 @@ SELECT * FROM test.t2;
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
sync_slave_with_master;
# End of 5.0 test case
......@@ -68,6 +68,7 @@ DROP PROCEDURE IF EXISTS test.p3;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP USER user1@localhost;
sync_slave_with_master;
# End of 5.0 test case
......
......@@ -82,6 +82,7 @@ DROP TABLE IF EXISTS mysqltest1.t3;
DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t4;
DROP DATABASE mysqltest1;
sync_slave_with_master;
# End of 5.1 test case
......
......@@ -49,6 +49,7 @@ show slave status;
# Cleanup (Note that slave IO thread is not running)
connection slave;
drop table t1;
delete from mysql.user where user='rpl';
connection master;
drop table t1;
......
......@@ -8,6 +8,10 @@ create database mysqltest1;
--enable_warnings
use mysqltest1;
# Save binlog format
set @my_binlog_format= @@global.binlog_format;
# Set binlog format to row
set session binlog_format=row;
set global binlog_format=row;
......@@ -542,3 +546,7 @@ diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_
drop database mysqltest1;
sync_slave_with_master;
connection master;
# Restore binlog format setting
set global binlog_format =@my_binlog_format;
......@@ -6755,6 +6755,7 @@ SELECT bug23760_rc_test(ROW_COUNT())|
DROP TABLE bug23760, bug23760_log|
DROP PROCEDURE bug23760_update_log|
DROP PROCEDURE bug23760_test_row_count|
DROP PROCEDURE bug23760_test_row_count2|
DROP FUNCTION bug23760_rc_test|
#
......
......@@ -83,4 +83,5 @@ insert into t1 values("aaa ");
select length(a) from t1;
alter table t1 modify a varchar(255);
select length(a) from t1;
drop table t1;
......@@ -18,12 +18,11 @@ set @my_key_buffer_size =@@global.key_buffer_size;
set @my_max_binlog_cache_size =@@global.max_binlog_cache_size;
set @my_max_binlog_size =@@global.max_binlog_size;
set @my_max_connect_errors =@@global.max_connect_errors;
set @my_max_connections =@@global.max_connections;
set @my_max_delayed_threads =@@global.max_delayed_threads;
set @my_max_heap_table_size =@@global.max_heap_table_size;
set @my_max_insert_delayed_threads=@@global.max_insert_delayed_threads;
set @my_max_join_size =@@global.max_join_size;
set @my_max_user_connections =@@global.max_user_connections;
set @my_max_write_lock_count =@@global.max_write_lock_count;
set @my_myisam_data_pointer_size =@@global.myisam_data_pointer_size;
set @my_net_buffer_length =@@global.net_buffer_length;
set @my_net_write_timeout =@@global.net_write_timeout;
......@@ -718,12 +717,13 @@ set global key_buffer_size =@my_key_buffer_size;
set global max_binlog_cache_size =default; #@my_max_binlog_cache_size;
set global max_binlog_size =@my_max_binlog_size;
set global max_connect_errors =@my_max_connect_errors;
set global max_connections =@my_max_connections;
set global max_delayed_threads =@my_max_delayed_threads;
set global max_heap_table_size =@my_max_heap_table_size;
set global max_insert_delayed_threads=@my_max_insert_delayed_threads;
set global max_join_size =@my_max_join_size;
set global max_user_connections =@my_max_user_connections;
set global max_write_lock_count =@my_max_write_lock_count;
set global max_user_connections =default;
set global max_write_lock_count =default;
set global myisam_data_pointer_size =@my_myisam_data_pointer_size;
set global net_buffer_length =@my_net_buffer_length;
set global net_write_timeout =@my_net_write_timeout;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment