Cleanup after test cases

parent a0f00ce9
......@@ -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;
......@@ -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
......
......@@ -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;
#
......
......@@ -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;
......@@ -33,3 +33,5 @@ n
1234
drop table t1;
stop slave;
drop database mysqltest1;
drop database mysqltest1;
......@@ -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";
......@@ -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;
......@@ -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
#
......@@ -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;
......@@ -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;
......@@ -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;
......@@ -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);
......
......@@ -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;
......
......@@ -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
......
......@@ -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;
......
......@@ -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
......@@ -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;
......@@ -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";
......@@ -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
......@@ -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 #
......@@ -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;
......@@ -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;
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;
......@@ -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;
......
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