Skip to content

Commit ed104c7

Browse files
committed
Bug#25583588 : `M_PREBUILT->TABLE->N_REF_COUNT > 0' AT
HA_INNOBASE::UPDATE_THD IN HANDLER Post push patch: After pushing fix for bug#25583588, server does not show hidden tables even with the I_S implementation that uses ST_SCHEMA_TABLE interface. This affects the test case added by Bug#22285643, which uses I_S.PARTITIONS to check if there exists a hidden table. This leads to the timeout of the test. Remove the test case and debug points introduced in the code for this test.
1 parent 9e282c3 commit ed104c7

File tree

5 files changed

+0
-277
lines changed

5 files changed

+0
-277
lines changed

mysql-test/r/alter_table-big.result

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -76,93 +76,6 @@ master-bin.000001 # Query # # use `test`; rename table t1 to t3
7676
master-bin.000001 # Query # # use `test`; DROP TABLE `t3` /* generated by server */
7777
End of 5.1 tests
7878
#
79-
# Bug#22681959 : SELECT ON I_S TABLES WITH CONCURRENT DDL MAY CRASH SERVER
80-
# Bug#22285643 : I_S QUERIES OPENING TMP TABLES FROM ALTER INVALIDATES REFERENCE COUNTER
81-
#
82-
SET DEBUG_SYNC= 'RESET';
83-
DROP SCHEMA IF EXISTS test_i_s;
84-
CREATE SCHEMA test_i_s;
85-
USE test_i_s;
86-
CREATE TABLE t1(a INT) ENGINE=MYISAM;
87-
# Create new connections
88-
connect con1,localhost,root,,;
89-
connect con2,localhost,root,,;
90-
connect con3,localhost,root,,;
91-
connect con4,localhost,root,,;
92-
connect con5,localhost,root,,;
93-
connection default;
94-
SET GLOBAL DEBUG='d,alter_table_after_rename';
95-
SET DEBUG_SYNC=
96-
'before_rename_in_dd SIGNAL blocked WAIT_FOR i_s_select';
97-
SET DEBUG_SYNC=
98-
'after_rename_in_dd SIGNAL blocked_2 WAIT_FOR i_s_select_2';
99-
# Sending ALTER Command
100-
ALTER TABLE t1 add column (c2 int);;
101-
connection con1;
102-
SET DEBUG_SYNC= 'now WAIT_FOR blocked';
103-
SET DEBUG_SYNC=
104-
'show_after_table_list_prep SIGNAL i_s_select WAIT_FOR blocked_2';
105-
SELECT table_name FROM information_schema.partitions WHERE SUBSTR(table_name,1,1)='#';;
106-
connection con2;
107-
SET DEBUG_SYNC= 'now SIGNAL i_s_select_2';
108-
connection default;
109-
#Reaping "ALTER ..."
110-
connection con1;
111-
#Reaping "SELECT"
112-
table_name
113-
SET DEBUG_SYNC= 'RESET';
114-
SET GLOBAL DEBUG='';
115-
connection con3;
116-
USE test_i_s;
117-
SET GLOBAL DEBUG='d,alter_table_after_rename';
118-
SET DEBUG_SYNC=
119-
'before_rename_in_dd SIGNAL blocked WAIT_FOR i_s_select';
120-
# Sending:
121-
ALTER TABLE t1 add column (c3 int);
122-
connection con4;
123-
SET DEBUG_SYNC= 'now WAIT_FOR blocked';
124-
SET DEBUG_SYNC=
125-
'after_acquire_abstract_table SIGNAL i_s_select WAIT_FOR blocked_2';
126-
SELECT table_name FROM information_schema.partitions WHERE table_schema='test_i_s' and table_name LIKE '#sql%\_%';
127-
connection con5;
128-
SET DEBUG_SYNC= 'now SIGNAL i_s_select';
129-
connection con3;
130-
#Reaping "ALTER ..."
131-
SET DEBUG_SYNC= 'now SIGNAL blocked_2';
132-
connection con4;
133-
#Reaping "SELECT"
134-
table_name
135-
connection default;
136-
SET DEBUG_SYNC= 'RESET';
137-
SET GLOBAL DEBUG='';
138-
connection default;
139-
USE test_i_s;
140-
CREATE TABLE pid_table(pid_no INT);
141-
SET @conn_id= connection_id();
142-
LOAD DATA LOCAL INFILE 'pid_file' INTO TABLE pid_table;
143-
connection con1;
144-
use test_i_s;
145-
connection default;
146-
SET @lock_wait_timeout_saved= @@lock_wait_timeout;
147-
SET lock_wait_timeout = 1;
148-
ALTER TABLE t1 add column (c4 int);
149-
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
150-
connection con1;
151-
UNLOCK TABLES;
152-
connection default;
153-
SET lock_wait_timeout = 1;
154-
ALTER TABLE t1 add column (c4 int);
155-
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
156-
connection con1;
157-
disconnect con1;
158-
disconnect con2;
159-
disconnect con3;
160-
disconnect con4;
161-
disconnect con5;
162-
connection default;
163-
DROP SCHEMA test_i_s;
164-
SET @@lock_wait_timeout= @lock_wait_timeout_saved;
165-
#
16679
# Additional coverage for WL#7743 "New data dictionary: changes
16780
# to DDL-related parts of SE API".
16881
#

