From d759f764f6b115ca7ad7644ae3ee2e19c71c6138 Mon Sep 17 00:00:00 2001 From: Aleksey Midenkov Date: Thu, 5 Dec 2019 15:11:18 +0300 Subject: [PATCH] MDEV-21233 Assertion `m_extra_cache' failed in ha_partition::late_extra_cache Incorrect assertion of EXTRA_CACHE for HA_EXTRA_PREPARE_FOR_UPDATE. The latter is related to read cache, but must operate without it as a noop. Related to Bug#55458 and MDEV-20441. --- mysql-test/suite/versioning/r/partition.result | 9 +++++++++ mysql-test/suite/versioning/t/partition.test | 13 +++++++++++++ sql/ha_partition.cc | 1 - 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result index a6fa5fcf2ad..aa884743b2f 100644 --- a/mysql-test/suite/versioning/r/partition.result +++ b/mysql-test/suite/versioning/r/partition.result @@ -605,3 +605,12 @@ Table Op Msg_type Msg_text test.t1 check note Not supported for non-INTERVAL history partitions test.t1 check note The storage engine for the table doesn't support check drop table t1; +# +# MDEV-21233 Assertion `m_extra_cache' failed in ha_partition::late_extra_cache +# +create table t1 (id int, a varchar(8)) with system versioning partition by key (id) partitions 2; +insert into t1 values (1,'foo'),(2,'bar'); +create table t2 (b int); +insert into t2 values (1),(2); +update t1, t2 set a = 1; +drop table t1, t2; diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test index dcbb6e4c293..8898088b1bc 100644 --- a/mysql-test/suite/versioning/t/partition.test +++ b/mysql-test/suite/versioning/t/partition.test @@ -553,5 +553,18 @@ check table t1; # cleanup drop table t1; +--echo # +--echo # MDEV-21233 Assertion `m_extra_cache' failed in ha_partition::late_extra_cache +--echo # +create table t1 (id int, a varchar(8)) with system versioning partition by key (id) partitions 2; +insert into t1 values (1,'foo'),(2,'bar'); + +create table t2 (b int); +insert into t2 values (1),(2); + +update t1, t2 set a = 1; + +# cleanup +drop table t1, t2; --source suite/versioning/common_finish.inc diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 09aef634c94..a7942f493d7 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -9227,7 +9227,6 @@ void ha_partition::late_extra_cache(uint partition_id) } if (m_extra_prepare_for_update) { - DBUG_ASSERT(m_extra_cache); (void) file->extra(HA_EXTRA_PREPARE_FOR_UPDATE); } m_extra_cache_part_id= partition_id;