Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions mysql-test/main/query_cache_partition.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# MDEV-33170 ASAN errors upon CONVERT TABLE TO PARTITION with query cache
#
SET @qcache= @@global.query_cache_type;
SET GLOBAL query_cache_type= 1;
CREATE TABLE t (a INT) PARTITION BY LIST (a) (PARTITION p0 VALUES IN (1));
CREATE TABLE t1 (a INT);
ALTER TABLE t CONVERT TABLE t1 TO PARTITION pn VALUES IN (2);
DROP TABLE IF EXISTS t1, t;
Warnings:
Note 1051 Unknown table 'test.t1'
SET GLOBAL query_cache_type= @qcache;
# End of 10.11 tests
19 changes: 19 additions & 0 deletions mysql-test/main/query_cache_partition.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--source include/have_partition.inc
--source include/have_query_cache.inc

--echo #
--echo # MDEV-33170 ASAN errors upon CONVERT TABLE TO PARTITION with query cache
--echo #

SET @qcache= @@global.query_cache_type;
SET GLOBAL query_cache_type= 1;

CREATE TABLE t (a INT) PARTITION BY LIST (a) (PARTITION p0 VALUES IN (1));
CREATE TABLE t1 (a INT);
ALTER TABLE t CONVERT TABLE t1 TO PARTITION pn VALUES IN (2);

# Cleanup
DROP TABLE IF EXISTS t1, t;
SET GLOBAL query_cache_type= @qcache;

--echo # End of 10.11 tests
4 changes: 2 additions & 2 deletions sql/sql_partition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4631,8 +4631,6 @@ static int fast_end_partition(THD *thd, ulonglong copied,

thd->proc_info="end";

query_cache_invalidate3(thd, table_list, 0);
Comment thread
grooverdan marked this conversation as resolved.

my_snprintf(tmp_name, sizeof(tmp_name), ER_THD(thd, ER_INSERT_INFO),
(ulong) (copied + deleted),
(ulong) deleted,
Expand Down Expand Up @@ -7530,6 +7528,8 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
lpt->pack_frm_data= NULL;
lpt->pack_frm_len= 0;

query_cache_invalidate3(thd, table_list, 0);

/* Add IF EXISTS to binlog if shared table */
if (table->file->partition_ht()->flags & HTON_TABLE_MAY_NOT_EXIST_ON_SLAVE)
thd->variables.option_bits|= OPTION_IF_EXISTS;
Expand Down