diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2016-03-26 00:16:36 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2016-03-27 17:39:30 +0400 |
commit | 4ee310cfaee1339d2508cc6a62d9685e1f14af69 (patch) | |
tree | cbcf9e3b8aec9f014c1a8e9d8bdbc31976d797d6 /mysql-test | |
parent | fcde9a889dc12b21823b9c4e1776d0329a99c48d (diff) | |
download | mariadb-git-bb-10.2-MDEV-6720.tar.gz |
MDEV-6720 - enable connection log in mysqltest by defaultbb-10.2-MDEV-6720
Additional fixes.
Diffstat (limited to 'mysql-test')
32 files changed, 432 insertions, 111 deletions
diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc index c837eb7a7ad..bfe1567691d 100644 --- a/mysql-test/include/mix1.inc +++ b/mysql-test/include/mix1.inc @@ -647,23 +647,19 @@ CREATE TABLE t2 (a INT) ENGINE=InnoDB; CONNECT (c1,localhost,root,,); CONNECT (c2,localhost,root,,); ---echo switch to connection c1 CONNECTION c1; SET AUTOCOMMIT=0; INSERT INTO t2 VALUES (1); ---echo switch to connection c2 CONNECTION c2; SET AUTOCOMMIT=0; --error ER_LOCK_WAIT_TIMEOUT LOCK TABLES t1 READ, t2 READ; ---echo switch to connection c1 CONNECTION c1; COMMIT; INSERT INTO t1 VALUES (1); ---echo switch to connection default CONNECTION default; SET AUTOCOMMIT=default; DISCONNECT c1; @@ -1327,7 +1323,6 @@ connect (con2,localhost,root,,); SET SESSION AUTOCOMMIT = 0; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; set binlog_format=mixed; ---echo # Switch to connection con1 connection con1; eval @@ -1343,7 +1338,6 @@ UPDATE t1 SET b = 12 WHERE a = 1; --disable_info SELECT * FROM t1; ---echo # Switch to connection con2 connection con2; --enable_info @@ -1352,16 +1346,13 @@ connection con2; UPDATE t1 SET b = 21 WHERE a = 1; --disable_info ---echo # Switch to connection con1 connection con1; SELECT * FROM t1; ROLLBACK; ---echo # Switch to connection con2 connection con2; ROLLBACK; ---echo # Switch to connection con1 connection con1; --echo # 2. test for serialized update: @@ -1395,12 +1386,10 @@ UPDATE t1 SET b = CONCAT(b, '+con1') WHERE a = 1; --disable_info SELECT * FROM t1; ---echo # Switch to connection con2 connection con2; --send CALL p1; ---echo # Switch to connection con1 connection con1; SELECT * FROM t1; COMMIT; @@ -1413,13 +1402,11 @@ while ($bug31310) SELECT * FROM t1; ---echo # Switch to connection con2 connection con2; --reap SELECT * FROM t1; COMMIT; ---echo # Switch to connection con1 connection con1; --echo # 3. test for updated key column: @@ -1435,12 +1422,10 @@ UPDATE t1 SET a = 2, b = CONCAT(b, '+con1') WHERE a = 1; --disable_info SELECT * FROM t1; ---echo # Switch to connection con2 connection con2; --send CALL p1; ---echo # Switch to connection con1 connection con1; SELECT * FROM t1; COMMIT; @@ -1453,7 +1438,6 @@ while ($bug31310) SELECT * FROM t1; ---echo # Switch to connection con2 connection con2; --reap SELECT * FROM t1; @@ -1616,23 +1600,18 @@ eval CREATE TABLE t1 (a INT) ENGINE=$engine_type; INSERT INTO t1 VALUES (1),(2),(3); BEGIN; SELECT * FROM t1 ORDER BY a; ---echo # Connection con1 connect (con1, localhost, root,,); --send TRUNCATE TABLE t1; ---echo # Connection default connection default; let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist WHERE state='Waiting for table metadata lock' AND info='TRUNCATE TABLE t1'; --source include/wait_condition.inc SELECT * FROM t1 ORDER BY a; ROLLBACK; ---echo # Connection con1 connection con1; --echo # Reaping TRUNCATE TABLE --reap SELECT * FROM t1; ---echo # Disconnect con1 disconnect con1; ---echo # Connection default connection default; DROP TABLE t1; diff --git a/mysql-test/r/alter_table-big.result b/mysql-test/r/alter_table-big.result index f7a3ec6502e..32689daa3a6 100644 --- a/mysql-test/r/alter_table-big.result +++ b/mysql-test/r/alter_table-big.result @@ -1,5 +1,8 @@ drop table if exists t1, t2; set debug_sync='RESET'; +connect addconroot, localhost, root,,; +connect addconroot2, localhost, root,,; +connection default; create table t1 (n1 int, n2 int, n3 int, key (n1, n2, n3), key (n2, n3, n1), @@ -10,10 +13,15 @@ insert into t1 values (1, 2, 3); reset master; set debug_sync='alter_table_enable_indexes SIGNAL parked WAIT_FOR go'; alter table t1 enable keys;; +connection addconroot; set debug_sync='now WAIT_FOR parked'; insert into t2 values (1); insert into t1 values (1, 1, 1);; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot; +connection default; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # BEGIN GTID #-#-# @@ -25,36 +33,60 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test`; insert into t1 values (1, 1, 1) master-bin.000001 # Query # # COMMIT drop tables t1, t2; +disconnect addconroot; +disconnect addconroot2; set debug_sync='RESET'; End of 5.0 tests drop table if exists t1, t2, t3; +connect addconroot, localhost, root,,; +connect addconroot2, localhost, root,,; +connection default; create table t1 (i int); reset master; set debug_sync='alter_table_before_main_binlog SIGNAL parked WAIT_FOR go'; alter table t1 change i c char(10) default 'Test1';; +connection addconroot; set debug_sync='now WAIT_FOR parked'; insert into t1 values ();; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot; +connection default; select * from t1; c Test1 set debug_sync='alter_table_before_main_binlog SIGNAL parked WAIT_FOR go'; alter table t1 change c vc varchar(100) default 'Test2';; +connection addconroot; set debug_sync='now WAIT_FOR parked'; rename table t1 to t2;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot; +connection default; drop table t2; create table t1 (i int); set debug_sync='alter_table_before_main_binlog SIGNAL parked WAIT_FOR go'; alter table t1 change i c char(10) default 'Test3', rename to t2;; +connection addconroot; set debug_sync='now WAIT_FOR parked'; insert into t2 values();; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot; +connection default; select * from t2; c Test3 alter table t2 change c vc varchar(100) default 'Test2', rename to t1;; +connection addconroot; +connection default; rename table t1 to t3; +disconnect addconroot; +disconnect addconroot2; drop table t3; set debug_sync='alter_table_before_main_binlog SIGNAL parked WAIT_FOR go'; set debug_sync='RESET'; diff --git a/mysql-test/r/auth_named_pipe.result b/mysql-test/r/auth_named_pipe.result index 3268b760a22..fb190ccd149 100644 --- a/mysql-test/r/auth_named_pipe.result +++ b/mysql-test/r/auth_named_pipe.result @@ -1,8 +1,11 @@ INSTALL SONAME 'auth_named_pipe'; CREATE USER 'USERNAME' IDENTIFIED WITH named_pipe; +connect pipe_con,localhost,$USERNAME,,,,,PIPE; SELECT USER(),CURRENT_USER(); USER() CURRENT_USER() USERNAME@localhost USERNAME@% +disconnect pipe_con; +connection default; DROP USER 'USERNAME'; CREATE USER nosuchuser IDENTIFIED WITH named_pipe; ERROR 28000: Access denied for user 'nosuchuser'@'localhost' diff --git a/mysql-test/r/create-big.result b/mysql-test/r/create-big.result index bb8c62bb25c..d041419443e 100644 --- a/mysql-test/r/create-big.result +++ b/mysql-test/r/create-big.result @@ -1,11 +1,20 @@ +connect addconroot1, localhost, root,,; +connect addconroot2, localhost, root,,; +connect addconroot3, localhost, root,,; +connection default; drop table if exists t1,t2,t3,t4,t5; set debug_sync='RESET'; set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; create table t1 (j char(5));; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; ERROR 42S01: Table 't1' already exists +connection default; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -14,10 +23,15 @@ t1 CREATE TABLE `t1` ( drop table t1; set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; create table t1 select 'Test' as j;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; ERROR 42S01: Table 't1' already exists +connection default; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -27,10 +41,15 @@ drop table t1; create table t3 (j char(5)); set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; create table t1 like t3;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; ERROR 42S01: Table 't1' already exists +connection default; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -39,10 +58,15 @@ t1 CREATE TABLE `t1` ( drop table t1; set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; rename table t3 to t1;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; ERROR 42S01: Table 't1' already exists +connection default; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -51,10 +75,15 @@ t1 CREATE TABLE `t1` ( drop table t1; set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; alter table t3 rename to t1; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; ERROR 42S01: Table 't1' already exists +connection default; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -63,10 +92,15 @@ t1 CREATE TABLE `t1` ( drop table t1; set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; alter table t3 rename to t1, add k int; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; ERROR 42S01: Table 't1' already exists +connection default; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -74,30 +108,51 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t3; set debug_sync='create_table_select_before_open SIGNAL parked WAIT_FOR go'; +connection default; set debug_sync='create_table_select_before_open SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; drop table t1;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; +connection default; set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; rename table t1 to t2;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; +connection default; drop table t2; set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; select * from t1;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; i 1 +connection default; drop table t1; set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; insert into t1 values (2);; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; +connection default; select * from t1; i 1 @@ -106,37 +161,62 @@ drop table t1; set @a:=0; set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; create trigger t1_bi before insert on t1 for each row set @a:=1;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; +connection default; select @a; @a 0 drop table t1; set debug_sync='create_table_select_before_lock SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; drop table t1;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; +connection default; set debug_sync='create_table_select_before_lock SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; rename table t1 to t2;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; +connection default; drop table t2; set debug_sync='create_table_select_before_lock SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; select * from t1;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; i 1 +connection default; drop table t1; set debug_sync='create_table_select_before_lock SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; insert into t1 values (2);; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; +connection default; select * from t1; i 1 @@ -145,27 +225,42 @@ drop table t1; set @a:=0; set debug_sync='create_table_select_before_lock SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; create trigger t1_bi before insert on t1 for each row set @a:=1;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; +connection default; select @a; @a 0 drop table t1; set debug_sync='create_table_select_before_check_if_exists SIGNAL parked WAIT_FOR go'; create table if not exists t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; drop table t1;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; +connection default; create table t1 (i int); set @a:=0; set debug_sync='create_table_select_before_check_if_exists SIGNAL parked WAIT_FOR go'; create table if not exists t1 select 1 as i;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; create trigger t1_bi before insert on t1 for each row set @a:=1;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; Warnings: Note 1050 Table 't1' already exists +connection addconroot1; +connection default; select @a; @a 0 @@ -178,10 +273,15 @@ create table t1 (i int); set debug_sync='create_table_like_after_open SIGNAL parked WAIT_FOR go'; reset master; create table t2 like t1;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; insert into t1 values (1); drop table t1;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; +connection default; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -203,21 +303,39 @@ create table t1 (i int); set debug_sync='create_table_like_before_binlog SIGNAL parked WAIT_FOR go'; reset master; create table t2 like t1;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; insert into t2 values (1);; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; +connection default; drop table t2; set debug_sync='create_table_like_before_binlog SIGNAL parked WAIT_FOR go'; create table t2 like t1;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; drop table t2;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; +connection default; set debug_sync='create_table_like_before_binlog SIGNAL parked WAIT_FOR go'; create table t2 like t1;; +connection addconroot1; set debug_sync='now WAIT_FOR parked'; drop table t1;; +connection addconroot2; set debug_sync='now SIGNAL go'; +connection default; +connection addconroot1; +connection default; drop table t2; +disconnect addconroot1; +disconnect addconroot2; +disconnect addconroot3; set debug_sync='RESET'; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info diff --git a/mysql-test/r/events_stress.result b/mysql-test/r/events_stress.result index 6015e7c53eb..1a91ff0f528 100644 --- a/mysql-test/r/events_stress.result +++ b/mysql-test/r/events_stress.result @@ -9,8 +9,11 @@ GRANT ALL ON *.* TO event_user2@localhost; CREATE USER event_user3@localhost; CREATE DATABASE events_conn3_db; GRANT ALL ON *.* TO event_user3@localhost; +connect conn2,localhost,event_user2,,events_conn2_db; "In the second connection we create some events which won't be dropped till the end" +connect conn3,localhost,event_user3,,events_conn3_db; "In the second connection we create some events which won't be dropped till the end" +connection default; USE events_conn1_test2; CREATE EVENT ev_drop1 ON SCHEDULE EVERY 10 MINUTE DISABLE DO SELECT 1; CREATE EVENT ev_drop2 ON SCHEDULE EVERY 10 MINUTE DISABLE DO SELECT 1; @@ -52,13 +55,21 @@ USE events_conn1_test2; SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2'; COUNT(*) 50 +connection conn2; DROP DATABASE events_conn2_db; +connection conn3; DROP DATABASE events_conn3_db; +connection default; DROP DATABASE events_conn1_test2; DROP DATABASE events_conn1_test3; SET GLOBAL event_scheduler=off; DROP DATABASE events_conn1_test4; SET GLOBAL event_scheduler=on; +connection conn2; +disconnect conn2; +connection conn3; +disconnect conn3; +connection default; USE events_test; DROP TABLE fill_it1; DROP TABLE fill_it2; diff --git a/mysql-test/r/grant_cache_ps_prot.result b/mysql-test/r/grant_cache_ps_prot.result index 5fe57c7c35d..56a98cc076d 100644 --- a/mysql-test/r/grant_cache_ps_prot.result +++ b/mysql-test/r/grant_cache_ps_prot.result @@ -7,7 +7,8 @@ set LOCAL query_cache_type=ON; set GLOBAL query_cache_size=1355776; reset query cache; flush status; ------ establish connection root ----- +connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK; +connection root; show grants for current_user; Grants for root@localhost GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION @@ -26,7 +27,8 @@ insert into test.t1 values ("test.t1"); select * from t1; a test.t1 ------ establish connection root2 ----- +connect root2,localhost,root,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK; +connection root2; select * from t1; a b c 1 1 1 @@ -56,7 +58,8 @@ grant SELECT on mysqltest.* to mysqltest_1@localhost; grant SELECT on mysqltest.t1 to mysqltest_2@localhost; grant SELECT on test.t1 to mysqltest_2@localhost; grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost; ------ establish connection user1 (user=mysqltest_1) ----- +connect user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK; +connection user1; show grants for current_user(); Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' @@ -121,11 +124,13 @@ Qcache_hits 3 show status like "Qcache_not_cached"; Variable_name Value Qcache_not_cached 1 ------ establish connection unkuser (user=unkuser) ----- +connect unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK; +connection unkuser; show grants for current_user(); Grants for @localhost GRANT USAGE ON *.* TO ''@'localhost' ------ establish connection user2 (user=mysqltest_2) ----- +connect user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK; +connection user2; select "user2"; user2 user2 @@ -156,7 +161,8 @@ Qcache_hits 7 show status like "Qcache_not_cached"; Variable_name Value Qcache_not_cached 2 ------ establish connection user3 (user=mysqltest_3) ----- +connect user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK; +connection user3; select "user3"; user3 user3 @@ -181,7 +187,8 @@ Qcache_hits 7 show status like "Qcache_not_cached"; Variable_name Value Qcache_not_cached 3 ------ establish connection user4 (user=mysqltest_1) ----- +connect user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK; +connection user4; select "user4"; user4 user4 @@ -212,8 +219,21 @@ Qcache_hits 8 show status like "Qcache_not_cached"; Variable_name Value Qcache_not_cached 4 ------ close connections ----- ------ switch to connection default ----- +connection root; +disconnect root; +connection root2; +disconnect root2; +connection user1; +disconnect user1; +connection user2; +disconnect user2; +connection user3; +disconnect user3; +connection user4; +disconnect user4; +connection unkuser; +disconnect unkuser; +connection default; set names binary; delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3"); delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3"); diff --git a/mysql-test/r/grant_lowercase_fs.result b/mysql-test/r/grant_lowercase_fs.result index eb27b1d7ea0..e883067eca0 100644 --- a/mysql-test/r/grant_lowercase_fs.result +++ b/mysql-test/r/grant_lowercase_fs.result @@ -3,13 +3,18 @@ create user user_1@localhost; create user USER_1@localhost; GRANT CREATE ON db1.* to user_1@localhost; GRANT SELECT ON db1.* to USER_1@localhost; +connect con1,localhost,user_1,,db1; CREATE TABLE t1(f1 int); SELECT * FROM t1; ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't1' +connect con2,localhost,USER_1,,db1; SELECT * FROM t1; f1 CREATE TABLE t2(f1 int); ERROR 42000: CREATE command denied to user 'USER_1'@'localhost' for table 't2' +connection default; +disconnect con1; +disconnect con2; REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost; REVOKE ALL PRIVILEGES, GRANT OPTION FROM USER_1@localhost; DROP USER user_1@localhost; diff --git a/mysql-test/r/merge-big.result b/mysql-test/r/merge-big.result index b17140a7c79..3b6e116986e 100644 --- a/mysql-test/r/merge-big.result +++ b/mysql-test/r/merge-big.result @@ -6,11 +6,11 @@ drop table if exists t1,t2,t3,t4,t5,t6; # CREATE TABLE t1 (c1 INT) ENGINE= MyISAM; LOCK TABLE t1 WRITE; -# connection con1 +connect con1,localhost,root,,; SET @orig_debug=@@debug; SET GLOBAL debug_dbug="+d,sleep_open_and_lock_after_open"; INSERT INTO t1 VALUES (1); -# connection default +connection default; # Let INSERT go into thr_multi_lock(). # Kick INSERT out of thr_multi_lock(). FLUSH TABLES; @@ -21,7 +21,8 @@ FLUSH TABLES; SELECT * FROM t1; c1 UNLOCK TABLES; -# connection con1 +connection con1; SET GLOBAL debug_dbug=@orig_debug; -# connection default +disconnect con1; +connection default; DROP TABLE t1; diff --git a/mysql-test/r/myisam-big.result b/mysql-test/r/myisam-big.result index 95a6e91d766..fd0bcb1224b 100644 --- a/mysql-test/r/myisam-big.result +++ b/mysql-test/r/myisam-big.result @@ -34,7 +34,13 @@ insert into t1 select * from t1; select count(*) from t1; count(*) 131072 +connect con2,localhost,root,,; +connection con2; alter table t1 add index (id), add index(sometext), add index(sometext,id); alter table t1 disable keys; alter table t1 enable keys; +connection default; +connection con2; +disconnect con2; +connection default; drop table t1,t2; diff --git a/mysql-test/r/mysqlbinlog_row_big.result b/mysql-test/r/mysqlbinlog_row_big.result index 70e39266d1d..32c6b4d40ed 100644 --- a/mysql-test/r/mysqlbinlog_row_big.result +++ b/mysql-test/r/mysqlbinlog_row_big.result @@ -17,9 +17,8 @@ In order for the preceding change in max_allowed_packets' value to be seen and used, we must start a new connection. The change does not take effect with the current one. For simplicity, we just disconnect / reconnect connection default here. -Disconnecting default connection... -Reconnecting default connection... -default connection established, continuing with the test +disconnect default; +connect default, localhost,root,,; # # Delete all existing binary logs. # diff --git a/mysql-test/r/named_pipe.result b/mysql-test/r/named_pipe.result index ddd48f0ba91..aaf2fa063e1 100644 --- a/mysql-test/r/named_pipe.result +++ b/mysql-test/r/named_pipe.result @@ -1,3 +1,4 @@ +connect pipe_con,localhost,root,,,,,PIPE; drop table if exists t1,t2,t3,t4; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, @@ -2154,3 +2155,5 @@ Privat (Private Nutzung) Mobilfunk Warnings: Warning 1052 Column 'kundentyp' in group statement is ambiguous drop table t1; +connection default; +disconnect pipe_con; diff --git a/mysql-test/r/query_cache_ps_ps_prot.result b/mysql-test/r/query_cache_ps_ps_prot.result index 4105bc40f94..e3f2da1dbbe 100644 --- a/mysql-test/r/query_cache_ps_ps_prot.result +++ b/mysql-test/r/query_cache_ps_ps_prot.result @@ -1,7 +1,7 @@ set GLOBAL query_cache_type=ON; set LOCAL query_cache_type=ON; ----- establish connection con1 (root) ---- ----- switch to connection default ---- +connect con1,localhost,root,,test,$MASTER_MYPORT,; +connection default; set @initial_query_cache_size = @@global.query_cache_size; set @@global.query_cache_size=102400; flush status; @@ -49,7 +49,7 @@ c1 show status like 'Qcache_hits'; Variable_name Value Qcache_hits 5 ----- switch to connection con1 ---- +connection con1; prepare stmt3 from "select * from t1 where c1=10"; execute stmt3; c1 @@ -69,7 +69,7 @@ c1 show status like 'Qcache_hits'; Variable_name Value Qcache_hits 8 ----- switch to connection default ---- +connection default; prepare stmt10 from "SELECT * FROM t1 WHERE c1 = 100"; show status like 'Qcache_hits'; Variable_name Value @@ -92,18 +92,18 @@ c1 show status like 'Qcache_hits'; Variable_name Value Qcache_hits 9 ----- switch to connection con1 ---- +connection con1; SELECT * FROM t1 WHERE c1 = 100; c1 100 show status like 'Qcache_hits'; Variable_name Value Qcache_hits 10 ----- switch to connection default ---- +connection default; prepare stmt11 from "SELECT * FROM t1 WHERE c1 = 1"; ----- switch to connection con1 ---- +connection con1; prepare stmt12 from "SELECT * FROM t1 WHERE c1 = 1"; ----- switch to connection default ---- +connection default; SELECT * FROM t1 WHERE c1 = 1; c1 1 @@ -122,14 +122,14 @@ c1 show status like 'Qcache_hits'; Variable_name Value Qcache_hits 11 ----- switch to connection con1 ---- +connection con1; execute stmt12; c1 1 show status like 'Qcache_hits'; Variable_name Value Qcache_hits 12 ----- switch to connection default ---- +connection default; prepare stmt1 from "select * from t1 where c1=?"; show status like 'Qcache_hits'; Variable_name Value @@ -147,7 +147,7 @@ c1 show status like 'Qcache_hits'; Variable_name Value Qcache_hits 13 ----- switch to connection con1 ---- +connection con1; set @a=1; prepare stmt4 from "select * from t1 where c1=?"; execute stmt4 using @a; @@ -169,7 +169,7 @@ execute stmt4 using @a; show status like 'Qcache_hits'; Variable_name Value Qcache_hits 14 ----- switch to connection default ---- +connection default; prepare stmt1 from "select * from t1 where c1=10"; set global query_cache_size=0; show status like 'Qcache_hits'; @@ -193,7 +193,7 @@ c1 show status like 'Qcache_hits'; Variable_name Value Qcache_hits 14 ----- switch to connection con1 ---- +connection con1; execute stmt3; c1 10 @@ -212,7 +212,7 @@ c1 show status like 'Qcache_hits'; Variable_name Value Qcache_hits 14 ----- switch to connection default ---- +connection default; set global query_cache_size=102400; execute stmt1; c1 @@ -232,7 +232,7 @@ c1 show status like 'Qcache_hits'; Variable_name Value Qcache_hits 16 ----- switch to connection con1 ---- +connection con1; execute stmt3; c1 10 @@ -251,7 +251,7 @@ c1 show status like 'Qcache_hits'; Variable_name Value Qcache_hits 19 ----- switch to connection default ---- +connection default; set global query_cache_size=0; show status like 'Qcache_hits'; Variable_name Value @@ -274,7 +274,7 @@ c1 show status like 'Qcache_hits'; Variable_name Value Qcache_hits 19 ----- switch to connection con1 ---- +connection con1; execute stmt3; c1 10 @@ -293,12 +293,12 @@ c1 show status like 'Qcache_hits'; Variable_name Value Qcache_hits 19 ----- switch to connection default ---- +connection default; set global query_cache_size=0; prepare stmt1 from "select * from t1 where c1=10"; ----- switch to connection con1 ---- +connection con1; prepare stmt3 from "select * from t1 where c1=10"; ----- switch to connection default ---- +connection default; set global query_cache_size=102400; show status like 'Qcache_hits'; Variable_name Value @@ -321,7 +321,7 @@ c1 show status like 'Qcache_hits'; Variable_name Value Qcache_hits 19 ----- switch to connection con1 ---- +connection con1; show status like 'Qcache_hits'; Variable_name Value Qcache_hits 19 @@ -343,7 +343,7 @@ c1 show status like 'Qcache_hits'; Variable_name Value Qcache_hits 19 ----- switch to connection default ---- +connection default; set global query_cache_size=0; prepare stmt1 from "select * from t1 where c1=?"; set global query_cache_size=102400; @@ -372,7 +372,7 @@ show status like 'Qcache_hits'; Variable_name Value Qcache_hits 19 drop table t1; ----- disconnect connection con1 ---- +disconnect con1; ######################################################################## # # BUG#25843: Changing default database between PREPARE and EXECUTE of diff --git a/mysql-test/r/shm.result b/mysql-test/r/shm.result index a2c38627e9d..13f715b4e26 100644 --- a/mysql-test/r/shm.result +++ b/mysql-test/r/shm.result @@ -1,3 +1,4 @@ +connect shm_con,localhost,root,,,,$shm_name,SHM; drop table if exists t1,t2,t3,t4; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, @@ -2154,6 +2155,8 @@ Privat (Private Nutzung) Mobilfunk Warnings: Warning 1052 Column 'kundentyp' in group statement is ambiguous drop table t1; +connection default; +disconnect shm_con; mysqld is alive SET @max_allowed_packet= @@global.max_allowed_packet; SET @net_buffer_length= @@global.net_buffer_length; diff --git a/mysql-test/r/ssl-big.result b/mysql-test/r/ssl-big.result index 39c4f34e46c..54c61507ade 100644 --- a/mysql-test/r/ssl-big.result +++ b/mysql-test/r/ssl-big.result @@ -1,3 +1,8 @@ DROP TABLE IF EXISTS t1, t2; +connect ssl_con,localhost,root,,,,,SSL; create table t1 (a int); +disconnect ssl_con; +connect ssl_con,localhost,root,,,,,SSL; drop table t1; +connection default; +disconnect ssl_con; diff --git a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result index dbe786d39ef..cbc9a8f17ce 100644 --- a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result @@ -79,7 +79,7 @@ def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE -# Establish connection testuser1 (user=testuser1) +connect testuser1,localhost,testuser1,,db_datadict; SELECT * FROM information_schema.statistics WHERE table_schema = 'mysql' ORDER BY table_schema, table_name, index_name, seq_in_index, column_name; @@ -156,6 +156,7 @@ def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE -# Switch to connection default and close connection testuser1 +connection default; +disconnect testuser1; DROP USER testuser1@localhost; DROP DATABASE db_datadict; diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result index fd13d67f07c..58a2373b66d 100644 --- a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result @@ -38,7 +38,7 @@ def mysql PRIMARY mysql time_zone_name PRIMARY KEY def mysql PRIMARY mysql time_zone_transition PRIMARY KEY def mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY def mysql PRIMARY mysql user PRIMARY KEY -# Establish connection testuser1 (user=testuser1) +connect testuser1,localhost,testuser1,,db_datadict; SELECT * FROM information_schema.table_constraints WHERE table_schema = 'mysql' ORDER BY table_schema,table_name,constraint_name; @@ -74,6 +74,7 @@ def mysql PRIMARY mysql time_zone_name PRIMARY KEY def mysql PRIMARY mysql time_zone_transition PRIMARY KEY def mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY def mysql PRIMARY mysql user PRIMARY KEY -# Switch to connection default and close connection testuser1 +connection default; +disconnect testuser1; DROP USER testuser1@localhost; DROP DATABASE db_datadict; diff --git a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result index daa3ce83ba2..a0f2424c07c 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result @@ -935,7 +935,7 @@ Separator ----------------------------------------------------- DROP USER testuser1@localhost; CREATE USER testuser1@localhost; GRANT SELECT ON test1.* TO testuser1@localhost; -# Establish connection testuser1 (user=testuser1) +connect testuser1,localhost,testuser1,,test1; SELECT *, LEFT( table_comment, IF(INSTR(table_comment,'InnoDB free') = 0, @@ -1868,6 +1868,7 @@ CREATE_OPTIONS #CO# TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- -# Switch to connection default and close connection testuser1 +connection default; +disconnect testuser1; DROP USER testuser1@localhost; DROP DATABASE test1; diff --git a/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result index 3ffa2662313..5a1b6df84cb 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result @@ -95,7 +95,7 @@ t1 DROP USER testuser1@localhost; CREATE USER testuser1@localhost; GRANT SELECT ON test1.* TO testuser1@localhost; -# Establish connection testuser1 (user=testuser1) +connect testuser1,localhost,testuser1,,test1; SELECT *, LEFT( table_comment, IF(INSTR(table_comment,'InnoDB free') = 0, @@ -182,7 +182,8 @@ t2 SHOW TABLES FROM test2; Tables_in_test2 t1 -# Switch to connection default and close connection testuser1 +connection default; +disconnect testuser1; DROP USER testuser1@localhost; DROP DATABASE test1; DROP DATABASE test2; diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result index f1a6cc327b7..479312334a7 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result @@ -703,7 +703,7 @@ Separator ----------------------------------------------------- DROP USER testuser1@localhost; CREATE USER testuser1@localhost; GRANT SELECT ON test1.* TO testuser1@localhost; -# Establish connection testuser1 (user=testuser1) +connect testuser1,localhost,testuser1,,test1; SELECT *, LEFT( table_comment, IF(INSTR(table_comment,'InnoDB free') = 0, @@ -1404,6 +1404,7 @@ CREATE_OPTIONS #CO# TABLE_COMMENT #TC# user_comment Users and global privileges Separator ----------------------------------------------------- -# Switch to connection default and close connection testuser1 +connection default; +disconnect testuser1; DROP USER testuser1@localhost; DROP DATABASE test1; diff --git a/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result b/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result index d3ad9cc9065..ff32bf694cb 100644 --- a/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result +++ b/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result @@ -4,6 +4,11 @@ select @@global.innodb_stats_persistent; 0 set global innodb_defragment_stats_accuracy = 80; CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), c INT, KEY second(a, b),KEY third(c)) ENGINE=INNODB; +connect con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK; +connect con2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK; +connect con3,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK; +connect con4,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK; +connection default; SET @@global.innodb_defragment_n_pages = 20; select count(*) from t1; count(*) @@ -32,11 +37,25 @@ count(stat_value) > 0 select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag'); count(stat_value) > 0 1 +connection con1; optimize table t1;; +connection default; INSERT INTO t1 VALUES (400000, REPEAT('A', 256),300000);; +connection con2; INSERT INTO t1 VALUES (500000, REPEAT('A', 256),400000);; +connection con3; DELETE FROM t1 where a between 1 and 100;; +connection con4; UPDATE t1 SET c = c + 1 where c between 2000 and 8000;; +connection con1; +connection con2; +connection con3; +connection con4; +connection default; +disconnect con1; +disconnect con2; +disconnect con3; +disconnect con4; optimize table t1; Table Op Msg_type Msg_text test.t1 optimize status OK diff --git a/mysql-test/suite/innodb/r/innodb_defragment.result b/mysql-test/suite/innodb/r/innodb_defragment.result index 5f3fd523946..c42cbd972f8 100644 --- a/mysql-test/suite/innodb/r/innodb_defragment.result +++ b/mysql-test/suite/innodb/r/innodb_defragment.result @@ -31,7 +31,13 @@ count(stat_value) select count(*) from t1; count(*) 10004 +connect con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK; +connection con1; call defragment(); +connection default; +connection con1; +connection default; +disconnect con1; optimize table t1; Table Op Msg_type Msg_text test.t1 optimize status OK diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result index 61eec8d4155..1f40887b9fc 100644 --- a/mysql-test/suite/innodb/r/innodb_mysql.result +++ b/mysql-test/suite/innodb/r/innodb_mysql.result @@ -109,12 +109,19 @@ id1 2 DROP TABLE t1, t2; create table t1 (c1 int) engine=innodb; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con2; handler t1 open; handler t1 read first; c1 +disconnect con2; +connection con1; Before and after comparison 0 +connection default; drop table t1; +disconnect con1; CREATE TABLE t1(c1 TEXT, UNIQUE (c1(1)), cnt INT DEFAULT 1) ENGINE=INNODB CHARACTER SET UTF8; INSERT INTO t1 (c1) VALUES ('1a'); @@ -399,12 +406,16 @@ innodb_rollback_on_timeout OFF create table t1 (a int unsigned not null primary key) engine = innodb; insert into t1 values (1); commit; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con2; begin work; insert into t1 values (2); select * from t1; a 1 2 +connection con1; begin work; insert into t1 values (5); select * from t1; @@ -418,21 +429,27 @@ a 1 5 commit; +connection con2; select * from t1; a 1 2 commit; +connection default; select * from t1; a 1 2 5 drop table t1; +disconnect con1; +disconnect con2; set @save_qcache_size=@@global.query_cache_size; set @save_qcache_type=@@global.query_cache_type; set global query_cache_size=10*1024*1024; set global query_cache_type=1; +connect con1,localhost,root,,; +connection con1; drop table if exists `test`; Warnings: Note 1051 Unknown table 'test.test' @@ -440,6 +457,9 @@ CREATE TABLE `test` (`test1` varchar(3) NOT NULL, `test2` varchar(4) NOT NULL,PRIMARY KEY (`test1`)) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '5678'); +disconnect con1; +connect con2,localhost,root,,; +connection con2; select * from test; test1 test2 tes 5678 @@ -452,6 +472,8 @@ flush tables; select * from test; test1 test2 tes 1234 +disconnect con2; +connection default; drop table test; set global query_cache_type=@save_qcache_type; set global query_cache_size=@save_qcache_size; @@ -462,12 +484,16 @@ innodb_rollback_on_timeout OFF create table t1 (a int unsigned not null primary key) engine = innodb; insert into t1 values (1); commit; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con2; begin work; insert into t1 values (2); select * from t1; a 1 2 +connection con1; begin work; insert into t1 values (5); select * from t1; @@ -481,17 +507,21 @@ a 1 5 commit; +connection con2; select * from t1; a 1 2 commit; +connection default; select * from t1; a 1 2 5 drop table t1; +disconnect con1; +disconnect con2; create table t1( id int auto_increment, c char(1) not null, @@ -637,18 +667,22 @@ Warnings: Warning 1932 Table 'test.bug29807' doesn't exist in engine CREATE TABLE t1 (a INT) ENGINE=InnoDB; CREATE TABLE t2 (a INT) ENGINE=InnoDB; -switch to connection c1 +CONNECT c1,localhost,root,,; +CONNECT c2,localhost,root,,; +connection c1; SET AUTOCOMMIT=0; INSERT INTO t2 VALUES (1); -switch to connection c2 +connection c2; SET AUTOCOMMIT=0; LOCK TABLES t1 READ, t2 READ; ERROR HY000: Lock wait timeout exceeded; try restarting transaction -switch to connection c1 +connection c1; COMMIT; INSERT INTO t1 VALUES (1); -switch to connection default +connection default; SET AUTOCOMMIT=default; +disconnect c1; +disconnect c2; DROP TABLE t1,t2; CREATE TABLE t1 ( id int NOT NULL auto_increment PRIMARY KEY, @@ -790,12 +824,16 @@ innodb_rollback_on_timeout OFF create table t1 (a int unsigned not null primary key) engine = innodb; insert into t1 values (1); commit; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con2; begin work; insert into t1 values (2); select * from t1; a 1 2 +connection con1; begin work; insert into t1 values (5); select * from t1; @@ -809,17 +847,21 @@ a 1 5 commit; +connection con2; select * from t1; a 1 2 commit; +connection default; select * from t1; a 1 2 5 drop table t1; +disconnect con1; +disconnect con2; drop table if exists t1; create table t1 (a int) engine=innodb; alter table t1 alter a set default 1; @@ -1117,9 +1159,19 @@ SELECT COUNT(*) INTO cnt FROM t1 LOCK IN SHARE MODE; END WHILE; COMMIT; END;| +CONNECT con1,localhost,root,,; +CONNECT con2,localhost,root,,; +connection con1; CALL p1(); +connection con2; CALL p1(); +connection default; CALL p1(); +connection con1; +connection con2; +connection default; +disconnect con1; +disconnect con2; DROP PROCEDURE p1; DROP TABLE t1; create table t1(a text) engine=innodb default charset=utf8; @@ -1144,12 +1196,15 @@ START TRANSACTION; SELECT * FROM t1 WHERE b=20 FOR UPDATE; a b 2 20 +connect conn2, localhost, root,,test; START TRANSACTION; SELECT * FROM t1 WHERE b=10 ORDER BY A FOR UPDATE; a b 1 10 2 10 ROLLBACK; +disconnect conn2; +connection default; ROLLBACK; DROP TABLE t1; CREATE TABLE t1( @@ -1574,10 +1629,12 @@ select if(@a=@b,"ok","wrong"); if(@a=@b,"ok","wrong") ok drop table t1; +connect con1,localhost,root,,; +connect con2,localhost,root,,; SET SESSION AUTOCOMMIT = 0; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; set binlog_format=mixed; -# Switch to connection con1 +connection con1; CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256)) ENGINE = InnoDB; INSERT INTO t1 VALUES (1,2); @@ -1589,17 +1646,17 @@ info: Rows matched: 1 Changed: 1 Warnings: 0 SELECT * FROM t1; a b 1 12 -# Switch to connection con2 +connection con2; UPDATE t1 SET b = 21 WHERE a = 1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction -# Switch to connection con1 +connection con1; SELECT * FROM t1; a b 1 12 ROLLBACK; -# Switch to connection con2 +connection con2; ROLLBACK; -# Switch to connection con1 +connection con1; # 2. test for serialized update: CREATE TABLE t2 (a INT); TRUNCATE t1; @@ -1626,9 +1683,9 @@ info: Rows matched: 1 Changed: 1 Warnings: 0 SELECT * FROM t1; a b 1 init+con1 -# Switch to connection con2 +connection con2; CALL p1;; -# Switch to connection con1 +connection con1; SELECT * FROM t1; a b 1 init+con1 @@ -1636,12 +1693,12 @@ COMMIT; SELECT * FROM t1; a b 1 init+con1 -# Switch to connection con2 +connection con2; SELECT * FROM t1; a b 1 init+con1+con2 COMMIT; -# Switch to connection con1 +connection con1; # 3. test for updated key column: TRUNCATE t1; TRUNCATE t2; @@ -1653,9 +1710,9 @@ info: Rows matched: 1 Changed: 1 Warnings: 0 SELECT * FROM t1; a b 2 init+con1 -# Switch to connection con2 +connection con2; CALL p1;; -# Switch to connection con1 +connection con1; SELECT * FROM t1; a b 2 init+con1 @@ -1663,10 +1720,13 @@ COMMIT; SELECT * FROM t1; a b 2 init+con1 -# Switch to connection con2 +connection con2; SELECT * FROM t1; a b 2 init+con1 +connection default; +disconnect con1; +disconnect con2; DROP PROCEDURE p1; DROP TABLE t1, t2; CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b)) engine=innodb; @@ -1826,21 +1886,21 @@ a 1 2 3 -# Connection con1 +connect con1, localhost, root,,; TRUNCATE TABLE t1;; -# Connection default +connection default; SELECT * FROM t1 ORDER BY a; a 1 2 3 ROLLBACK; -# Connection con1 +connection con1; # Reaping TRUNCATE TABLE SELECT * FROM t1; a -# Disconnect con1 -# Connection default +disconnect con1; +connection default; DROP TABLE t1; drop table if exists t1, t2, t3; # @@ -2370,6 +2430,8 @@ INSERT INTO t1 VALUES (),(); INSERT INTO t2 VALUES (),(); CREATE OR REPLACE VIEW v1 AS SELECT 1 FROM t2 WHERE b =(SELECT a FROM t1 LIMIT 1); +CONNECT con1, localhost, root,,; +connection default; CREATE PROCEDURE p1(num INT) BEGIN DECLARE i INT DEFAULT 0; @@ -2380,6 +2442,7 @@ UNTIL i>num END REPEAT; END| # Should not crash # Should not crash +disconnect con1; DROP PROCEDURE p1; DROP VIEW v1; DROP TABLE t1,t2; @@ -2774,19 +2837,18 @@ CREATE TABLE t1(x INT PRIMARY KEY, y INT) ENGINE=innodb; INSERT INTO t1 VALUES (1, 0), (2, 0); CREATE FUNCTION f1(z INT) RETURNS INT READS SQL DATA RETURN (SELECT x FROM t1 WHERE x = z); -# Connection default START TRANSACTION; SELECT f1(1); f1(1) 1 -# Connection con2 START TRANSACTION; SELECT f1(1); f1(1) 1 UPDATE t1 SET y = 1 WHERE x = 1; COMMIT; -# Connection default +disconnect con2; +connection default; COMMIT; DROP TABLE t1; DROP FUNCTION f1; diff --git a/mysql-test/suite/innodb/t/innodb_mysql.test b/mysql-test/suite/innodb/t/innodb_mysql.test index 7c2ae98f001..ee3975fd350 100644 --- a/mysql-test/suite/innodb/t/innodb_mysql.test +++ b/mysql-test/suite/innodb/t/innodb_mysql.test @@ -907,11 +907,9 @@ INSERT INTO t1 VALUES (1, 0), (2, 0); CREATE FUNCTION f1(z INT) RETURNS INT READS SQL DATA RETURN (SELECT x FROM t1 WHERE x = z); ---echo # Connection default START TRANSACTION; SELECT f1(1); ---echo # Connection con2 --disable_query_log connect (con2, localhost, root); --enable_query_log @@ -924,7 +922,6 @@ COMMIT; disconnect con2; --source include/wait_until_disconnected.inc ---echo # Connection default connection default; COMMIT; DROP TABLE t1; diff --git a/mysql-test/suite/roles/recursive.result b/mysql-test/suite/roles/recursive.result index 7abbd01240e..ece3114747e 100644 --- a/mysql-test/suite/roles/recursive.result +++ b/mysql-test/suite/roles/recursive.result @@ -23,6 +23,7 @@ grant role9 to role10; grant role10 to foo@localhost; grant role10 to role2; ERROR HY000: Cannot grant role 'role10' to: 'role2'. +connect foo, localhost, foo; show grants; Grants for foo@localhost GRANT USAGE ON *.* TO 'foo'@'localhost' @@ -42,9 +43,11 @@ role9 role6 NO NULL role9 role7 NO NULL show status like 'debug%'; Variable_name Value +connection default; grant select on *.* to role1; show status like 'debug%'; Variable_name Value +connection foo; select count(*) from mysql.roles_mapping; ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping' set role role10; @@ -85,9 +88,11 @@ role5 role6 role7 role9 +connection default; revoke select on *.* from role1; show status like 'debug%'; Variable_name Value +connection foo; select count(*) from mysql.roles_mapping; count(*) 22 @@ -96,9 +101,11 @@ set role role10; select count(*) from mysql.roles_mapping; ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping' set role none; +connection default; grant select on mysql.* to role1; show status like 'debug%'; Variable_name Value +connection foo; select count(*) from mysql.roles_mapping; ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping' set role role10; @@ -129,15 +136,19 @@ GRANT role5 TO 'role7' GRANT role6 TO 'role9' GRANT role7 TO 'role9' GRANT role9 TO 'role10' +connection default; revoke select on mysql.* from role1; show status like 'debug%'; Variable_name Value +connection foo; select count(*) from mysql.roles_mapping; ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping' set role none; +connection default; grant select on mysql.roles_mapping to role1; show status like 'debug%'; Variable_name Value +connection foo; select count(*) from mysql.roles_mapping; ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping' set role role10; @@ -168,15 +179,19 @@ GRANT role5 TO 'role7' GRANT role6 TO 'role9' GRANT role7 TO 'role9' GRANT role9 TO 'role10' +connection default; revoke select on mysql.roles_mapping from role1; show status like 'debug%'; Variable_name Value +connection foo; select count(*) from mysql.roles_mapping; ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping' set role none; +connection default; grant select(User) on mysql.roles_mapping to role1; show status like 'debug%'; Variable_name Value +connection foo; select count(*) from mysql.roles_mapping; ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping' set role role10; @@ -209,9 +224,11 @@ GRANT role5 TO 'role7' GRANT role6 TO 'role9' GRANT role7 TO 'role9' GRANT role9 TO 'role10' +connection default; grant select(Host) on mysql.roles_mapping to role3; show status like 'debug%'; Variable_name Value +connection foo; select count(concat(User,Host,Role)) from mysql.roles_mapping; ERROR 42000: SELECT command denied to user 'foo'@'localhost' for column 'Role' in table 'roles_mapping' select count(concat(User,Host)) from mysql.roles_mapping; @@ -242,25 +259,31 @@ GRANT role5 TO 'role7' GRANT role6 TO 'role9' GRANT role7 TO 'role9' GRANT role9 TO 'role10' +connection default; revoke select(User) on mysql.roles_mapping from role1; show status like 'debug%'; Variable_name Value +connection foo; select count(concat(User,Host)) from mysql.roles_mapping; ERROR 42000: SELECT command denied to user 'foo'@'localhost' for column 'User' in table 'roles_mapping' select count(concat(Host)) from mysql.roles_mapping; count(concat(Host)) 22 +connection default; revoke select(Host) on mysql.roles_mapping from role3; show status like 'debug%'; Variable_name Value +connection foo; select count(concat(Host)) from mysql.roles_mapping; ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping' set role none; +connection default; create procedure pr1() select "pr1"; create function fn1() returns char(10) return "fn1"; grant execute on procedure test.pr1 to role1; show status like 'debug%'; Variable_name Value +connection foo; call pr1(); ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test.pr1' set role role10; @@ -269,26 +292,33 @@ pr1 pr1 select fn1(); ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test.fn1' +connection default; grant execute on function test.fn1 to role5; show status like 'debug%'; Variable_name Value +connection foo; select fn1(); fn1() fn1 +connection default; revoke execute on procedure test.pr1 from role1; show status like 'debug%'; Variable_name Value +connection foo; call pr1(); ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test.pr1' select fn1(); fn1() fn1 +connection default; revoke execute on function test.fn1 from role5; show status like 'debug%'; Variable_name Value +connection foo; select fn1(); ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test.fn1' set role none; +connection default; drop procedure pr1; drop function fn1; grant select on mysql.roles_mapping to role3; @@ -315,6 +345,7 @@ Variable_name Value revoke select on test.* from role1; show status like 'debug%'; Variable_name Value +connection default; drop user foo@localhost; drop role role1; drop role role2; diff --git a/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff b/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff index 56c994cfd76..1946228f401 100644 --- a/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff +++ b/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff @@ -1,6 +1,6 @@ ---- suite/rpl/r/rpl_insert_delayed.result 2012-09-18 01:37:45.317521958 +0300 -+++ suite/rpl/r/rpl_insert_delayed,stmt.reject 2012-09-18 01:36:16.637514667 +0300 -@@ -15,17 +15,17 @@ +--- suite/rpl/r/rpl_insert_delayed.result 2016-03-25 19:44:43.408210896 +0400 ++++ suite/rpl/r/rpl_insert_delayed,stmt.reject 2016-03-25 23:55:18.396360848 +0400 +@@ -18,19 +18,19 @@ insert delayed into t1 values(10, "my name"); flush table t1; insert delayed into t1 values(10, "is Bond"), (20, "James Bond"); @@ -10,21 +10,25 @@ id name 10 my name -20 James Bond + connection slave; select * from t1; id name 10 my name -20 James Bond + connection master; delete from t1 where id!=10; insert delayed into t1 values(20, "is Bond"), (10, "James Bond"); +ERROR 23000: Duplicate entry '10' for key 'PRIMARY' flush table t1; select * from t1; id name -@@ -38,17 +38,31 @@ - USE test; - DROP SCHEMA mysqlslap; +@@ -47,21 +47,38 @@ + connection slave; use test; + connection master; ++connection slave; +FLUSH LOGS; ++connection master; +FLUSH LOGS; CREATE TABLE t1(a int, UNIQUE(a)); INSERT DELAYED IGNORE INTO t1 VALUES(1); @@ -35,6 +39,7 @@ select * from t1; a 1 + connection slave; On slave +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info @@ -47,8 +52,12 @@ select * from t1; a 1 + connection master; drop table t1; + connection slave; +FLUSH LOGS; ++connection master; +FLUSH LOGS; + connection master; End of 5.0 tests include/rpl_end.inc diff --git a/mysql-test/suite/stress/r/ddl_archive.result b/mysql-test/suite/stress/r/ddl_archive.result index 457fc30b9f9..f11610b6436 100644 --- a/mysql-test/suite/stress/r/ddl_archive.result +++ b/mysql-test/suite/stress/r/ddl_archive.result @@ -2,6 +2,8 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; SET @runtime = <intended_runtime>; PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +connect con2,localhost,root,,; +connection default; DROP TABLE IF EXISTS t1; # Subtest 2A (one connection, no PREPARE/EXECUTE) # connection action @@ -75,5 +77,6 @@ DROP TABLE IF EXISTS t1; # con2: INSERT INTO t1 SET f2 = 9 # default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 # con2: DROP TABLE t1 +disconnect con2; DEALLOCATE PREPARE stmt_start; DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/r/ddl_csv.result b/mysql-test/suite/stress/r/ddl_csv.result index 2346638360b..ed6fafe3cc5 100644 --- a/mysql-test/suite/stress/r/ddl_csv.result +++ b/mysql-test/suite/stress/r/ddl_csv.result @@ -2,6 +2,8 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; SET @runtime = <intended_runtime>; PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +connect con2,localhost,root,,; +connection default; DROP TABLE IF EXISTS t1; # Subtest 2A (one connection, no PREPARE/EXECUTE) # connection action @@ -51,5 +53,6 @@ DROP TABLE IF EXISTS t1; # con2: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR) # default: DROP TABLE t1 # con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +disconnect con2; DEALLOCATE PREPARE stmt_start; DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/r/ddl_innodb.result b/mysql-test/suite/stress/r/ddl_innodb.result index 911aed2622a..479f11ebbd9 100644 --- a/mysql-test/suite/stress/r/ddl_innodb.result +++ b/mysql-test/suite/stress/r/ddl_innodb.result @@ -2,6 +2,8 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; SET @runtime = <intended_runtime>; PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +connect con2,localhost,root,,; +connection default; DROP TABLE IF EXISTS t1; # Subtest 1A (one connection, no PREPARE/EXECUTE) # connection action @@ -247,5 +249,6 @@ DROP INDEX IDX ON t1; # con2: SHOW CREATE TABLE t1 # default: DROP INDEX IDX ON t1 DROP TABLE t1; +disconnect con2; DEALLOCATE PREPARE stmt_start; DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/r/ddl_memory.result b/mysql-test/suite/stress/r/ddl_memory.result index 7ad9f9a61c5..8f20636906a 100644 --- a/mysql-test/suite/stress/r/ddl_memory.result +++ b/mysql-test/suite/stress/r/ddl_memory.result @@ -2,6 +2,8 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; SET @runtime = <intended_runtime>; PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +connect con2,localhost,root,,; +connection default; DROP TABLE IF EXISTS t1; # Subtest 1A (one connection, no PREPARE/EXECUTE) # connection action @@ -247,5 +249,6 @@ DROP INDEX IDX ON t1; # con2: SHOW CREATE TABLE t1 # default: DROP INDEX IDX ON t1 DROP TABLE t1; +disconnect con2; DEALLOCATE PREPARE stmt_start; DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/r/ddl_myisam.result b/mysql-test/suite/stress/r/ddl_myisam.result index 808b22dc859..c441d0ddc05 100644 --- a/mysql-test/suite/stress/r/ddl_myisam.result +++ b/mysql-test/suite/stress/r/ddl_myisam.result @@ -2,6 +2,8 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; SET @runtime = <intended_runtime>; PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +connect con2,localhost,root,,; +connection default; DROP TABLE IF EXISTS t1; # Subtest 1A (one connection, no PREPARE/EXECUTE) # connection action @@ -247,5 +249,6 @@ DROP INDEX IDX ON t1; # con2: SHOW CREATE TABLE t1 # default: DROP INDEX IDX ON t1 DROP TABLE t1; +disconnect con2; DEALLOCATE PREPARE stmt_start; DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/t/merge-big.test b/mysql-test/t/merge-big.test index 78c3e8c00ac..9bd2cab2c8a 100644 --- a/mysql-test/t/merge-big.test +++ b/mysql-test/t/merge-big.test @@ -40,13 +40,11 @@ drop table if exists t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT) ENGINE= MyISAM; LOCK TABLE t1 WRITE; #SELECT NOW(); - --echo # connection con1 connect (con1,localhost,root,,); let $con1_id= `SELECT CONNECTION_ID()`; SET @orig_debug=@@debug; SET GLOBAL debug_dbug="+d,sleep_open_and_lock_after_open"; send INSERT INTO t1 VALUES (1); ---echo # connection default connection default; --echo # Let INSERT go into thr_multi_lock(). #--sleep 8 @@ -72,12 +70,9 @@ FLUSH TABLES; SELECT * FROM t1; #SELECT NOW(); UNLOCK TABLES; - --echo # connection con1 connection con1; reap; SET GLOBAL debug_dbug=@orig_debug; disconnect con1; ---echo # connection default connection default; DROP TABLE t1; - diff --git a/mysql-test/t/mysqlbinlog_row_big.test b/mysql-test/t/mysqlbinlog_row_big.test index ffd1b79af34..44bceaad66b 100644 --- a/mysql-test/t/mysqlbinlog_row_big.test +++ b/mysql-test/t/mysqlbinlog_row_big.test @@ -52,11 +52,8 @@ SET @@global.max_allowed_packet= 1024*1024*1024; --echo to be seen and used, we must start a new connection. --echo The change does not take effect with the current one. --echo For simplicity, we just disconnect / reconnect connection default here. ---echo Disconnecting default connection... disconnect default; ---echo Reconnecting default connection... connect (default, localhost,root,,); ---echo default connection established, continuing with the test --echo # --echo # Delete all existing binary logs. |