Skip to content

Commit e43bc02

Browse files
kevgsvaintroub
authored andcommitted
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.
1 parent ff34436 commit e43bc02

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CREATE TABLE t1 (pk INT PRIMARY KEY, a INT);
2+
INSERT INTO t1 VALUES (1,10),(2,20);
3+
CREATE TABLE t2 (b INT) PARTITION BY KEY (b) PARTITIONS 2;
4+
INSERT INTO t2 VALUES (1),(2);
5+
DELETE t2 FROM t2 WHERE b BETWEEN 5 AND 9;
6+
UPDATE t2 JOIN t1 SET b = 5;
7+
DROP TABLE t1, t2;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--source include/have_partition.inc
2+
3+
CREATE TABLE t1 (pk INT PRIMARY KEY, a INT);
4+
INSERT INTO t1 VALUES (1,10),(2,20);
5+
6+
CREATE TABLE t2 (b INT) PARTITION BY KEY (b) PARTITIONS 2;
7+
INSERT INTO t2 VALUES (1),(2);
8+
9+
DELETE t2 FROM t2 WHERE b BETWEEN 5 AND 9;
10+
UPDATE t2 JOIN t1 SET b = 5;
11+
12+
DROP TABLE t1, t2;

sql/sql_delete.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,7 @@ multi_delete::~multi_delete()
744744
{
745745
TABLE *table= table_being_deleted->table;
746746
table->no_keyread=0;
747+
table->no_cache= 0;
747748
}
748749

749750
for (uint counter= 0; counter < num_of_tables; counter++)

sql/sql_update.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1868,7 +1868,7 @@ multi_update::~multi_update()
18681868
TABLE_LIST *table;
18691869
for (table= update_tables ; table; table= table->next_local)
18701870
{
1871-
table->table->no_keyread= table->table->no_cache= 0;
1871+
table->table->no_keyread= 0;
18721872
if (ignore)
18731873
table->table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
18741874
}

0 commit comments

Comments
 (0)