Skip to content

Commit

Permalink
MDEV-10418 Assertion `m_extra_cache' failed in
Browse files Browse the repository at this point in the history
ha_partition::late_extra_cache(uint).

        m_extra_prepare_for_update should be cleaned in
        ha_partition::reset()
  • Loading branch information
Alexey Botchkov committed Feb 21, 2017
1 parent 978179a commit cf673ad
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
16 changes: 16 additions & 0 deletions mysql-test/r/partition_myisam.result
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,19 @@ PARTITION p1 VALUES LESS THAN (100) MAX_ROWS=100,
PARTITION pMax VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Partition p1, first row");
DROP TABLE t1;
#
# MDEV-10418 Assertion `m_extra_cache' failed
# in ha_partition::late_extra_cache(uint)
#
CREATE TABLE t1 (f1 INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (f2 INT) ENGINE=MyISAM PARTITION BY RANGE(f2) (PARTITION pmax VALUES LESS THAN MAXVALUE);
INSERT INTO t2 VALUES (8);
CREATE ALGORITHM = MERGE VIEW v AS SELECT f2 FROM t2, t1;
UPDATE v SET f2 = 1;
SELECT * FROM t2;
f2
1
DROP VIEW v;
DROP TABLE t2;
DROP TABLE t1;
21 changes: 21 additions & 0 deletions mysql-test/t/partition_myisam.test
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,24 @@ PARTITION BY RANGE (a)
PARTITION pMax VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (1, "Partition p1, first row");
DROP TABLE t1;

--echo #
--echo # MDEV-10418 Assertion `m_extra_cache' failed
--echo # in ha_partition::late_extra_cache(uint)
--echo #

CREATE TABLE t1 (f1 INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);

CREATE TABLE t2 (f2 INT) ENGINE=MyISAM PARTITION BY RANGE(f2) (PARTITION pmax VALUES LESS THAN MAXVALUE);
INSERT INTO t2 VALUES (8);

CREATE ALGORITHM = MERGE VIEW v AS SELECT f2 FROM t2, t1;

UPDATE v SET f2 = 1;

SELECT * FROM t2;

DROP VIEW v;
DROP TABLE t2;
DROP TABLE t1;
1 change: 1 addition & 0 deletions sql/ha_partition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6667,6 +6667,7 @@ int ha_partition::reset(void)
DBUG_ENTER("ha_partition::reset");
if (m_part_info)
bitmap_set_all(&m_part_info->used_partitions);
m_extra_prepare_for_update= FALSE;
file= m_file;
do
{
Expand Down

0 comments on commit cf673ad

Please sign in to comment.