1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Merge next-4248 -> next-4284-merge

This commit is contained in:
Konstantin Osipov
2010-02-03 18:12:39 +03:00
4 changed files with 152 additions and 5 deletions

View File

@@ -3212,6 +3212,109 @@ SET DEBUG_SYNC= 'RESET';
disconnect con2;
--echo #
--echo # Bug#50786 Assertion `thd->mdl_context.trans_sentinel() == __null'
--echo # failed in open_ltable()
--echo #
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
--enable_warnings
connect (con1,localhost,root);
connect (con2,localhost,root);
connect (con3,localhost,root);
connection default;
CREATE TABLE t1 (i INT);
CREATE TABLE t2 (i INT);
SET @old_general_log= @@global.general_log;
SET @@global.general_log= 1;
SET @old_log_output= @@global.log_output;
SET @@global.log_output= 'TABLE';
SET @old_sql_log_off= @@session.sql_log_off;
SET @@session.sql_log_off= 1;
--echo # connection: con1
connection con1;
HANDLER t1 OPEN;
--echo # connection: con3
connection con3;
SET @@session.sql_log_off= 1;
--echo # connection: con2
connection con2;
SET DEBUG_SYNC= 'thr_multi_lock_after_thr_lock SIGNAL parked WAIT_FOR go';
# The below statement will block on the debug sync point
# after it gets write lock on mysql.general_log table.
--echo # Sending:
--send SELECT 1
--echo # connection: con3
connection con3;
SET DEBUG_SYNC= 'now WAIT_FOR parked';
--echo # connection: con1
connection con1;
# This statement will block in open_ltable() when
# trying to write into mysql.general_log.
--echo # Sending:
--send SELECT 1
--echo # connection: con3
connection con3;
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
WHERE state = "Table lock" and info = "SELECT 1";
--source include/wait_condition.inc
# The ALTER below will try to abort the statement in connection con1,
# since the latter waits on a table-level lock while having a HANDLER
# open. This will cause mysql_lock_tables() in con1 fail which before
# triggered the assert.
--echo # Sending:
--send ALTER TABLE t1 ADD COLUMN j INT
--echo # connection: default
connection default;
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
WHERE state = "Waiting for table"
AND info = "ALTER TABLE t1 ADD COLUMN j INT";
--source include/wait_condition.inc
SET DEBUG_SYNC= 'now SIGNAL go';
--echo # connection: con1
connection con1;
--echo # Reaping SELECT 1
--reap
HANDLER t1 CLOSE;
--echo # connection: con2
connection con2;
--echo # Reaping SELECT 1
--reap
--echo # connection: con3
connection con3;
--echo # Reaping ALTER TABLE t1 ADD COLUMN j INT
--reap
--echo # connection: default
connection default;
DROP TABLE t1, t2;
SET DEBUG_SYNC= 'RESET';
disconnect con1;
disconnect con2;
disconnect con3;
SET @@global.general_log= @old_general_log;
SET @@global.log_output= @old_log_output;
SET @@session.sql_log_off= @old_sql_log_off;
# Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc