2012-02-07 16:22:36 +01:00
|
|
|
--source include/have_innodb.inc
|
2008-12-14 13:00:37 -07:00
|
|
|
#
|
|
|
|
# Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK
|
|
|
|
# http://bugs.mysql.com/38231
|
|
|
|
#
|
|
|
|
|
2010-05-12 10:42:28 +03:00
|
|
|
# skip this test in embedded mode because "TRUNCATE TABLE bug38231_1"
|
|
|
|
# hangs in that mode waiting for "lock_wait_timeout" although it is
|
|
|
|
# preceded by --send
|
|
|
|
-- source include/not_embedded.inc
|
|
|
|
|
2020-01-13 21:07:04 +02:00
|
|
|
SET default_storage_engine=InnoDB;
|
2008-12-14 13:00:37 -07:00
|
|
|
|
|
|
|
# we care only that the following SQL commands do not crash the server
|
|
|
|
-- disable_query_log
|
|
|
|
-- disable_result_log
|
|
|
|
|
2010-04-19 19:58:12 +03:00
|
|
|
DROP TABLE IF EXISTS bug38231_1;
|
|
|
|
CREATE TABLE bug38231_1 (a INT);
|
2008-12-14 13:00:37 -07:00
|
|
|
|
2010-04-19 19:58:12 +03:00
|
|
|
-- connect (lock_gain,localhost,root,,)
|
|
|
|
-- connect (lock_wait1,localhost,root,,)
|
|
|
|
-- connect (lock_wait2,localhost,root,,)
|
|
|
|
-- connect (truncate_wait,localhost,root,,)
|
2008-12-14 13:00:37 -07:00
|
|
|
|
2010-04-19 19:58:12 +03:00
|
|
|
-- connection lock_gain
|
2008-12-14 13:00:37 -07:00
|
|
|
SET autocommit=0;
|
2010-04-19 19:58:12 +03:00
|
|
|
LOCK TABLE bug38231_1 WRITE;
|
2008-12-14 13:00:37 -07:00
|
|
|
|
2010-04-19 19:58:12 +03:00
|
|
|
-- connection lock_wait1
|
2008-12-14 13:00:37 -07:00
|
|
|
SET autocommit=0;
|
|
|
|
-- send
|
2010-04-19 19:58:12 +03:00
|
|
|
LOCK TABLE bug38231_1 WRITE;
|
2010-04-14 14:14:48 +03:00
|
|
|
|
2010-04-19 19:58:12 +03:00
|
|
|
-- connection lock_wait2
|
2010-04-14 14:14:48 +03:00
|
|
|
SET autocommit=0;
|
|
|
|
-- send
|
2010-04-19 19:58:12 +03:00
|
|
|
LOCK TABLE bug38231_1 WRITE;
|
2010-04-14 14:14:48 +03:00
|
|
|
|
2010-04-19 19:58:12 +03:00
|
|
|
-- connection truncate_wait
|
2008-12-14 13:00:37 -07:00
|
|
|
-- send
|
2010-04-19 19:58:12 +03:00
|
|
|
TRUNCATE TABLE bug38231_1;
|
2010-04-14 14:14:48 +03:00
|
|
|
|
2010-04-19 19:58:12 +03:00
|
|
|
-- connection lock_gain
|
2008-12-14 13:00:37 -07:00
|
|
|
# this crashes the server if the bug is present
|
|
|
|
UNLOCK TABLES;
|
|
|
|
|
|
|
|
# clean up
|
|
|
|
|
2010-04-23 17:12:56 +03:00
|
|
|
# do not clean up - we do not know which of the three has been released
|
2010-05-12 10:44:23 +03:00
|
|
|
# so the --reap command may hang because the command that is being executed
|
|
|
|
# in that connection is still running/waiting
|
2010-04-19 19:58:12 +03:00
|
|
|
#-- connection lock_wait1
|
|
|
|
#-- reap
|
|
|
|
#UNLOCK TABLES;
|
|
|
|
#
|
|
|
|
#-- connection lock_wait2
|
|
|
|
#-- reap
|
|
|
|
#UNLOCK TABLES;
|
|
|
|
#
|
|
|
|
#-- connection truncate_wait
|
|
|
|
#-- reap
|
2010-04-14 14:14:48 +03:00
|
|
|
|
2008-12-14 13:00:37 -07:00
|
|
|
-- connection default
|
2010-04-14 14:14:48 +03:00
|
|
|
|
2010-04-19 19:58:12 +03:00
|
|
|
-- disconnect lock_gain
|
|
|
|
-- disconnect lock_wait1
|
|
|
|
-- disconnect lock_wait2
|
|
|
|
-- disconnect truncate_wait
|
|
|
|
|
|
|
|
DROP TABLE bug38231_1;
|
|
|
|
|
2008-12-14 13:00:37 -07:00
|
|
|
-- enable_query_log
|
|
|
|
-- enable_result_log
|
|
|
|
|
|
|
|
-- connection default
|