Commit 6d13c42c authored by marko's avatar marko

branches/zip: Copy tests from branches/5.1 that were lost in some merge.

parent 63b19875
SET storage_engine=InnoDB;
INSERT INTO bug38231 VALUES (1), (10), (300);
SET autocommit=0;
SELECT * FROM bug38231 FOR UPDATE;
a
1
10
300
TRUNCATE TABLE bug38231;
COMMIT;
DROP TABLE bug38231;
#
# Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK
# http://bugs.mysql.com/38231
#
-- source include/have_innodb.inc
SET storage_engine=InnoDB;
# we care only that the following SQL commands do not crash the server
-- disable_query_log
-- disable_result_log
DROP TABLE IF EXISTS bug38231;
CREATE TABLE bug38231 (a INT);
-- connect (con1,localhost,root,,)
-- connect (con2,localhost,root,,)
-- connect (con3,localhost,root,,)
-- connection con1
SET autocommit=0;
LOCK TABLE bug38231 WRITE;
-- connection con2
SET autocommit=0;
-- send
LOCK TABLE bug38231 WRITE;
-- connection con3
SET autocommit=0;
-- send
LOCK TABLE bug38231 WRITE;
-- connection default
-- send
TRUNCATE TABLE bug38231;
-- connection con1
# Wait for TRUNCATE and the other two LOCKs to be executed; without this,
# sometimes UNLOCK executes before them. We assume there are no other
# sessions executing at the same time with the same SQL commands.
let $wait_condition =
SELECT COUNT(*) = 1 FROM information_schema.processlist
WHERE info = 'TRUNCATE TABLE bug38231';
-- source include/wait_condition.inc
let $wait_condition =
SELECT COUNT(*) = 2 FROM information_schema.processlist
WHERE info = 'LOCK TABLE bug38231 WRITE';
-- source include/wait_condition.inc
# the above enables query log, re-disable it
-- disable_query_log
# this crashes the server if the bug is present
UNLOCK TABLES;
# clean up
-- connection con2
-- reap
UNLOCK TABLES;
-- connection con3
-- reap
UNLOCK TABLES;
-- connection default
-- reap
-- disconnect con1
-- disconnect con2
-- disconnect con3
# test that TRUNCATE works with with row-level locks
-- enable_query_log
-- enable_result_log
INSERT INTO bug38231 VALUES (1), (10), (300);
-- connect (con4,localhost,root,,)
-- connection con4
SET autocommit=0;
SELECT * FROM bug38231 FOR UPDATE;
-- connection default
TRUNCATE TABLE bug38231;
-- connection con4
COMMIT;
-- connection default
-- disconnect con4
DROP TABLE bug38231;
SET storage_engine=InnoDB;
#
# Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch
# http://bugs.mysql.com/39438
#
# This test must be run with innodb_file_per_table=1 because the crash
# only occurs if that option is turned on and DISCARD TABLESPACE only
# works with innodb_file_per_table.
#
-- source include/have_innodb.inc
SET storage_engine=InnoDB;
# we care only that the following SQL commands do not crash the server
-- disable_query_log
-- disable_result_log
DROP TABLE IF EXISTS bug39438;
CREATE TABLE bug39438 (id INT) ENGINE=INNODB;
# remove: XXX Uncomment the following ALTER and remove those lines after
# remove: applying the patch.
# remove: Obviously this test is useless without this ALTER command,
# remove: but it causes warnings to be printed by mysqld and the whole
# remove: mysql-test suite fails at the end (returns non-zero). Please
# remove: apply this patch to the mysql source tree, remove those lines
# remove: and uncomment the following ALTER. We do not care about the
# remove: warnings, this test is to ensure mysqld does not crash.
# remove: === modified file 'mysql-test/lib/mtr_report.pl'
# remove: --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000
# remove: +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000
# remove: @@ -412,7 +412,10 @@
# remove:
# remove: # When trying to set lower_case_table_names = 2
# remove: # on a case sensitive file system. Bug#37402.
# remove: - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./
# remove: + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or
# remove: +
# remove: + # this test is expected to print warnings
# remove: + ($testname eq 'main.innodb_bug39438')
# remove: )
# remove: {
# remove: next; # Skip these lines
# remove:
#ALTER TABLE bug39438 DISCARD TABLESPACE;
# this crashes the server if the bug is present
SHOW TABLE STATUS;
DROP TABLE bug39438;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment