MDEV-16741 Assertion `m_extra_cache' failed in ha_partition::late_extra_cache

multi_delete sets TABLE::no_cache=1 and should set it to 0 when DELETE is done.
This commit is contained in:
Eugene Kosov 2018-07-16 15:35:16 +03:00 committed by Vladislav Vaintroub
parent ff34436a2e
commit e43bc02e7b
4 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,7 @@
CREATE TABLE t1 (pk INT PRIMARY KEY, a INT);
INSERT INTO t1 VALUES (1,10),(2,20);
CREATE TABLE t2 (b INT) PARTITION BY KEY (b) PARTITIONS 2;
INSERT INTO t2 VALUES (1),(2);
DELETE t2 FROM t2 WHERE b BETWEEN 5 AND 9;
UPDATE t2 JOIN t1 SET b = 5;
DROP TABLE t1, t2;

View File

@ -0,0 +1,12 @@
--source include/have_partition.inc
CREATE TABLE t1 (pk INT PRIMARY KEY, a INT);
INSERT INTO t1 VALUES (1,10),(2,20);
CREATE TABLE t2 (b INT) PARTITION BY KEY (b) PARTITIONS 2;
INSERT INTO t2 VALUES (1),(2);
DELETE t2 FROM t2 WHERE b BETWEEN 5 AND 9;
UPDATE t2 JOIN t1 SET b = 5;
DROP TABLE t1, t2;

View File

@ -744,6 +744,7 @@ multi_delete::~multi_delete()
{
TABLE *table= table_being_deleted->table;
table->no_keyread=0;
table->no_cache= 0;
}
for (uint counter= 0; counter < num_of_tables; counter++)

View File

@ -1868,7 +1868,7 @@ multi_update::~multi_update()
TABLE_LIST *table;
for (table= update_tables ; table; table= table->next_local)
{
table->table->no_keyread= table->table->no_cache= 0;
table->table->no_keyread= 0;
if (ignore)
table->table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
}