| 1 |
--source include/have_innodb.inc |
| 2 |
--source include/have_debug.inc |
| 3 |
--source include/have_debug_sync.inc |
| 4 |
|
| 5 |
# Some memory is allocated in dict_stats_save() function for additional sync |
| 6 |
# point. The memory is allocated in current_thd->mem_root pool after |
| 7 |
# dict_stats_func() arranged new thd and freed after destroy_background_thd() |
| 8 |
# attached background thread thd to the current_thd. That's there are |
| 9 |
# different thread id's for memory allocation and deallocation, what causes |
| 10 |
# the following warnings. This is not an error because the memory is still |
| 11 |
# allocated and deallocated by the same thread in pool. |
| 12 |
call mtr.add_suppression("bytes freed by"); |
| 13 |
|
| 14 |
SET @old_innodb_stats_persistent = @@innodb_stats_persistent; |
| 15 |
SET GLOBAL innodb_stats_persistent=1; |
| 16 |
CREATE TABLE t ENGINE=InnoDB AS SELECT 1; |
| 17 |
|
| 18 |
SET @old_debug_dbug = @@global.debug_dbug; |
| 19 |
|
| 20 |
XA START 'a'; |
| 21 |
INSERT INTO mysql.innodb_index_stats SELECT '','' AS table_name,index_name,LAST_UPDATE,stat_name,0 AS stat_value,sample_size,stat_description FROM mysql.innodb_index_stats WHERE table_name='dummy' FOR UPDATE; # Note the SELECT is empty |
| 22 |
SET GLOBAL debug_dbug = "+d,dict_stats_save_exit_notify"; |
| 23 |
INSERT INTO t VALUES (1), (2); |
| 24 |
XA END 'a'; |
| 25 |
XA PREPARE 'a'; |
| 26 |
|
| 27 |
# Locking queue validation will crash the server if the bug is not fixed |
| 28 |
SET DEBUG_SYNC="now WAIT_FOR dict_stats_save_finished"; |
| 29 |
SET @@global.debug_dbug = @old_debug_dbug; |
| 30 |
SET DEBUG_SYNC="RESET"; |
| 31 |
SET GLOBAL innodb_stats_persistent = @old_innodb_stats_persistent; |
| 32 |
XA COMMIT 'a'; |
| 33 |
DROP TABLE t; |