summaryrefslogtreecommitdiff
path: root/mysql-test/include
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2016-03-25 20:51:22 +0400
committerSergey Vojtovich <svoj@mariadb.org>2016-03-31 10:11:16 +0400
commit282497dd6d1049b4fb963641504c2733752845a7 (patch)
tree7288d17c29fbbe9ac47ec51f6988fb954f59a361 /mysql-test/include
parent5052e2479e873461bebfcedbc674bbaf57d3c968 (diff)
downloadmariadb-git-282497dd6d1049b4fb963641504c2733752845a7.tar.gz
MDEV-6720 - enable connection log in mysqltest by default
Diffstat (limited to 'mysql-test/include')
-rw-r--r--mysql-test/include/bug38347.inc4
-rw-r--r--mysql-test/include/concurrent.inc62
-rw-r--r--mysql-test/include/deadlock.inc18
-rw-r--r--mysql-test/include/grant_cache.inc9
-rw-r--r--mysql-test/include/mix1.inc21
-rw-r--r--mysql-test/include/query_cache.inc6
-rw-r--r--mysql-test/include/query_cache_sql_prepare.inc23
-rw-r--r--mysql-test/include/rpl_connect.inc2
-rw-r--r--mysql-test/include/rpl_connection.inc2
-rw-r--r--mysql-test/include/rpl_connection_master.inc2
-rw-r--r--mysql-test/include/rpl_connection_slave.inc2
-rw-r--r--mysql-test/include/rpl_connection_slave1.inc2
-rw-r--r--mysql-test/include/rpl_ip_mix.inc7
-rw-r--r--mysql-test/include/rpl_ip_mix2.inc7
-rw-r--r--mysql-test/include/rpl_ipv6.inc7
-rw-r--r--mysql-test/include/rpl_loaddata_charset.inc2
-rw-r--r--mysql-test/include/rpl_stmt_seq.inc18
-rw-r--r--mysql-test/include/rpl_sync.inc8
-rw-r--r--mysql-test/include/rpl_udf.inc16
19 files changed, 12 insertions, 206 deletions
diff --git a/mysql-test/include/bug38347.inc b/mysql-test/include/bug38347.inc
index ca1dbfa1bd2..9980084913f 100644
--- a/mysql-test/include/bug38347.inc
+++ b/mysql-test/include/bug38347.inc
@@ -2,16 +2,12 @@
--echo
SHOW GRANTS FOR mysqltest_u1@localhost;
---echo
---echo # connection: con1 (mysqltest_u1@mysqltest_db1)
--connect (con1,localhost,mysqltest_u1,,mysqltest_db1)
--connection con1
--echo
SHOW CREATE TABLE t1;
---echo
---echo # connection: default
--connection default
--disconnect con1
diff --git a/mysql-test/include/concurrent.inc b/mysql-test/include/concurrent.inc
index 2912287be8e..c6d8775af6b 100644
--- a/mysql-test/include/concurrent.inc
+++ b/mysql-test/include/concurrent.inc
@@ -64,7 +64,6 @@ drop table if exists t1;
--echo **
--echo ** two UPDATE's running and both changing distinct result sets
--echo **
- --echo ** connection thread1
connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -84,7 +83,6 @@ drop table if exists t1;
--echo ** Get user level lock (ULL) for thread 1
select get_lock("hello",10);
- --echo ** connection thread2
connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Start transaction for thread 2
@@ -93,7 +91,6 @@ drop table if exists t1;
--echo ** be created and blocked on the first row where tipo=11.
send update t1 set eta=1+get_lock("hello",10)*0 where tipo=11;
- --echo ** connection thread1
connection thread1;
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
--source include/wait_condition.inc
@@ -121,7 +118,6 @@ drop table if exists t1;
--echo ** Table is now updated with a new eta on tipo=22 for thread 1.
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** Release the lock and collect result from update on thread 2
reap;
@@ -134,7 +130,6 @@ drop table if exists t1;
--echo ** Sending commit on thread 2.
commit;
- --echo ** connection thread1
connection thread1;
--echo ** Make sure table reads didn't change yet on thread 1.
select * from t1;
@@ -144,16 +139,13 @@ drop table if exists t1;
--echo ** thread 1,2.
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** Make sure the output is similar for t1.
select * from t1;
- --echo ** connection thread1
connection thread1;
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -162,7 +154,6 @@ drop table t1;
--echo **
--echo ** two UPDATE's running and one changing result set
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -182,7 +173,6 @@ drop table t1;
--echo ** Get ULL "hello" on thread 1
select get_lock("hello",10);
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Start transaction on thread 2
@@ -192,7 +182,6 @@ drop table t1;
--echo ** blocking ULL is released.
send update t1 set eta=1+get_lock("hello",10)*0 where tipo=1;
---echo ** connection thread1
connection thread1;
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
--source include/wait_condition.inc
@@ -219,7 +208,6 @@ drop table t1;
--echo ** The table should still be updated with updates for thread 1 only:
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** Release the lock and collect result from thread 2:
reap;
@@ -231,7 +219,6 @@ drop table t1;
select * from t1;
commit;
- --echo ** connection thread1
connection thread1;
--echo ** Thread 2 has committed but the result should remain the same for
--echo ** thread 1 (updated on three places):
@@ -242,15 +229,12 @@ drop table t1;
--echo ** This select should show both updates:
select * from t1;
- --echo ** connection thread2
connection thread2;
select * from t1;
- --echo ** connection thread1
connection thread1;
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -259,7 +243,6 @@ drop table t1;
--echo **
--echo ** One UPDATE and one INSERT .... Monty's test
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -269,7 +252,6 @@ drop table t1;
--echo ** Create ULL 'hello2'
select get_lock("hello2",10);
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Begin a new transaction on thread 2
@@ -278,7 +260,6 @@ drop table t1;
--echo ** this will hang waiting on thread 1.
send update t1 set b=10+get_lock(concat("hello",a),10)*0 where a=2;
- --echo ** connection thread1
connection thread1;
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
--source include/wait_condition.inc
@@ -292,7 +273,6 @@ drop table t1;
--echo ** ..but thread 1 will still see t1 as if nothing has happend:
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** Collect results from thread 2 and release the lock.
reap;
@@ -305,7 +285,6 @@ drop table t1;
--echo ** Commit changes from thread 2
commit;
---echo ** connection default
connection default;
drop table t1;
@@ -314,7 +293,6 @@ drop table t1;
--echo **
--echo ** one UPDATE changing result set and SELECT ... FOR UPDATE
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -332,7 +310,6 @@ drop table t1;
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Begin a new transaction on thread 2
@@ -340,7 +317,6 @@ drop table t1;
--echo ** Select a range for update.
select * from t1 where tipo=2 FOR UPDATE;
- --echo ** connection thread1
connection thread1;
--echo ** Begin a new transaction on thread 1
begin;
@@ -352,7 +328,6 @@ drop table t1;
--echo ** transaction failed and was rolled back.
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** The table should look unmodified from thread 2.
select * from t1;
@@ -360,22 +335,18 @@ drop table t1;
--echo ** thread 1 to complete the transaction.
commit;
- --echo ** connection thread1
connection thread1;
--echo ** Commit on thread 1.
commit;
- --echo ** connection thread2
connection thread2;
--echo ** The table should not have been changed.
select * from t1;
- --echo ** connection thread1
connection thread1;
--echo ** Even on thread 1:
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -384,7 +355,6 @@ drop table t1;
--echo **
--echo ** one UPDATE not changing result set and SELECT ... FOR UPDATE
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -402,7 +372,6 @@ drop table t1;
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Starting new transaction on thread 2.
@@ -410,7 +379,6 @@ drop table t1;
--echo ** Starting SELECT .. FOR UPDATE
select * from t1 where tipo=2 FOR UPDATE;
- --echo ** connection thread1
connection thread1;
--echo
--echo ** Starting new transaction on thread 1
@@ -433,28 +401,23 @@ drop table t1;
--echo ** have changed.
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** The same thing should hold true for the transaction on
--echo ** thread 2
select * from t1;
send commit;
- --echo ** connection thread1
connection thread1;
commit;
- --echo ** connection thread2
connection thread2;
--echo ** Even after committing:
reap;
select * from t1;
- --echo ** connection thread1
connection thread1;
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -463,7 +426,6 @@ drop table t1;
--echo **
--echo ** two SELECT ... FOR UPDATE
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -481,14 +443,12 @@ drop table t1;
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Begin a new transaction on thread 2
begin;
select * from t1 where tipo=2 FOR UPDATE;
- --echo ** connection thread1
connection thread1;
--echo ** Begin a new transaction on thread 1
begin;
@@ -497,7 +457,6 @@ drop table t1;
--error ER_LOCK_WAIT_TIMEOUT
select * from t1 where tipo=1 FOR UPDATE;
- --echo ** connection thread2
connection thread2;
--echo ** Table will be unchanged and the select command will not be
--echo ** blocked:
@@ -505,22 +464,18 @@ drop table t1;
--echo ** Commit transacton on thread 2.
commit;
- --echo ** connection thread1
connection thread1;
--echo ** Commit transaction on thread 1.
commit;
- --echo ** connection thread2
connection thread2;
--echo ** Make sure table isn't blocked on thread 2:
select * from t1;
- --echo ** connection thread1
connection thread1;
--echo ** Make sure table isn't blocked on thread 1:
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -529,7 +484,6 @@ drop table t1;
--echo **
--echo ** one UPDATE changing result set and DELETE
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -547,7 +501,6 @@ drop table t1;
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
begin;
@@ -557,33 +510,27 @@ drop table t1;
# 'innodb_deleted_rows' and infos in processlist where not sucessful.
sleep 1;
- --echo ** connection thread1
connection thread1;
begin;
--error ER_LOCK_WAIT_TIMEOUT
update t1 set tipo=1 where tipo=2;
select * from t1;
- --echo ** connection thread2
connection thread2;
reap;
select * from t1;
send commit;
- --echo ** connection thread1
connection thread1;
commit;
- --echo ** connection thread2
connection thread2;
reap;
select * from t1;
- --echo ** connection thread1
connection thread1;
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -592,7 +539,6 @@ drop table t1;
--echo **
--echo ** one UPDATE not changing result set and DELETE
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -610,7 +556,6 @@ drop table t1;
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
begin;
@@ -620,7 +565,6 @@ drop table t1;
# 'innodb_deleted_rows' and infos in processlist where not sucessful.
sleep 1;
- --echo ** connection thread1
connection thread1;
begin;
--echo ** Update on t1 will cause a table scan which will be blocked because
@@ -639,22 +583,18 @@ drop table t1;
}
select * from t1;
- --echo ** connection thread2
connection thread2;
reap;
select * from t1;
send commit;
- --echo ** connection thread1
connection thread1;
commit;
- --echo ** connection thread2
connection thread2;
reap;
select * from t1;
- --echo ** connection thread1
connection thread1;
select * from t1;
@@ -662,11 +602,9 @@ drop table t1;
connection thread1;
disconnect thread1;
--source include/wait_until_disconnected.inc
---echo ** connection thread2
connection thread2;
disconnect thread2;
--source include/wait_until_disconnected.inc
---echo ** connection default
connection default;
drop table t1;
drop user mysqltest@localhost;
diff --git a/mysql-test/include/deadlock.inc b/mysql-test/include/deadlock.inc
index 84d23b80811..2fa61f48624 100644
--- a/mysql-test/include/deadlock.inc
+++ b/mysql-test/include/deadlock.inc
@@ -10,9 +10,7 @@
# main code went into include/deadlock.inc
#
---echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
---echo # Establish connection con2 (user=root)
connect (con2,localhost,root,,);
--disable_warnings
@@ -23,14 +21,12 @@ drop table if exists t1,t2;
# Testing of FOR UPDATE
#
---echo # Switch to connection con1
connection con1;
eval create table t1 (id integer, x integer) engine = $engine_type;
insert into t1 values(0, 0);
set autocommit=0;
SELECT * from t1 where id = 0 FOR UPDATE;
---echo # Switch to connection con2
connection con2;
set autocommit=0;
@@ -39,18 +35,15 @@ set autocommit=0;
update t1 set x=2 where id = 0;
--sleep 2
---echo # Switch to connection con1
connection con1;
update t1 set x=1 where id = 0;
select * from t1;
commit;
---echo # Switch to connection con2
connection con2;
reap;
commit;
---echo # Switch to connection con1
connection con1;
select * from t1;
commit;
@@ -60,7 +53,6 @@ drop table t1;
# Testing of FOR UPDATE
#
---echo # Switch to connection con1
connection con1;
eval create table t1 (id integer, x integer) engine = $engine_type;
eval create table t2 (b integer, a integer) engine = $engine_type;
@@ -73,7 +65,6 @@ update t2 set a=100 where b=(SELECT x from t1 where id = b FOR UPDATE);
select * from t2;
select * from t1;
---echo # Switch to connection con2
connection con2;
set autocommit=0;
@@ -82,18 +73,15 @@ set autocommit=0;
update t1 set x=2 where id = 0;
--sleep 2
---echo # Switch to connection con1
connection con1;
update t1 set x=1 where id = 0;
select * from t1;
commit;
---echo # Switch to connection con2
connection con2;
reap;
commit;
---echo # Switch to connection con1
connection con1;
select * from t1;
commit;
@@ -105,13 +93,11 @@ insert into t1 values(0, 0), (300, 300);
insert into t2 values(0, 0), (1, 20), (2, 30);
commit;
---echo # Switch to connection con1
connection con1;
select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE;
select * from t2;
select * from t1;
---echo # Switch to connection con2
connection con2;
# The following query should hang because con1 is locking the record
@@ -121,24 +107,20 @@ select * from t2;
update t1 set x=2 where id = 0;
--sleep 2
---echo # Switch to connection con1
connection con1;
update t1 set x=1 where id = 0;
select * from t1;
commit;
---echo # Switch to connection con2
connection con2;
reap;
commit;
---echo # Switch to connection con1
connection con1;
select * from t1;
commit;
# Cleanup
---echo # Switch to connection default + disconnect con1 and con2
connection default;
disconnect con1;
disconnect con2;
diff --git a/mysql-test/include/grant_cache.inc b/mysql-test/include/grant_cache.inc
index 111b35d6940..cb495e7feae 100644
--- a/mysql-test/include/grant_cache.inc
+++ b/mysql-test/include/grant_cache.inc
@@ -51,7 +51,6 @@ set GLOBAL query_cache_size=1355776;
reset query cache;
flush status;
---echo ----- establish connection root -----
connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root;
show grants for current_user;
@@ -67,7 +66,6 @@ insert into mysqltest.t2 values (3,3,3);
create table test.t1 (a char (10));
insert into test.t1 values ("test.t1");
select * from t1;
---echo ----- establish connection root2 -----
connect (root2,localhost,root,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root2;
# put queries in cache
@@ -86,7 +84,6 @@ grant SELECT on test.t1 to mysqltest_2@localhost;
grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
# The following queries should be fetched from cache
---echo ----- establish connection user1 (user=mysqltest_1) -----
connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user1;
show grants for current_user();
@@ -112,14 +109,12 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached";
---echo ----- establish connection unkuser (user=unkuser) -----
# Don't use '' as user because it will pick Unix login
connect (unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK);
connection unkuser;
show grants for current_user();
# The following queries should be fetched from cache
---echo ----- establish connection user2 (user=mysqltest_2) -----
connect (user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user2;
select "user2";
@@ -135,7 +130,6 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached";
# The following queries should not be fetched from cache
---echo ----- establish connection user3 (user=mysqltest_3) -----
connect (user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user3;
select "user3";
@@ -157,7 +151,6 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached";
# Connect without a database
---echo ----- establish connection user4 (user=mysqltest_1) -----
connect (user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user4;
select "user4";
@@ -175,7 +168,6 @@ show status like "Qcache_not_cached";
# Cleanup
---echo ----- close connections -----
connection root;
disconnect root;
--source include/wait_until_disconnected.inc
@@ -197,7 +189,6 @@ disconnect user4;
connection unkuser;
disconnect unkuser;
--source include/wait_until_disconnected.inc
---echo ----- switch to connection default -----
connection default;
#
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/include/query_cache.inc b/mysql-test/include/query_cache.inc
index 56dae83db2f..fcb9c2494d4 100644
--- a/mysql-test/include/query_cache.inc
+++ b/mysql-test/include/query_cache.inc
@@ -124,7 +124,6 @@ eval SET SESSION STORAGE_ENGINE = $engine_type;
SET @@autocommit=1;
connection default;
---echo connection default
# This should be 'YES'.
SHOW VARIABLES LIKE 'have_query_cache';
@@ -142,7 +141,6 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
show status like "Qcache_queries_in_cache";
connection connection1;
---echo connection connection1
START TRANSACTION;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
INSERT INTO t2 VALUES (5,'w');
@@ -153,7 +151,6 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
show status like "Qcache_queries_in_cache";
connection default;
---echo connection default
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
COMMIT;
@@ -163,7 +160,6 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
show status like "Qcache_queries_in_cache";
connection connection1;
---echo connection connection1
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
START TRANSACTION;
@@ -172,7 +168,6 @@ INSERT INTO t2 VALUES (6,'w');
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
connection default;
---echo connection default
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
START TRANSACTION;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
@@ -181,7 +176,6 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
COMMIT;
connection connection1;
---echo connection connection1
COMMIT;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
diff --git a/mysql-test/include/query_cache_sql_prepare.inc b/mysql-test/include/query_cache_sql_prepare.inc
index 41276ed5a79..1bc7c94a172 100644
--- a/mysql-test/include/query_cache_sql_prepare.inc
+++ b/mysql-test/include/query_cache_sql_prepare.inc
@@ -23,9 +23,7 @@
set GLOBAL query_cache_type=ON;
set LOCAL query_cache_type=ON;
---echo ---- establish connection con1 (root) ----
connect (con1,localhost,root,,test,$MASTER_MYPORT,);
---echo ---- switch to connection default ----
connection default;
set @initial_query_cache_size = @@global.query_cache_size;
@@ -55,7 +53,6 @@ show status like 'Qcache_hits';
execute stmt2;
show status like 'Qcache_hits';
# Another prepared statement (same text, other connection), should hit the QC
---echo ---- switch to connection con1 ----
connection con1;
prepare stmt3 from "select * from t1 where c1=10";
execute stmt3;
@@ -64,7 +61,6 @@ execute stmt3;
show status like 'Qcache_hits';
execute stmt3;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
# Mixup tests, where statements without PREPARE.../EXECUTE.... meet statements
@@ -89,20 +85,16 @@ execute stmt10;
show status like 'Qcache_hits';
eval $my_stmt;
show status like 'Qcache_hits';
---echo ---- switch to connection con1 ----
connection con1;
eval $my_stmt;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
#
# Statement without PREPARE.../EXECUTE.... first
let $my_stmt= SELECT * FROM t1 WHERE c1 = 1;
eval prepare stmt11 from "$my_stmt";
---echo ---- switch to connection con1 ----
connection con1;
eval prepare stmt12 from "$my_stmt";
---echo ---- switch to connection default ----
connection default;
eval $my_stmt;
show status like 'Qcache_hits';
@@ -110,11 +102,9 @@ eval $my_stmt;
show status like 'Qcache_hits';
execute stmt11;
show status like 'Qcache_hits';
---echo ---- switch to connection con1 ----
connection con1;
execute stmt12;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
# Query caching also works when statement has parameters
@@ -127,7 +117,6 @@ execute stmt1 using @a;
show status like 'Qcache_hits';
execute stmt1 using @a;
show status like 'Qcache_hits';
---echo ---- switch to connection con1 ----
connection con1;
set @a=1;
prepare stmt4 from "select * from t1 where c1=?";
@@ -139,7 +128,6 @@ execute stmt4 using @a;
show status like 'Qcache_hits';
execute stmt4 using @a;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
# See if enabling/disabling the query cache between PREPARE and
@@ -168,7 +156,6 @@ execute stmt1;
show status like 'Qcache_hits';
# The QC is global = affects also other connections.
# Expect to see no additional Qcache_hits.
---echo ---- switch to connection con1 ----
connection con1;
execute stmt3;
show status like 'Qcache_hits';
@@ -178,7 +165,6 @@ execute stmt3;
show status like 'Qcache_hits';
#
# then QC is re-enabled for more EXECUTE.
---echo ---- switch to connection default ----
connection default;
set global query_cache_size=102400;
# Expect to see additional Qcache_hits.
@@ -193,7 +179,6 @@ show status like 'Qcache_hits';
execute stmt1;
show status like 'Qcache_hits';
# The QC is global = affects also other connections.
---echo ---- switch to connection con1 ----
connection con1;
execute stmt3;
show status like 'Qcache_hits';
@@ -201,7 +186,6 @@ execute stmt3;
show status like 'Qcache_hits';
execute stmt3;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
#
# then QC is re-disabled for more EXECUTE.
@@ -216,7 +200,6 @@ show status like 'Qcache_hits';
execute stmt1;
show status like 'Qcache_hits';
# The QC is global = affects also other connections.
---echo ---- switch to connection con1 ----
connection con1;
execute stmt3;
show status like 'Qcache_hits';
@@ -226,15 +209,12 @@ execute stmt3;
show status like 'Qcache_hits';
#
---echo ---- switch to connection default ----
connection default;
# QC is disabled at PREPARE
set global query_cache_size=0;
prepare stmt1 from "select * from t1 where c1=10";
---echo ---- switch to connection con1 ----
connection con1;
prepare stmt3 from "select * from t1 where c1=10";
---echo ---- switch to connection default ----
connection default;
# then QC is enabled at EXECUTE
set global query_cache_size=102400;
@@ -246,7 +226,6 @@ show status like 'Qcache_hits';
execute stmt1;
show status like 'Qcache_hits';
# The QC is global = affects also other connections.
---echo ---- switch to connection con1 ----
connection con1;
show status like 'Qcache_hits';
execute stmt3;
@@ -255,7 +234,6 @@ execute stmt3;
show status like 'Qcache_hits';
execute stmt3;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
#
# QC is disabled at PREPARE
@@ -276,7 +254,6 @@ show status like 'Qcache_hits';
drop table t1;
---echo ---- disconnect connection con1 ----
disconnect con1;
#
diff --git a/mysql-test/include/rpl_connect.inc b/mysql-test/include/rpl_connect.inc
index 11927833f53..e30769eb335 100644
--- a/mysql-test/include/rpl_connect.inc
+++ b/mysql-test/include/rpl_connect.inc
@@ -51,7 +51,9 @@ if ($rpl_debug)
{
--echo connect ($rpl_connection_name,127.0.0.1,root,,test,$_rpl_port,)
}
+disable_connect_log;
--connect ($rpl_connection_name,127.0.0.1,root,,test,$_rpl_port,)
+enable_connect_log;
--let $include_filename= rpl_connect.inc
diff --git a/mysql-test/include/rpl_connection.inc b/mysql-test/include/rpl_connection.inc
index 1988568a4d2..256a4756e3a 100644
--- a/mysql-test/include/rpl_connection.inc
+++ b/mysql-test/include/rpl_connection.inc
@@ -43,5 +43,7 @@ if ($_include_file_depth)
--echo [connection $rpl_connection_name]
}
}
+disable_connect_log;
--connection $rpl_connection_name
+enable_connect_log;
--let $rpl_connection_name=
diff --git a/mysql-test/include/rpl_connection_master.inc b/mysql-test/include/rpl_connection_master.inc
deleted file mode 100644
index fa09cc8a610..00000000000
--- a/mysql-test/include/rpl_connection_master.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-let $rpl_connection_name= master;
-source include/rpl_connection.inc;
diff --git a/mysql-test/include/rpl_connection_slave.inc b/mysql-test/include/rpl_connection_slave.inc
deleted file mode 100644
index 8dcfb3b611b..00000000000
--- a/mysql-test/include/rpl_connection_slave.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-let $rpl_connection_name= slave;
-source include/rpl_connection.inc;
diff --git a/mysql-test/include/rpl_connection_slave1.inc b/mysql-test/include/rpl_connection_slave1.inc
deleted file mode 100644
index a408d14596b..00000000000
--- a/mysql-test/include/rpl_connection_slave1.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-let $rpl_connection_name= slave1;
-source include/rpl_connection.inc;
diff --git a/mysql-test/include/rpl_ip_mix.inc b/mysql-test/include/rpl_ip_mix.inc
index 96766e7dbdd..d547d77a3cc 100644
--- a/mysql-test/include/rpl_ip_mix.inc
+++ b/mysql-test/include/rpl_ip_mix.inc
@@ -1,13 +1,9 @@
---echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
---echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
---echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
---echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
@@ -15,10 +11,7 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
disconnect slave;
---echo disconnect master;
disconnect master;
---echo connection default;
connection default;
diff --git a/mysql-test/include/rpl_ip_mix2.inc b/mysql-test/include/rpl_ip_mix2.inc
index 390c788a461..72011558d45 100644
--- a/mysql-test/include/rpl_ip_mix2.inc
+++ b/mysql-test/include/rpl_ip_mix2.inc
@@ -1,13 +1,9 @@
---echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
---echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
---echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
---echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
@@ -15,10 +11,7 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
disconnect slave;
---echo disconnect master;
disconnect master;
---echo connection default;
connection default;
diff --git a/mysql-test/include/rpl_ipv6.inc b/mysql-test/include/rpl_ipv6.inc
index d2d53a4841a..69f282e22d9 100644
--- a/mysql-test/include/rpl_ipv6.inc
+++ b/mysql-test/include/rpl_ipv6.inc
@@ -1,22 +1,15 @@
---echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
---echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
---echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
---echo connection slave;
connection slave;
reset slave;
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
disconnect slave;
---echo disconnect master;
disconnect master;
---echo connection default;
connection default;
diff --git a/mysql-test/include/rpl_loaddata_charset.inc b/mysql-test/include/rpl_loaddata_charset.inc
index 0e445446a38..46a701aa2f7 100644
--- a/mysql-test/include/rpl_loaddata_charset.inc
+++ b/mysql-test/include/rpl_loaddata_charset.inc
@@ -19,12 +19,10 @@ if ($LOAD_LOCAL)
}
save_master_pos;
-echo ----------content on master----------;
SELECT hex(cl) FROM t;
connection slave;
sync_with_master;
-echo ----------content on slave----------;
USE mysqltest;
SELECT hex(cl) FROM t;
diff --git a/mysql-test/include/rpl_stmt_seq.inc b/mysql-test/include/rpl_stmt_seq.inc
index 08f6e44aba0..b23178ee534 100644
--- a/mysql-test/include/rpl_stmt_seq.inc
+++ b/mysql-test/include/rpl_stmt_seq.inc
@@ -70,8 +70,6 @@ let $_log_num_s= `select @aux`;
###############################################################
# INSERT
###############################################################
---echo
---echo -------- switch to master -------
connection master;
# Maybe it would be smarter to use a table with an autoincrement column.
let $MAX= `SELECT MAX(f1) FROM t1` ;
@@ -85,8 +83,6 @@ if ($show_binlog)
}
sync_slave_with_master;
---echo
---echo -------- switch to slave --------
connection slave;
# results before DDL(to be tested)
SELECT MAX(f1) FROM t1;
@@ -99,8 +95,6 @@ if ($show_binlog)
###############################################################
# command to be tested
###############################################################
---echo
---echo -------- switch to master -------
connection master;
eval $my_stmt;
# Devaluate $my_stmt, to detect script bugs
@@ -114,8 +108,6 @@ if ($show_binlog)
}
sync_slave_with_master;
---echo
---echo -------- switch to slave --------
connection slave;
# results after DDL(to be tested)
SELECT MAX(f1) FROM t1;
@@ -128,8 +120,6 @@ if ($show_binlog)
###############################################################
# ROLLBACK
###############################################################
---echo
---echo -------- switch to master -------
connection master;
ROLLBACK;
# results after final ROLLBACK
@@ -151,8 +141,6 @@ if ($show_binlog)
}
sync_slave_with_master;
---echo
---echo -------- switch to slave --------
connection slave;
# results after final ROLLBACK
SELECT MAX(f1) FROM t1;
@@ -181,16 +169,12 @@ if ($manipulate)
# - flush the master and the slave log
# ---> both start to write into new logs with incremented number
# - increment $_log_num_n
---echo
---echo -------- switch to master -------
connection master;
flush logs;
# sleep 1;
# eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
sync_slave_with_master;
---echo
---echo -------- switch to slave --------
connection slave;
# the final content of the binary log
flush logs;
@@ -202,6 +186,4 @@ flush logs;
inc $_log_num_n;
}
---echo
---echo -------- switch to master -------
connection master;
diff --git a/mysql-test/include/rpl_sync.inc b/mysql-test/include/rpl_sync.inc
index be2904528ff..83d4a2e4628 100644
--- a/mysql-test/include/rpl_sync.inc
+++ b/mysql-test/include/rpl_sync.inc
@@ -81,7 +81,9 @@ while ($_rpl_i) {
}
if ($rpl_only_running_threads)
{
+ disable_connect_log;
--connection server_$_rpl_server
+ enable_connect_log;
--let $_rpl_slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1)
--let $_rpl_slave_sql_running= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1)
if ($rpl_debug)
@@ -92,7 +94,9 @@ while ($_rpl_i) {
--let $_rpl_slave_sql_running= `SELECT IF('$_rpl_slave_sql_running' = 'Yes', 1, '')`
if ($_rpl_slave_io_running)
{
+ disable_query_log;
--connection server_$_rpl_prev_server
+ enable_query_log;
if ($_rpl_slave_sql_running)
{
if ($rpl_debug)
@@ -101,7 +105,9 @@ while ($_rpl_i) {
--let $_rpl_master_pos= query_get_value("SHOW MASTER STATUS", Position, 1)
--echo syncing master_file='$_rpl_master_file' master_pos='$_rpl_master_pos'
}
+ disable_connect_log;
--sync_slave_with_master server_$_rpl_server
+ enable_connect_log;
}
if (!$_rpl_slave_sql_running)
{
@@ -119,6 +125,7 @@ while ($_rpl_i) {
}
if (!$rpl_only_running_threads)
{
+ disable_connect_log;
--connection server_$_rpl_prev_server
if ($rpl_debug)
{
@@ -127,6 +134,7 @@ while ($_rpl_i) {
--echo syncing master_file='$_rpl_master_file' master_pos='$_rpl_master_pos'
}
--sync_slave_with_master server_$_rpl_server
+ enable_connect_log;
}
}
diff --git a/mysql-test/include/rpl_udf.inc b/mysql-test/include/rpl_udf.inc
index 71a6304c303..95b953efc2f 100644
--- a/mysql-test/include/rpl_udf.inc
+++ b/mysql-test/include/rpl_udf.inc
@@ -30,7 +30,6 @@ drop table if exists t1;
# Test 1) Test UDFs via loadable libraries
#
--echo "*** Test 1) Test UDFs via loadable libraries ***
---echo "Running on the master"
--enable_info
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
@@ -48,7 +47,6 @@ connection slave;
sync_with_master;
# Check to see that UDF CREATE statements were replicated
---echo "Running on the slave"
--enable_info
--replace_column 3 UDF_LIB
SELECT * FROM mysql.func ORDER BY name;
@@ -57,7 +55,6 @@ SELECT * FROM mysql.func ORDER BY name;
connection master;
# Use the UDFs to do something
---echo "Running on the master"
--enable_info
eval CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=$engine_type;
--disable_warnings
@@ -72,7 +69,6 @@ SELECT * FROM t1 ORDER BY sum;
sync_slave_with_master;
# Check to see if data was replicated
---echo "Running on the slave"
--enable_info
SELECT * FROM t1 ORDER BY sum;
@@ -84,7 +80,6 @@ SELECT myfunc_double(75.00);
connection master;
# Drop the functions
---echo "Running on the master"
--enable_info
DROP FUNCTION myfunc_double;
DROP FUNCTION myfunc_int;
@@ -94,7 +89,6 @@ SELECT * FROM mysql.func ORDER BY name;
sync_slave_with_master;
# Check to see if the UDFs were dropped on the slave
---echo "Running on the slave"
--enable_info
SELECT * FROM mysql.func ORDER BY name;
--disable_info
@@ -102,7 +96,6 @@ SELECT * FROM mysql.func ORDER BY name;
connection master;
# Cleanup
---echo "Running on the master"
--enable_info
DROP TABLE t1;
--disable_info
@@ -111,7 +104,6 @@ DROP TABLE t1;
# Test 2) Test UDFs with SQL body
#
--echo "*** Test 2) Test UDFs with SQL body ***
---echo "Running on the master"
--enable_info
CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i;
CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00;
@@ -121,7 +113,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
sync_slave_with_master;
# Check to see that UDF CREATE statements were replicated
---echo "Running on the slave"
--enable_info
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
--disable_info
@@ -129,7 +120,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
connection master;
# Use the UDFs to do something
---echo "Running on the master"
--enable_info
eval CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=$engine_type;
INSERT INTO t1 VALUES(myfuncsql_int(100), myfuncsql_double(50.00));
@@ -142,7 +132,6 @@ SELECT * FROM t1 ORDER BY sum;
sync_slave_with_master;
# Check to see if data was replicated
---echo "Running on the slave"
--enable_info
SELECT * FROM t1 ORDER BY sum;
--disable_info
@@ -150,7 +139,6 @@ SELECT * FROM t1 ORDER BY sum;
connection master;
# Modify the UDFs to add a comment
---echo "Running on the master"
--enable_info
ALTER FUNCTION myfuncsql_int COMMENT "This was altered.";
ALTER FUNCTION myfuncsql_double COMMENT "This was altered.";
@@ -160,7 +148,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
sync_slave_with_master;
# Check to see if data was replicated
---echo "Running on the slave"
--enable_info
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
@@ -172,7 +159,6 @@ SELECT myfuncsql_double(75.00);
connection master;
# Drop the functions
---echo "Running on the master"
--enable_info
DROP FUNCTION myfuncsql_double;
DROP FUNCTION myfuncsql_int;
@@ -182,7 +168,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
sync_slave_with_master;
# Check to see if the UDFs were dropped on the slave
---echo "Running on the slave"
--enable_info
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
--disable_info
@@ -190,7 +175,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
connection master;
# Cleanup
---echo "Running on the master"
--enable_info
DROP TABLE t1;
--disable_info