diff --git a/mysql-test/include/check_concurrent_insert.inc b/mysql-test/include/check_concurrent_insert.inc index 6a9ada65562..f4bec3c9cdb 100644 --- a/mysql-test/include/check_concurrent_insert.inc +++ b/mysql-test/include/check_concurrent_insert.inc @@ -10,9 +10,9 @@ # $con_aux2 Name of the second auxiliary connection to be used by this # script. # $statement Statement to be checked. -# $restore_table Table which might be modified affected by statement to be -# checked and thus needs backing up before its execution -# and restoring after it (can be empty). +# $restore_table Table which might be modified by statement to be checked +# and thus needs backing up before its execution and +# restoring after it (can be empty). # # EXAMPLE # lock_sync.test @@ -25,7 +25,7 @@ set debug_sync= "RESET"; if (`SELECT '$restore_table' <> ''`) { ---eval create table t_backup select * from $restore_table; +--eval create temporary table t_backup select * from $restore_table; } connection $con_aux1; @@ -34,19 +34,19 @@ set debug_sync='after_lock_tables_takes_lock SIGNAL parked WAIT_FOR go'; connection $con_aux2; set debug_sync='now WAIT_FOR parked'; ---send_eval insert into $table values (0); +--send_eval insert into $table (i) values (0); --enable_result_log --enable_query_log connection default; # Wait until concurrent insert is successfully executed while # statement being checked has its tables locked. -# We use wait_condition.inc instead of simply executing +# We use wait_condition.inc instead of simply reaping # concurrent insert here in order to avoid deadlocks if test -# fails and timing out instead. +# fails and to time out gracefully instead. let $wait_condition= select count(*) = 0 from information_schema.processlist - where info = "insert into $table values (0)"; + where info = "insert into $table (i) values (0)"; --source include/wait_condition.inc --disable_result_log @@ -86,7 +86,7 @@ if (`SELECT '$restore_table' <> ''`) { --eval truncate table $restore_table; --eval insert into $restore_table select * from t_backup; -drop table t_backup; +drop temporary table t_backup; } # Clean-up. Reset DEBUG_SYNC facility after use. diff --git a/mysql-test/include/check_no_concurrent_insert.inc b/mysql-test/include/check_no_concurrent_insert.inc index 278ffeffb1e..57772dddefc 100644 --- a/mysql-test/include/check_no_concurrent_insert.inc +++ b/mysql-test/include/check_no_concurrent_insert.inc @@ -10,9 +10,9 @@ # $con_aux2 Name of the second auxiliary connection to be used by this # script. # $statement Statement to be checked. -# $restore_table Table which might be modified affected by statement to be -# checked and thus needs backing up before its execution -# and restoring after it (can be empty). +# $restore_table Table which might be modified by statement to be checked +# and thus needs backing up before its execution and +# restoring after it (can be empty). # # EXAMPLE # lock_sync.test @@ -25,7 +25,7 @@ set debug_sync= "RESET"; if (`SELECT '$restore_table' <> ''`) { ---eval create table t_backup select * from $restore_table; +--eval create temporary table t_backup select * from $restore_table; } connection $con_aux1; @@ -34,7 +34,7 @@ set debug_sync='after_lock_tables_takes_lock SIGNAL parked WAIT_FOR go'; connection $con_aux2; set debug_sync='now WAIT_FOR parked'; ---send_eval insert into $table values (0); +--send_eval insert into $table (i) values (0); --enable_result_log --enable_query_log @@ -43,7 +43,7 @@ connection default; # of our statement. let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Table lock" and info = "insert into $table values (0)"; + where state = "Table lock" and info = "insert into $table (i) values (0)"; --source include/wait_condition.inc --disable_result_log @@ -71,7 +71,7 @@ if (`SELECT '$restore_table' <> ''`) { --eval truncate table $restore_table; --eval insert into $restore_table select * from t_backup; -drop table t_backup; +drop temporary table t_backup; } # Clean-up. Reset DEBUG_SYNC facility after use. diff --git a/mysql-test/include/check_no_row_lock.inc b/mysql-test/include/check_no_row_lock.inc index 958161b9b7f..c08e7f35b10 100644 --- a/mysql-test/include/check_no_row_lock.inc +++ b/mysql-test/include/check_no_row_lock.inc @@ -29,9 +29,9 @@ connection default; # Wait until statement is successfully executed while # all rows in table are X-locked. This means that it # does not acquire any row locks. -# We use wait_condition.inc instead of simply executing +# We use wait_condition.inc instead of simply reaping # statement here in order to avoid deadlocks if test -# fails and timing out instead. +# fails and to time out gracefully instead. let $wait_condition= select count(*) = 0 from information_schema.processlist where info = "$statement"; diff --git a/mysql-test/r/innodb_mysql_lock2.result b/mysql-test/r/innodb_mysql_lock2.result index 70cfbee6463..17dd747de6f 100644 --- a/mysql-test/r/innodb_mysql_lock2.result +++ b/mysql-test/r/innodb_mysql_lock2.result @@ -178,8 +178,7 @@ end| # 1.1 Simple SELECT statement. # # No locks are necessary as this statement won't be written -# to the binary log and thanks to how MyISAM works SELECT -# will see version of the table prior to concurrent insert. +# to the binary log and InnoDB supports snapshots. Success: 'select * from t1' doesn't take row locks on 't1'. # # 1.2 Multi-UPDATE statement. @@ -484,7 +483,7 @@ Success: 'insert into t2 values (f13((select i+10 from t1 where i=1)))' takes sh # row locks on the data it reads. Success: 'call p2(@a)' doesn't take row locks on 't1'. # -# 5.2 Function that modifes data and uses CALL, +# 5.2 Function that modifies data and uses CALL, # which reads a table through SELECT. # # Since a call to such function is written to the binary diff --git a/mysql-test/r/lock_sync.result b/mysql-test/r/lock_sync.result index e6265f1cb5e..3682f0df26a 100644 --- a/mysql-test/r/lock_sync.result +++ b/mysql-test/r/lock_sync.result @@ -511,7 +511,7 @@ Success: 'insert into t2 values (f13((select i+10 from t1 where i=1)))' doesn't # strong locks on the data it reads. Success: 'call p2(@a)' allows concurrent inserts into 't1'. # -# 5.2 Function that modifes data and uses CALL, +# 5.2 Function that modifies data and uses CALL, # which reads a table through SELECT. # # Since a call to such function is written to the binary diff --git a/mysql-test/t/innodb_mysql_lock2.test b/mysql-test/t/innodb_mysql_lock2.test index 1f01f4cb010..048d712183f 100644 --- a/mysql-test/t/innodb_mysql_lock2.test +++ b/mysql-test/t/innodb_mysql_lock2.test @@ -204,8 +204,7 @@ let $table= t1; --echo # 1.1 Simple SELECT statement. --echo # --echo # No locks are necessary as this statement won't be written ---echo # to the binary log and thanks to how MyISAM works SELECT ---echo # will see version of the table prior to concurrent insert. +--echo # to the binary log and InnoDB supports snapshots. let $statement= select * from t1; --source include/check_no_row_lock.inc @@ -659,7 +658,7 @@ let $statement= call p2(@a); --source include/check_no_row_lock.inc --echo # ---echo # 5.2 Function that modifes data and uses CALL, +--echo # 5.2 Function that modifies data and uses CALL, --echo # which reads a table through SELECT. --echo # --echo # Since a call to such function is written to the binary diff --git a/mysql-test/t/lock_sync.test b/mysql-test/t/lock_sync.test index 921ce991652..2f35da9d1ee 100644 --- a/mysql-test/t/lock_sync.test +++ b/mysql-test/t/lock_sync.test @@ -716,7 +716,7 @@ let $restore_table= ; --source include/check_concurrent_insert.inc --echo # ---echo # 5.2 Function that modifes data and uses CALL, +--echo # 5.2 Function that modifies data and uses CALL, --echo # which reads a table through SELECT. --echo # --echo # Since a call to such function is written to the binary