Comment 15 for bug 1113388

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

MTR testcase for 5.6. Does not fail at exact same place, but the assert is the same, I believe it's the same root cause (THD::in_use reset in I_S query)

=== modified file 'Percona-Server/sql/sql_show.cc'
--- Percona-Server/sql/sql_show.cc 2013-06-27 15:15:35 +0000
+++ Percona-Server/sql/sql_show.cc 2013-07-30 15:01:06 +0000
@@ -4039,6 +4045,7 @@

       THD *t= tmp->in_use;
       tmp->in_use= thd;
+ DEBUG_SYNC(thd, "after_global_temp_table_in_use_reset");

       if (store_temporary_table_record(thd_item, tables->table, tmp,
                                        thd->lex->select_lex.db)) {

# Test for bug 1113388 (field.cc:3822: virtual longlong Field_long::val_int(): Assertion `table->in_use == _current_thd()' failed)

--source include/have_innodb.inc
--source include/have_debug_sync.inc

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);

SET DEBUG_SYNC= 'after_copy_data_between_tables_one_row SIGNAL optimize_ready WAIT_FOR i_s_stopped';
send OPTIMIZE TABLE t1;

connect (conn2,localhost,root,,);
connection conn2;

SET DEBUG_SYNC= 'now WAIT_FOR optimize_ready';
SET DEBUG_SYNC= 'after_global_temp_table_in_use_reset SIGNAL i_s_stopped WAIT_FOR optimize_completed';
send SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_TEMPORARY_TABLES;

connection default;
reap;
SET DEBUG_SYNC= 'now SIGNAL optimize_completed';

connection conn2;
reap;

disconnect conn2;
connection default;

DROP TABLE t1;