mysql-test/t/alter_table-big.test

Lines changed: 0 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -178,180 +178,6 @@ source include/show_binlog_events.inc;
178178
--source include/restore_default_binlog_format.inc
179179

180180

181-
--echo #
182-
--echo # Bug#22681959 : SELECT ON I_S TABLES WITH CONCURRENT DDL MAY CRASH SERVER
183-
--echo # Bug#22285643 : I_S QUERIES OPENING TMP TABLES FROM ALTER INVALIDATES REFERENCE COUNTER
184-
--echo #
185-
186-
#
187-
# Preparative cleanup.
188-
#
189-
--disable_warnings
190-
SET DEBUG_SYNC= 'RESET';
191-
DROP SCHEMA IF EXISTS test_i_s;
192-
--enable_warnings
193-
194-
#
195-
# This is test case to check assert in Bug#22681959.
196-
#
197-
CREATE SCHEMA test_i_s;
198-
USE test_i_s;
199-
CREATE TABLE t1(a INT) ENGINE=MYISAM;
200-
201-
--echo # Create new connections
202-
--enable_connect_log
203-
connect (con1,localhost,root,,);
204-
connect (con2,localhost,root,,);
205-
connect (con3,localhost,root,,);
206-
connect (con4,localhost,root,,);
207-
connect (con5,localhost,root,,);
208-
209-
--connection default
210-
SET GLOBAL DEBUG='d,alter_table_after_rename';
211-
SET DEBUG_SYNC=
212-
'before_rename_in_dd SIGNAL blocked WAIT_FOR i_s_select';
213-
SET DEBUG_SYNC=
214-
'after_rename_in_dd SIGNAL blocked_2 WAIT_FOR i_s_select_2';
215-
216-
--echo # Sending ALTER Command
217-
--send ALTER TABLE t1 add column (c2 int);
218-
219-
--connection con1
220-
SET DEBUG_SYNC= 'now WAIT_FOR blocked';
221-
SET DEBUG_SYNC=
222-
'show_after_table_list_prep SIGNAL i_s_select WAIT_FOR blocked_2';
223-
--send SELECT table_name FROM information_schema.partitions WHERE SUBSTR(table_name,1,1)='#';
224-
225-
--connection con2
226-
# Without Fix, ALTER command gets signal to continue from above.
227-
# It asserts trying to put dd::Table object in the Dictionary Cache.
228-
# With the Fix, ALTER gets MDL on the temporary table name.
229-
# SELECT on I_S waits for ALTER to finish.
230-
let $wait_condition=
231-
select count(*) = 1 from information_schema.processlist
232-
where state = "Waiting for table metadata lock" and
233-
info = "SELECT table_name FROM information_schema.partitions WHERE SUBSTR(table_name,1,1)='#'";
234-
--source include/wait_condition.inc
235-
SET DEBUG_SYNC= 'now SIGNAL i_s_select_2';
236-
237-
--connection default
238-
--echo #Reaping "ALTER ..."
239-
--reap
240-
241-
--connection con1
242-
--echo #Reaping "SELECT"
243-
--reap
244-
245-
SET DEBUG_SYNC= 'RESET';
246-
SET GLOBAL DEBUG='';
247-
248-
#
249-
# This is test case to check assert in Bug#22285643.
250-
#
251-
252-
--connection con3
253-
USE test_i_s;
254-
255-
SET GLOBAL DEBUG='d,alter_table_after_rename';
256-
SET DEBUG_SYNC=
257-
'before_rename_in_dd SIGNAL blocked WAIT_FOR i_s_select';
258-
259-
--echo # Sending:
260-
--send ALTER TABLE t1 add column (c3 int)
261-
262-
--connection con4
263-
SET DEBUG_SYNC= 'now WAIT_FOR blocked';
264-
SET DEBUG_SYNC=
265-
'after_acquire_abstract_table SIGNAL i_s_select WAIT_FOR blocked_2';
266-
267-
--send SELECT table_name FROM information_schema.partitions WHERE table_schema='test_i_s' and table_name LIKE '#sql%\_%'
268-
269-
--connection con5
270-
let $wait_condition=
271-
select count(*) = 1 from information_schema.processlist
272-
where state = "Waiting for table metadata lock" and
273-
info LIKE "SELECT table_name FROM information_schema.partitions WHERE table_schema='test_i_s' and table_name LI%";
274-
--source include/wait_condition.inc
275-
SET DEBUG_SYNC= 'now SIGNAL i_s_select';
276-
277-
--connection con3
278-
--echo #Reaping "ALTER ..."
279-
--reap
280-
SET DEBUG_SYNC= 'now SIGNAL blocked_2';
281-
282-
--connection con4
283-
--echo #Reaping "SELECT"
284-
--reap
285-
286-
--connection default
287-
SET DEBUG_SYNC= 'RESET';
288-
SET GLOBAL DEBUG='';
289-
290-
291-
#
292-
# This is test case to check error paths in Bug#22681959 and Bug#22285643.
293-
#
294-
295-
--connection default
296-
USE test_i_s;
297-
CREATE TABLE pid_table(pid_no INT);
298-
299-
SET @conn_id= connection_id();
300-
--let $pid_file=`SELECT @@pid_file`
301-
--replace_result $pid_file pid_file
302-
--eval LOAD DATA LOCAL INFILE '$pid_file' INTO TABLE pid_table
303-
--let $temp_table_name= `SELECT CONCAT('#sql-', LCASE(HEX(pid_no)), '_', @conn_id) FROM pid_table`
304-
--let $temp_table_backup_name= `SELECT CONCAT('#sql2-', LCASE(HEX(pid_no)), '-', @conn_id) FROM pid_table`
305-
306-
# Lock the temporary table name to be used while ALTER
307-
--connection con1
308-
use test_i_s;
309-
--disable_query_log
310-
eval CREATE TABLE `$temp_table_name`(a int);
311-
eval LOCK TABLE `$temp_table_name` WRITE;
312-
--enable_query_log
313-
314-
# ALTER will timeout while trying to get MDL on temporary table name.
315-
--connection default
316-
SET @lock_wait_timeout_saved= @@lock_wait_timeout;
317-
SET lock_wait_timeout = 1;
318-
--error ER_LOCK_WAIT_TIMEOUT
319-
ALTER TABLE t1 add column (c4 int);
320-
321-
# Lock the backup temporary table name to be used while ALTER
322-
--connection con1
323-
UNLOCK TABLES;
324-
--disable_query_log
325-
eval DROP TABLE `$temp_table_name`;
326-
eval CREATE TABLE `$temp_table_backup_name`(a int);
327-
eval LOCK TABLE `$temp_table_backup_name` WRITE;
328-
--enable_query_log
329-
330-
# ALTER will timeout while trying to get MDL on backup temporary table name.
331-
--connection default
332-
SET lock_wait_timeout = 1;
333-
--error ER_LOCK_WAIT_TIMEOUT
334-
ALTER TABLE t1 add column (c4 int);
335-
336-
--connection con1
337-
--disable_query_log
338-
eval DROP TABLE `$temp_table_backup_name`;
339-
--enable_query_log
340-
--disconnect con1
341-
--source include/wait_until_disconnected.inc
342-
--disconnect con2
343-
--source include/wait_until_disconnected.inc
344-
--disconnect con3
345-
--source include/wait_until_disconnected.inc
346-
--disconnect con4
347-
--source include/wait_until_disconnected.inc
348-
--disconnect con5
349-
--source include/wait_until_disconnected.inc
350-
--connection default
351-
--disable_connect_log
352-
DROP SCHEMA test_i_s;
353-
SET @@lock_wait_timeout= @lock_wait_timeout_saved;
354-
355181
--echo #
356182
--echo # Additional coverage for WL#7743 "New data dictionary: changes
357183
--echo # to DDL-related parts of SE API".

