diff options
author | unknown <msvensson@neptunus.(none)> | 2006-11-15 10:23:27 +0100 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2006-11-15 10:23:27 +0100 |
commit | 8b8647ff42757f0908340b054ec3d74c56ebfcb0 (patch) | |
tree | 7a8705274fa8b0035377163641ecf440b1e5e39c /mysql-test | |
parent | b7dd49b01622a37ce07a0b8020a27c124e9f846b (diff) | |
download | mariadb-git-8b8647ff42757f0908340b054ec3d74c56ebfcb0.tar.gz |
Cleanup after test cases
mysql-test/r/init_connect.result:
Restore global variable to the value it's set to when server is started
mysql-test/r/key_cache.result:
Restore global variable values to original
mysql-test/r/mysqldump.result:
Drop the user that was created. Specifying "drop user myDB_user" is equal to "drop user myDB_user@%"
mysql-test/r/rpl_deadlock.result:
Restore global variable values to original
mysql-test/r/rpl_drop_db.result:
Remove the conflicting file and drop database mysqltest1 before test exits
mysql-test/r/rpl_ignore_revoke.result:
As changes to mysql.* are ignored - explicitly delete the user on slave
mysql-test/r/rpl_init_slave.result:
Restore global variable values to original
mysql-test/r/rpl_max_relay_size.result:
Restore global variable values to original
mysql-test/r/rpl_sp.result:
Restore global variable values to original
mysql-test/r/rpl_timezone.result:
Restore global variable values to original
mysql-test/r/rpl_variables.result:
Restore global variable values to original
mysql-test/r/view_grant.result:
Use same user in all places in the same test "readonly" is equal to "readonly@%" not "readonly@localhost"
mysql-test/t/init_connect.test:
Restore global variable to the value it's set to when server is started
mysql-test/t/key_cache.test:
Restore global variable values to original
mysql-test/t/mysqldump.test:
Drop the user that was created. Specifying "drop user myDB_user" is equal to "drop user myDB_user@%"
mysql-test/t/rpl_deadlock.test:
Restore global variable values to original
mysql-test/t/rpl_drop_db.test:
Remove the conflicting file and drop database mysqltest1 before test exits
mysql-test/t/rpl_ignore_revoke.test:
As changes to mysql.* are ignored - explicitly delete the user on slave
mysql-test/t/rpl_init_slave.test:
Restore global variable values to original
mysql-test/t/rpl_max_relay_size.test:
Restore global variable values to original
mysql-test/t/rpl_sp.test:
Restore global variable values to original
mysql-test/t/rpl_timezone.test:
Restore global variable values to original
mysql-test/t/rpl_variables.test:
Restore global variable values to original
mysql-test/t/view_grant.test:
Use same user in all places in the same test "readonly" is equal to "readonly@%" not "readonly@localhost"
Diffstat (limited to 'mysql-test')
24 files changed, 93 insertions, 26 deletions
diff --git a/mysql-test/r/init_connect.result b/mysql-test/r/init_connect.result index f90ee5913a1..f5ec0bdc932 100644 --- a/mysql-test/r/init_connect.result +++ b/mysql-test/r/init_connect.result @@ -132,7 +132,7 @@ x 17 19 drop trigger trg1; -set global init_connect=default; +set global init_connect="set @a='a\\0c'"; revoke all privileges, grant option from mysqltest1@localhost; drop user mysqltest1@localhost; drop table t1, t2; diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result index 406a92b9a08..a1bf3d0e128 100644 --- a/mysql-test/r/key_cache.result +++ b/mysql-test/r/key_cache.result @@ -284,12 +284,15 @@ insert t1 values ('aaabbb'); check table t1; Table Op Msg_type Msg_text test.t1 check status OK +set @my_key_cache_block_size= @@global.key_cache_block_size; set GLOBAL key_cache_block_size=2048; check table t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; +set global key_cache_block_size= @my_key_cache_block_size; CREATE TABLE t1(a int NOT NULL AUTO_INCREMENT PRIMARY KEY); +SET @my_key_cache_block_size= @@global.key_cache_block_size; SET GLOBAL key_cache_block_size=1536; INSERT INTO t1 VALUES (1); SELECT @@key_cache_block_size; @@ -331,6 +334,7 @@ CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1,t2; +set global key_cache_block_size= @my_key_cache_block_size; set @@global.key_buffer_size=0; Warnings: Warning 1438 Cannot drop default keycache diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 54583febbc8..35a79d6a805 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -3089,7 +3089,7 @@ drop user mysqltest_1@localhost; # create database mysqldump_myDB; use mysqldump_myDB; -create user myDB_User; +create user myDB_User@localhost; grant create, create view, select, insert on mysqldump_myDB.* to myDB_User@localhost; create table t1 (c1 int); insert into t1 values (3); @@ -3102,7 +3102,7 @@ drop view v1; drop table t1; drop table u1; revoke all privileges on mysqldump_myDB.* from myDB_User@localhost; -drop user myDB_User; +drop user myDB_User@localhost; drop database mysqldump_myDB; flush privileges; # Bug #21424 continues from here. @@ -3120,7 +3120,7 @@ drop view v1; drop table t1; drop table u1; revoke all privileges on mysqldump_myDB.* from myDB_User@localhost; -drop user myDB_User; +drop user myDB_User@localhost; drop database mysqldump_myDB; use test; # diff --git a/mysql-test/r/rpl_deadlock.result b/mysql-test/r/rpl_deadlock.result index 541e12b806f..63b15bc1a1f 100644 --- a/mysql-test/r/rpl_deadlock.result +++ b/mysql-test/r/rpl_deadlock.result @@ -126,6 +126,7 @@ Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # +set @my_max_relay_log_size= @@global.max_relay_log_size; set global max_relay_log_size=0; stop slave; change master to master_log_pos=532; @@ -178,3 +179,4 @@ Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # drop table t1,t2,t3,t4; +set global max_relay_log_size= @my_max_relay_log_size; diff --git a/mysql-test/r/rpl_drop_db.result b/mysql-test/r/rpl_drop_db.result index ce9d39e87f6..97a24d980b6 100644 --- a/mysql-test/r/rpl_drop_db.result +++ b/mysql-test/r/rpl_drop_db.result @@ -33,3 +33,5 @@ n 1234 drop table t1; stop slave; +drop database mysqltest1; +drop database mysqltest1; diff --git a/mysql-test/r/rpl_ignore_revoke.result b/mysql-test/r/rpl_ignore_revoke.result index 42625119f28..b1ccd2f0442 100644 --- a/mysql-test/r/rpl_ignore_revoke.result +++ b/mysql-test/r/rpl_ignore_revoke.result @@ -27,3 +27,4 @@ select_priv Y revoke select on *.* FROM 'user_foo'; delete from mysql.user where user="user_foo"; +delete from mysql.user where user="user_foo"; diff --git a/mysql-test/r/rpl_init_slave.result b/mysql-test/r/rpl_init_slave.result index 83d0a3289a2..f92fb9b4c1d 100644 --- a/mysql-test/r/rpl_init_slave.result +++ b/mysql-test/r/rpl_init_slave.result @@ -17,8 +17,11 @@ init_slave show variables like 'max_connections'; Variable_name Value max_connections 100 +set @my_global_init_connect= @@global.init_connect; set global init_connect="set @c=1"; show variables like 'init_connect'; Variable_name Value init_connect set @c=1 stop slave; +set global init_connect= @my_global_init_connect; +set global max_connections= default; diff --git a/mysql-test/r/rpl_max_relay_size.result b/mysql-test/r/rpl_max_relay_size.result index 1fa49db6013..95c9ae79d05 100644 --- a/mysql-test/r/rpl_max_relay_size.result +++ b/mysql-test/r/rpl_max_relay_size.result @@ -14,6 +14,7 @@ reset slave; # # Test 1 # +set @my_max_binlog_size= @@global.max_binlog_size; set global max_binlog_size=8192; set global max_relay_log_size=8192-1; select @@global.max_relay_log_size; @@ -266,6 +267,7 @@ File master-bin.000002 Position 98 Binlog_Do_DB Binlog_Ignore_DB +set global max_binlog_size= @my_max_binlog_size; # # End of 4.1 tests # diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result index 7b096b27733..7f152862373 100644 --- a/mysql-test/r/rpl_sp.result +++ b/mysql-test/r/rpl_sp.result @@ -465,3 +465,5 @@ RETURN 0 DROP PROCEDURE p1; DROP FUNCTION f1; drop table t1; +set global log_bin_trust_function_creators=0; +set global log_bin_trust_function_creators=0; diff --git a/mysql-test/r/rpl_timezone.result b/mysql-test/r/rpl_timezone.result index 96a892f00fc..fde8709843e 100644 --- a/mysql-test/r/rpl_timezone.result +++ b/mysql-test/r/rpl_timezone.result @@ -4,6 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +set @my_time_zone= @@global.time_zone; set timestamp=100000000; create table t1 (t timestamp); create table t2 (t char(32)); @@ -126,3 +127,4 @@ t 2003-12-31 23:00:00 2005-01-01 08:00:00 drop table t1, t2; +set global time_zone= @my_time_zone; diff --git a/mysql-test/r/rpl_variables.result b/mysql-test/r/rpl_variables.result index 25b5ca13f77..6c532e33983 100644 --- a/mysql-test/r/rpl_variables.result +++ b/mysql-test/r/rpl_variables.result @@ -4,6 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +set @my_slave_net_timeout =@@global.slave_net_timeout; set global slave_net_timeout=100; set global sql_slave_skip_counter=100; show variables like 'slave_compressed_protocol'; @@ -15,3 +16,4 @@ slave_load_tmpdir SLAVE_LOAD_TMPDIR show variables like 'slave_skip_errors'; Variable_name Value slave_skip_errors 3,100,137,643,1752 +set global slave_net_timeout =@my_slave_net_timeout; diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result index 35e7afc0a7b..cf9ba1c604d 100644 --- a/mysql-test/r/view_grant.result +++ b/mysql-test/r/view_grant.result @@ -544,13 +544,13 @@ CREATE SQL SECURITY DEFINER VIEW mysqltest1.v_tu AS SELECT * FROM mysqltest1.t1; CREATE SQL SECURITY DEFINER VIEW mysqltest1.v_tus AS SELECT * FROM mysqltest1.t1; CREATE SQL SECURITY DEFINER VIEW mysqltest1.v_td AS SELECT * FROM mysqltest1.t1; CREATE SQL SECURITY DEFINER VIEW mysqltest1.v_tds AS SELECT * FROM mysqltest1.t1; -GRANT SELECT, INSERT, UPDATE, DELETE ON mysqltest1.v_t1 TO readonly; -GRANT SELECT ON mysqltest1.v_ts TO readonly; -GRANT INSERT ON mysqltest1.v_ti TO readonly; -GRANT UPDATE ON mysqltest1.v_tu TO readonly; -GRANT UPDATE,SELECT ON mysqltest1.v_tus TO readonly; -GRANT DELETE ON mysqltest1.v_td TO readonly; -GRANT DELETE,SELECT ON mysqltest1.v_tds TO readonly; +GRANT SELECT, INSERT, UPDATE, DELETE ON mysqltest1.v_t1 TO readonly@localhost; +GRANT SELECT ON mysqltest1.v_ts TO readonly@localhost; +GRANT INSERT ON mysqltest1.v_ti TO readonly@localhost; +GRANT UPDATE ON mysqltest1.v_tu TO readonly@localhost; +GRANT UPDATE,SELECT ON mysqltest1.v_tus TO readonly@localhost; +GRANT DELETE ON mysqltest1.v_td TO readonly@localhost; +GRANT DELETE,SELECT ON mysqltest1.v_tds TO readonly@localhost; SELECT * FROM mysqltest1.v_t1; ERROR HY000: View 'mysqltest1.v_t1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them INSERT INTO mysqltest1.v_t1 VALUES(4); diff --git a/mysql-test/t/init_connect.test b/mysql-test/t/init_connect.test index 31a98df33df..cf98f608982 100644 --- a/mysql-test/t/init_connect.test +++ b/mysql-test/t/init_connect.test @@ -232,7 +232,9 @@ connection con0; disconnect con1; drop trigger trg1; -set global init_connect=default; +# Set init connect back to the value provided in init_connect-master.opt +# doesn't matter as server will be restarted +set global init_connect="set @a='a\\0c'"; revoke all privileges, grant option from mysqltest1@localhost; drop user mysqltest1@localhost; diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index 4001e0df4af..3044964ebc3 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -164,16 +164,19 @@ create table t1 (mytext text, FULLTEXT (mytext)); insert t1 values ('aaabbb'); check table t1; +set @my_key_cache_block_size= @@global.key_cache_block_size; set GLOBAL key_cache_block_size=2048; check table t1; - drop table t1; +# Restore the changed variable value +set global key_cache_block_size= @my_key_cache_block_size; # # Bug #19079: corrupted index when key_cache_block_size is not multiple of # myisam_block_size CREATE TABLE t1(a int NOT NULL AUTO_INCREMENT PRIMARY KEY); +SET @my_key_cache_block_size= @@global.key_cache_block_size; SET GLOBAL key_cache_block_size=1536; INSERT INTO t1 VALUES (1); SELECT @@key_cache_block_size; @@ -206,6 +209,8 @@ SELECT COUNT(*) FROM t1; SELECT @@key_cache_block_size; CHECK TABLE t1; DROP TABLE t1,t2; +# Restore changed variables +set global key_cache_block_size= @my_key_cache_block_size; # # Bug#10473 - Can't set 'key_buffer_size' system variable to ZERO diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 72aad395ec0..5e604061744 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -1341,7 +1341,7 @@ connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); connection root; create database mysqldump_myDB; use mysqldump_myDB; -create user myDB_User; +create user myDB_User@localhost; grant create, create view, select, insert on mysqldump_myDB.* to myDB_User@localhost; create table t1 (c1 int); insert into t1 values (3); @@ -1364,7 +1364,7 @@ drop view v1; drop table t1; drop table u1; revoke all privileges on mysqldump_myDB.* from myDB_User@localhost; -drop user myDB_User; +drop user myDB_User@localhost; drop database mysqldump_myDB; flush privileges; @@ -1389,7 +1389,7 @@ drop view v1; drop table t1; drop table u1; revoke all privileges on mysqldump_myDB.* from myDB_User@localhost; -drop user myDB_User; +drop user myDB_User@localhost; drop database mysqldump_myDB; use test; diff --git a/mysql-test/t/rpl_deadlock.test b/mysql-test/t/rpl_deadlock.test index 684cb54611c..1a48e4d417c 100644 --- a/mysql-test/t/rpl_deadlock.test +++ b/mysql-test/t/rpl_deadlock.test @@ -92,7 +92,7 @@ show slave status; # Now we repeat 2), but with BEGIN in the same relay log as # COMMIT (to see if seeking into hot log is ok). - +set @my_max_relay_log_size= @@global.max_relay_log_size; set global max_relay_log_size=0; # This is really copy-paste of 2) of above @@ -115,5 +115,6 @@ show slave status; connection master; drop table t1,t2,t3,t4; sync_slave_with_master; +set global max_relay_log_size= @my_max_relay_log_size; # End of 4.1 tests diff --git a/mysql-test/t/rpl_drop_db.test b/mysql-test/t/rpl_drop_db.test index 3ac0d593fee..f14c9bc0164 100644 --- a/mysql-test/t/rpl_drop_db.test +++ b/mysql-test/t/rpl_drop_db.test @@ -53,5 +53,10 @@ sync_slave_with_master; #cleanup connection slave; stop slave; -system rm -rf $MYSQLTEST_VARDIR/master-data/mysqltest1; +drop database mysqltest1; + +connection master; +# Remove the "extra" file created above +--remove_file $MYSQLTEST_VARDIR/master-data/mysqltest1/f1.txt +drop database mysqltest1; diff --git a/mysql-test/t/rpl_ignore_revoke.test b/mysql-test/t/rpl_ignore_revoke.test index cdeb40df069..00171605a92 100644 --- a/mysql-test/t/rpl_ignore_revoke.test +++ b/mysql-test/t/rpl_ignore_revoke.test @@ -45,3 +45,7 @@ revoke select on *.* FROM 'user_foo'; connection master; delete from mysql.user where user="user_foo"; sync_slave_with_master; + +# Since changes to mysql.* are ignored, the revoke need to +# be done on slave as well +delete from mysql.user where user="user_foo"; diff --git a/mysql-test/t/rpl_init_slave.test b/mysql-test/t/rpl_init_slave.test index cefb04a7b75..139b4902e12 100644 --- a/mysql-test/t/rpl_init_slave.test +++ b/mysql-test/t/rpl_init_slave.test @@ -17,6 +17,8 @@ show variables like 'max_connections'; save_master_pos; connection slave; sync_with_master; +# Save variable value +set @my_global_init_connect= @@global.init_connect; set global init_connect="set @c=1"; show variables like 'init_connect'; connection master; @@ -25,4 +27,8 @@ connection slave; sync_with_master; stop slave; +# Restore changed global variable +set global init_connect= @my_global_init_connect; +set global max_connections= default; + # End of 4.1 tests diff --git a/mysql-test/t/rpl_max_relay_size.test b/mysql-test/t/rpl_max_relay_size.test index be1fbf172fc..e5278ff5727 100644 --- a/mysql-test/t/rpl_max_relay_size.test +++ b/mysql-test/t/rpl_max_relay_size.test @@ -32,6 +32,7 @@ reset slave; --echo # Test 1 --echo # +set @my_max_binlog_size= @@global.max_binlog_size; set global max_binlog_size=8192; set global max_relay_log_size=8192-1; # mapped to 4096 select @@global.max_relay_log_size; @@ -127,6 +128,10 @@ connection master; flush logs; show master status; +# Restore max_binlog_size +connection slave; +set global max_binlog_size= @my_max_binlog_size; + --echo # --echo # End of 4.1 tests --echo # diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/t/rpl_sp.test index 7479794eded..b2a34a63735 100644 --- a/mysql-test/t/rpl_sp.test +++ b/mysql-test/t/rpl_sp.test @@ -519,3 +519,9 @@ DROP FUNCTION f1; connection master; drop table t1; sync_slave_with_master; + +# Restore log_bin_trust_function_creators to original value +set global log_bin_trust_function_creators=0; +connection master; +set global log_bin_trust_function_creators=0; + diff --git a/mysql-test/t/rpl_timezone.test b/mysql-test/t/rpl_timezone.test index 0f35c9dc0b6..6ed5b21ace0 100644 --- a/mysql-test/t/rpl_timezone.test +++ b/mysql-test/t/rpl_timezone.test @@ -12,6 +12,9 @@ source include/master-slave.inc; +# Save original timezone +set @my_time_zone= @@global.time_zone; + # Some preparations let $VERSION=`select version()`; set timestamp=100000000; # for fixed output of mysqlbinlog @@ -124,3 +127,7 @@ drop table t1, t2; sync_slave_with_master; # End of 4.1 tests + +# Restore original timezone +connection master; +set global time_zone= @my_time_zone; diff --git a/mysql-test/t/rpl_variables.test b/mysql-test/t/rpl_variables.test index 57ae2b9c3c4..d0801e524e4 100644 --- a/mysql-test/t/rpl_variables.test +++ b/mysql-test/t/rpl_variables.test @@ -1,5 +1,8 @@ source include/master-slave.inc; +# Init for rstore of variable values +set @my_slave_net_timeout =@@global.slave_net_timeout; + set global slave_net_timeout=100; set global sql_slave_skip_counter=100; @@ -12,3 +15,6 @@ show variables like 'slave_load_tmpdir'; # We just set some arbitrary values in variables-master.opt so we can test # that a list of values works correctly show variables like 'slave_skip_errors'; + +# Restore touched values +set global slave_net_timeout =@my_slave_net_timeout; diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test index 8bc34cfe148..9a4b75add13 100644 --- a/mysql-test/t/view_grant.test +++ b/mysql-test/t/view_grant.test @@ -727,13 +727,13 @@ CREATE SQL SECURITY DEFINER VIEW mysqltest1.v_tu AS SELECT * FROM mysqltest1.t1; CREATE SQL SECURITY DEFINER VIEW mysqltest1.v_tus AS SELECT * FROM mysqltest1.t1; CREATE SQL SECURITY DEFINER VIEW mysqltest1.v_td AS SELECT * FROM mysqltest1.t1; CREATE SQL SECURITY DEFINER VIEW mysqltest1.v_tds AS SELECT * FROM mysqltest1.t1; -GRANT SELECT, INSERT, UPDATE, DELETE ON mysqltest1.v_t1 TO readonly; -GRANT SELECT ON mysqltest1.v_ts TO readonly; -GRANT INSERT ON mysqltest1.v_ti TO readonly; -GRANT UPDATE ON mysqltest1.v_tu TO readonly; -GRANT UPDATE,SELECT ON mysqltest1.v_tus TO readonly; -GRANT DELETE ON mysqltest1.v_td TO readonly; -GRANT DELETE,SELECT ON mysqltest1.v_tds TO readonly; +GRANT SELECT, INSERT, UPDATE, DELETE ON mysqltest1.v_t1 TO readonly@localhost; +GRANT SELECT ON mysqltest1.v_ts TO readonly@localhost; +GRANT INSERT ON mysqltest1.v_ti TO readonly@localhost; +GRANT UPDATE ON mysqltest1.v_tu TO readonly@localhost; +GRANT UPDATE,SELECT ON mysqltest1.v_tus TO readonly@localhost; +GRANT DELETE ON mysqltest1.v_td TO readonly@localhost; +GRANT DELETE,SELECT ON mysqltest1.v_tds TO readonly@localhost; CONNECT (n1,localhost,readonly,,); CONNECTION n1; @@ -791,7 +791,7 @@ DROP VIEW mysqltest1.v_ti; DROP VIEW mysqltest1.v_ts; DROP VIEW mysqltest1.v_t1; DROP TABLE mysqltest1.t1; -DROP USER readonly@localhost; +DROP USER readonly@localhost; DROP DATABASE mysqltest1; # |