diff options
author | Nikita Malyavin <nikitamalyavin@gmail.com> | 2020-04-02 22:37:36 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-02 22:37:36 +1000 |
commit | 9149017bb838e9efbef40c5f2807894c38b3412f (patch) | |
tree | 2a0ac6313b38ed105981fbd3fb5969999ce5e219 /mysql-test/suite/versioning | |
parent | b40b3720cbba133ee76ef336bf89bbf5c03ac403 (diff) | |
download | mariadb-git-9149017bb838e9efbef40c5f2807894c38b3412f.tar.gz |
MDEV-17091 - Assertion failed after dropping versioning
Assertion `old_part_id == m_last_part' failed in ha_partition::update_row or `part_id == m_last_part' in ha_partition::delete_row upon UPDATE/DELETE after dropping versioning
PRIMARY KEY change hadn't been treated as partition reorganization in case of partitioning by KEY() (without parameters).
* set `*partition_changed= true` in the described case.
* since add/drop system versioning does not affect alter_info->key_list, it required separate attention
Diffstat (limited to 'mysql-test/suite/versioning')
-rw-r--r-- | mysql-test/suite/versioning/r/partition.result | 28 | ||||
-rw-r--r-- | mysql-test/suite/versioning/t/partition.test | 24 |
2 files changed, 52 insertions, 0 deletions
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result index aa884743b2f..a75fa49c610 100644 --- a/mysql-test/suite/versioning/r/partition.result +++ b/mysql-test/suite/versioning/r/partition.result @@ -614,3 +614,31 @@ create table t2 (b int); insert into t2 values (1),(2); update t1, t2 set a = 1; drop table t1, t2; +# +# MDEV-17091 Assertion `old_part_id == m_last_part' failed in +# ha_partition::update_row or `part_id == m_last_part' in +# ha_partition::delete_row upon UPDATE/DELETE after dropping versioning +# +create or replace table t1 (pk int primary key, f int) engine=innodb +with system versioning +partition by key() partitions 2; +insert into t1 values (1,10),(2,20); +# expected to hit same partition +select * from t1 partition (p0); +pk f +1 10 +2 20 +alter table t1 drop system versioning; +# 1 and 2 are expected to be in different partitions +select * from t1 partition(p0); +pk f +1 10 +select * from t1 partition(p1); +pk f +2 20 +update t1 set f=pk; +delete from t1; +drop table t1; +# Test cleanup +drop database test; +create database test; diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test index 8898088b1bc..282af4b5bc7 100644 --- a/mysql-test/suite/versioning/t/partition.test +++ b/mysql-test/suite/versioning/t/partition.test @@ -568,3 +568,27 @@ update t1, t2 set a = 1; drop table t1, t2; --source suite/versioning/common_finish.inc +--echo # +--echo # MDEV-17091 Assertion `old_part_id == m_last_part' failed in +--echo # ha_partition::update_row or `part_id == m_last_part' in +--echo # ha_partition::delete_row upon UPDATE/DELETE after dropping versioning +--echo # +create or replace table t1 (pk int primary key, f int) engine=innodb + with system versioning + partition by key() partitions 2; +insert into t1 values (1,10),(2,20); +--echo # expected to hit same partition +select * from t1 partition (p0); +alter table t1 drop system versioning; + +--echo # 1 and 2 are expected to be in different partitions +select * from t1 partition(p0); +select * from t1 partition(p1); + +update t1 set f=pk; +delete from t1; +drop table t1; + +--echo # Test cleanup +drop database test; +create database test; |