sql/dd/dd_table.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <algorithm>
2020
#include <memory> // unique_ptr
2121

22-
#include "current_thd.h"
2322
#include "dd/cache/dictionary_client.h" // dd::cache::Dictionary_client
2423
#include "dd/dd.h" // dd::get_dictionary
2524
#include "dd/dd_schema.h" // dd::Schema_MDL_locker
@@ -2660,9 +2659,6 @@ bool rename_table(THD *thd, dd::Table *to_table_def,
26602659
// Mark the hidden flag.
26612660
to_table_def->set_hidden(mark_as_hidden);
26622661

2663-
DBUG_EXECUTE_IF("alter_table_after_rename_1",
2664-
DEBUG_SYNC(thd, "before_rename_in_dd"););
2665-
26662662
// Do the update. Errors will be reported by the dictionary subsystem.
26672663
if (thd->dd_client()->update(to_table_def))
26682664
{
@@ -2675,10 +2671,6 @@ bool rename_table(THD *thd, dd::Table *to_table_def,
26752671
return true;
26762672
}
26772673

2678-
DBUG_EXECUTE_IF("alter_table_after_rename_1",
2679-
DBUG_SET("-d,alter_table_after_rename_1");
2680-
DEBUG_SYNC(thd, "after_rename_in_dd"););
2681-
26822674
if (commit_dd_changes)
26832675
{
26842676
if (trans_commit_stmt(thd) || trans_commit(thd))
@@ -2714,8 +2706,6 @@ bool abstract_table_type(dd::cache::Dictionary_client *client,
27142706
DBUG_ASSERT(table_type);
27152707
*table_type= table->type();
27162708

2717-
DEBUG_SYNC(current_thd, "after_acquire_abstract_table");
2718-
27192709
DBUG_RETURN(false);
27202710
}
27212711

sql/sql_show.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4395,8 +4395,6 @@ static int get_all_tables(THD *thd, TABLE_LIST *tables, Item *cond)
43954395
if (res)
43964396
goto err;
43974397

4398-
DEBUG_SYNC(thd, "show_after_table_list_prep");
4399-
44004398
List_iterator_fast<LEX_STRING> it_files(table_names);
44014399
while ((table_name= it_files++))
44024400
{

sql/sql_table.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12722,10 +12722,6 @@ bool mysql_alter_table(THD *thd, const char *new_db, const char *new_name,
1272212722
goto err_with_mdl;
1272312723
}
1272412724

12725-
DBUG_EXECUTE_IF("alter_table_after_rename",
12726-
DBUG_SET("-d,alter_table_after_rename");
12727-
DBUG_SET("+d,alter_table_after_rename_1"););
12728-
1272912725
// Rename the new table to the correct name.
1273012726
if (mysql_rename_table(thd, new_db_type, alter_ctx.new_db, alter_ctx.tmp_name,
1273112727
alter_ctx.new_db, alter_ctx.new_alias,

0 commit comments

Comments
 (0)