-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-30442: Assertion `!m_innodb' failed in ha_partition::cmp_ref ...
The failed assertion was about encountering the same rowid value in two different partitions. This wasn't possible with InnoDB previously: InnoDB used a global counter to produce rowid values for hidden PK. After the fix for MDEV-19506, it uses per-table counters so it's easily possible to get the same hidden PK values in different tables.
- Loading branch information
Showing
3 changed files
with
54 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# | ||
# MDEV-30442: Assertion `!m_innodb' failed in ha_partition::cmp_ref on MULTI-DELETE | ||
# | ||
create table t1 (a int) engine=innodb; | ||
insert into t1 values (1),(2),(1),(2); | ||
create table t2 ( | ||
a int, | ||
b int, | ||
key(a) | ||
) engine=innodb partition by list(a) | ||
( | ||
partition p0 values in (1), | ||
partition p1 values in (2), | ||
partition p2 values in (0,3,4,5,6,7,8,9) | ||
); | ||
insert into t2 select | ||
mod(seq, 10), seq from seq_1_to_50; | ||
explain | ||
delete t1, t2 from t1, t2 where t1.a=t2.a; | ||
id select_type table type possible_keys key key_len ref rows Extra | ||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where | ||
1 SIMPLE t2 ref a a 5 test.t1.a 1 | ||
delete t1, t2 from t1, t2 where t1.a=t2.a; | ||
drop table t1,t2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--source include/not_embedded.inc | ||
--source include/have_partition.inc | ||
--source include/have_innodb.inc | ||
--source include/have_sequence.inc | ||
|
||
--echo # | ||
--echo # MDEV-30442: Assertion `!m_innodb' failed in ha_partition::cmp_ref on MULTI-DELETE | ||
--echo # | ||
create table t1 (a int) engine=innodb; | ||
insert into t1 values (1),(2),(1),(2); | ||
|
||
create table t2 ( | ||
a int, | ||
b int, | ||
key(a) | ||
) engine=innodb partition by list(a) | ||
( | ||
partition p0 values in (1), | ||
partition p1 values in (2), | ||
partition p2 values in (0,3,4,5,6,7,8,9) | ||
); | ||
|
||
insert into t2 select | ||
mod(seq, 10), seq from seq_1_to_50; | ||
|
||
explain | ||
delete t1, t2 from t1, t2 where t1.a=t2.a; | ||
delete t1, t2 from t1, t2 where t1.a=t2.a; | ||
|
||
drop table t1,t2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters