=== modified file 'mysql-test/include/wait_until_count_sessions.inc' --- mysql-test/include/wait_until_count_sessions.inc 2009-02-09 20:52:40 +0000 +++ mysql-test/include/wait_until_count_sessions.inc 2009-02-24 15:45:08 +0000 @@ -2,14 +2,23 @@ # # SUMMARY # -# Waits until the passed number ($count_sessions) of concurrent sessions was -# observed via +# Waits until the passed number ($count_sessions) of concurrent sessions or +# a smaller number was observed via # SHOW STATUS LIKE 'Threads_connected' # or the operation times out. -# Note: Starting with 5.1 we could also use -# SELECT COUNT(*) FROM information_schema.processlist -# I stay with "SHOW STATUS LIKE 'Threads_connected'" because this -# runs in all versions 5.0+ +# Note: +# 1. We wait for $current_sessions <= $count_sessions because in the use case +# with count_sessions.inc before and wait_until_count_sessions.inc after +# the core of the test it could happen that the disconnects of sessions +# belonging to the preceeding test are not finished. +# sessions at test begin($count_sessions) = m + n +# sessions of the previous test which will be soon disconnected = n (n >= 0) +# sessions at test end ($current sessions, assuming the test disconnects +# all additional sessions) = m +# 2. Starting with 5.1 we could also use +# SELECT COUNT(*) FROM information_schema.processlist +# I stay with "SHOW STATUS LIKE 'Threads_connected'" because this +# runs in all versions 5.0+ # # # USAGE @@ -19,7 +28,7 @@ # # OR typical example of a test which uses more than one session # Such a test could harm successing tests if there is no server shutdown -# and start between.cw +# and start between. # # If the testing box is slow than the disconnect of sessions belonging to # the current test might happen when the successing test gets executed. @@ -79,7 +88,11 @@ # backup.test, grant3.test # # -# Created: 2009-01-14 mleich +# Created: +# 2009-01-14 mleich +# Modified: +# 2009-02-24 mleich Fix Bug#43114 wait_until_count_sessions too restrictive, +# random PB failures # let $wait_counter= 100; @@ -93,7 +106,7 @@ while ($wait_counter) { let $current_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1); - let $success= `SELECT $current_sessions = $count_sessions`; + let $success= `SELECT $current_sessions <= $count_sessions`; if ($success) { let $wait_counter= 0; @@ -107,7 +120,7 @@ if (!$success) { --echo # Timeout in wait_until_count_sessions.inc - --echo # Number of sessions expected: $count_sessions found: $current_sessions + --echo # Number of sessions expected: < $count_sessions found: $current_sessions SHOW PROCESSLIST; } === modified file 'mysql-test/r/consistent_snapshot.result' --- mysql-test/r/consistent_snapshot.result 2004-11-10 16:56:45 +0000 +++ mysql-test/r/consistent_snapshot.result 2009-02-18 20:09:42 +0000 @@ -1,15 +1,23 @@ -drop table if exists t1; -create table t1 (a int) engine=innodb; -start transaction with consistent snapshot; -insert into t1 values(1); -select * from t1; +DROP TABLE IF EXISTS t1; +# Establish connection con1 (user=root) +# Establish connection con2 (user=root) +# Switch to connection con1 +CREATE TABLE t1 (a INT) ENGINE=innodb; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +# Switch to connection con2 +INSERT INTO t1 VALUES(1); +# Switch to connection con1 +SELECT * FROM t1; a -commit; -delete from t1; -start transaction; -insert into t1 values(1); -select * from t1; +COMMIT; +DELETE FROM t1; +START TRANSACTION; +# Switch to connection con2 +INSERT INTO t1 VALUES(1); +# Switch to connection con1 +SELECT * FROM t1; a 1 -commit; -drop table t1; +COMMIT; +# Switch to connection default + close connections con1 and con2 +DROP TABLE t1; === modified file 'mysql-test/r/dirty_close.result' --- mysql-test/r/dirty_close.result 2002-02-13 20:37:19 +0000 +++ mysql-test/r/dirty_close.result 2009-02-18 20:14:19 +0000 @@ -1,9 +1,9 @@ -drop table if exists t1; -create table t1 (n int); -insert into t1 values (1),(2),(3); -select * from t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (n INT); +INSERT INTO t1 VALUES (1),(2),(3); +SELECT * FROM t1; n 1 2 3 -drop table t1; +DROP TABLE t1; === modified file 'mysql-test/r/flush_block_commit.result' --- mysql-test/r/flush_block_commit.result 2006-12-08 11:22:46 +0000 +++ mysql-test/r/flush_block_commit.result 2009-02-18 20:38:35 +0000 @@ -1,39 +1,57 @@ -drop table if exists t1; -create table t1 (a int) engine=innodb; -begin; -insert into t1 values(1); -flush tables with read lock; -select * from t1; -a -commit; -select * from t1; -a -unlock tables; -begin; -select * from t1 for update; -a -1 -begin; -select * from t1 for update; -flush tables with read lock; -commit; -a -1 -unlock tables; -commit; -begin; -insert into t1 values(10); -flush tables with read lock; -commit; -unlock tables; -flush tables with read lock; -unlock tables; -begin; -select * from t1; +# Establish connection con1 (user=root) +# Establish connection con2 (user=root) +# Establish connection con3 (user=root) +# Switch to connection con1 +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a INT) ENGINE=innodb; +BEGIN; +INSERT INTO t1 VALUES(1); +# Switch to connection con2 +FLUSH TABLES WITH READ LOCK; +SELECT * FROM t1; +a +# Switch to connection con1 +COMMIT; +# Switch to connection con2 +SELECT * FROM t1; +a +UNLOCK TABLES; +# Switch to connection con1 +# Switch to connection con1 +BEGIN; +SELECT * FROM t1 FOR UPDATE; +a +1 +# Switch to connection con2 +BEGIN; +SELECT * FROM t1 FOR UPDATE; +# Switch to connection con3 +FLUSH TABLES WITH READ LOCK; +# Switch to connection con1 +COMMIT; +# Switch to connection con2 +a +1 +# Switch to connection con3 +UNLOCK TABLES; +# Switch to connection con2 +COMMIT; +# Switch to connection con1 +BEGIN; +INSERT INTO t1 VALUES(10); +FLUSH TABLES WITH READ LOCK; +COMMIT; +UNLOCK TABLES; +# Switch to connection con2 +FLUSH TABLES WITH READ LOCK; +UNLOCK TABLES; +BEGIN; +SELECT * FROM t1; a 1 10 -show create database test; +SHOW CREATE DATABASE test; Database Create Database test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ -drop table t1; +DROP TABLE t1; +# Switch to connection default and close connections con1, con2, con3 === modified file 'mysql-test/r/flush_block_commit_notembedded.result' --- mysql-test/r/flush_block_commit_notembedded.result 2007-01-02 23:35:57 +0000 +++ mysql-test/r/flush_block_commit_notembedded.result 2009-02-18 20:19:17 +0000 @@ -1,15 +1,23 @@ -create table t1 (a int) engine=innodb; -reset master; -set autocommit=0; -insert t1 values (1); -flush tables with read lock; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 98 -commit; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 98 -unlock tables; -drop table t1; -set autocommit=1; +# Establish connection con1 (user=root) +# Establish connection con2 (user=root) +# Switch to connection con1 +CREATE TABLE t1 (a INT) ENGINE=innodb; +RESET MASTER; +SET AUTOCOMMIT=0; +INSERT t1 VALUES (1); +# Switch to connection con2 +FLUSH TABLES WITH READ LOCK; +SHOW MASTER STATUS; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 98 +# Switch to connection con1 +COMMIT; +# Switch to connection con2 +SHOW MASTER STATUS; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 98 +UNLOCK TABLES; +# Switch to connection con1 +DROP TABLE t1; +SET AUTOCOMMIT=1; +# Switch to connection default and close connections con1 and con2 === modified file 'mysql-test/r/flush_read_lock_kill.result' --- mysql-test/r/flush_read_lock_kill.result 2006-10-04 11:09:37 +0000 +++ mysql-test/r/flush_read_lock_kill.result 2009-02-18 21:07:15 +0000 @@ -1,9 +1,12 @@ -drop table if exists t1; -create table t1 (kill_id int); -insert into t1 values(connection_id()); -flush tables with read lock; -select ((@id := kill_id) - kill_id) from t1; +SET @old_concurrent_insert= @@global.concurrent_insert; +SET @@global.concurrent_insert= 0; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (kill_id INT); +INSERT INTO t1 VALUES(connection_id()); +FLUSH TABLES WITH READ LOCK; +SELECT ((@id := kill_id) - kill_id) FROM t1; ((@id := kill_id) - kill_id) 0 -kill connection @id; -drop table t1; +KILL CONNECTION @id; +DROP TABLE t1; +SET @@global.concurrent_insert= @old_concurrent_insert; === modified file 'mysql-test/r/lock_multi.result' --- mysql-test/r/lock_multi.result 2008-10-09 15:24:31 +0000 +++ mysql-test/r/lock_multi.result 2009-02-24 12:37:18 +0000 @@ -51,10 +51,10 @@ UNLOCK TABLES; DROP DATABASE mysqltest_1; ERROR HY000: Can't drop database 'mysqltest_1'; database doesn't exist -use mysql; +USE mysql; LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE; FLUSH TABLES; -use mysql; +USE mysql; SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1; OPTIMIZE TABLES columns_priv, db, host, user; Table Op Msg_type Msg_text @@ -65,7 +65,7 @@ UNLOCK TABLES; Select_priv N -use test; +USE test; use test; CREATE TABLE t1 (c1 int); LOCK TABLE t1 WRITE; @@ -93,7 +93,7 @@ connection: locker lock tables t1 read; connection: writer -create table t2 like t1;; +create table t2 like t1; connection: default kill query ERROR 70100: Query execution was interrupted === modified file 'mysql-test/r/read_only.result' --- mysql-test/r/read_only.result 2007-12-10 15:16:21 +0000 +++ mysql-test/r/read_only.result 2009-02-24 14:44:06 +0000 @@ -47,7 +47,7 @@ drop table t1,t2; drop user test@localhost; # -# Bug #27440 read_only allows create and drop database +# Bug#27440 read_only allows create and drop database # drop database if exists mysqltest_db1; drop database if exists mysqltest_db2; === modified file 'mysql-test/r/show_check.result' --- mysql-test/r/show_check.result 2008-08-15 20:13:27 +0000 +++ mysql-test/r/show_check.result 2009-02-18 20:00:13 +0000 @@ -507,9 +507,9 @@ drop table mysqltest.t1; drop database mysqltest; set names binary; -delete from mysql.user +delete from mysql.user where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3'; -delete from mysql.db +delete from mysql.db where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3'; flush privileges; CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY; @@ -916,7 +916,7 @@ Trigger Event Table Statement Timing Created sql_mode Definer t1_bi INSERT t1 SET @a = 1 BEFORE NULL root@localhost ---------------------------------------------------------------- -SELECT +SELECT TRIGGER_CATALOG, TRIGGER_SCHEMA, TRIGGER_NAME, === modified file 'mysql-test/r/skip_name_resolve.result' --- mysql-test/r/skip_name_resolve.result 2005-12-14 12:18:24 +0000 +++ mysql-test/r/skip_name_resolve.result 2009-02-18 20:06:59 +0000 @@ -5,10 +5,10 @@ GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255' REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255'; DROP USER mysqltest_1@'127.0.0.1/255.255.255.255'; -select user(); -user() +SELECT USER(); +USER() # -show processlist; +SHOW PROCESSLIST; Id User Host db Command Time State Info root test