Browse Source
MDEV-14825 Assertion `col->ord_part' in row_build_index_entry_low upon ROLLBACK or DELETE with concurrent ALTER on partitioned table
MDEV-14825 Assertion `col->ord_part' in row_build_index_entry_low upon ROLLBACK or DELETE with concurrent ALTER on partitioned table
If creating a secondary index fails (typically, ADD UNIQUE INDEX fails due to duplicate key), it is possible that concurrently running UPDATE or DELETE will access the index stub and hit the debug assertion. It does not make any sense to keep updating an uncommitted index whose creation has failed. dict_index_t::is_corrupted(): Replaces dict_index_is_corrupted(). Also take online_status into account. Replace some calls to dict_index_is_clust() with calls to dict_index_t::is_primary().bb-10.2-mariarocks
16 changed files with 115 additions and 85 deletions
-
27mysql-test/suite/innodb/r/alter_partitioned_debug.result
-
34mysql-test/suite/innodb/t/alter_partitioned_debug.test
-
4storage/innobase/dict/dict0defrag_bg.cc
-
16storage/innobase/dict/dict0load.cc
-
7storage/innobase/dict/dict0stats.cc
-
2storage/innobase/fts/fts0fts.cc
-
22storage/innobase/handler/ha_innodb.cc
-
17storage/innobase/handler/handler0alter.cc
-
12storage/innobase/include/dict0dict.h
-
15storage/innobase/include/dict0dict.ic
-
10storage/innobase/include/dict0mem.h
-
3storage/innobase/row/row0ins.cc
-
18storage/innobase/row/row0log.cc
-
4storage/innobase/row/row0merge.cc
-
3storage/innobase/row/row0purge.cc
-
6storage/innobase/row/row0sel.cc
@ -0,0 +1,27 @@ |
|||
CREATE TABLE t1 (a INT, b VARCHAR(10)) ENGINE=InnoDB |
|||
PARTITION BY RANGE(a) |
|||
(PARTITION pa VALUES LESS THAN (3), |
|||
PARTITION pb VALUES LESS THAN (5)); |
|||
INSERT INTO t1 VALUES(2,'two'),(2,'two'),(4,'four'); |
|||
connect ddl,localhost,root,,test; |
|||
SET DEBUG_SYNC = 'inplace_after_index_build SIGNAL go WAIT_FOR done'; |
|||
ALTER TABLE t1 ADD UNIQUE KEY (a,b(3)); |
|||
connection default; |
|||
SET DEBUG_SYNC = 'now WAIT_FOR go'; |
|||
BEGIN; |
|||
SELECT * FROM t1 FOR UPDATE; |
|||
a b |
|||
2 two |
|||
2 two |
|||
4 four |
|||
SET DEBUG_SYNC = 'now SIGNAL done'; |
|||
connection ddl; |
|||
ERROR 23000: Duplicate entry '2-two' for key 'a' |
|||
connection default; |
|||
DELETE FROM t1; |
|||
disconnect ddl; |
|||
SET DEBUG_SYNC = 'RESET'; |
|||
CHECK TABLE t1; |
|||
Table Op Msg_type Msg_text |
|||
test.t1 check status OK |
|||
DROP TABLE t1; |
@ -0,0 +1,34 @@ |
|||
--source include/have_innodb.inc |
|||
--source include/have_partition.inc |
|||
--source include/have_debug.inc |
|||
--source include/have_debug_sync.inc |
|||
|
|||
CREATE TABLE t1 (a INT, b VARCHAR(10)) ENGINE=InnoDB |
|||
PARTITION BY RANGE(a) |
|||
(PARTITION pa VALUES LESS THAN (3), |
|||
PARTITION pb VALUES LESS THAN (5)); |
|||
|
|||
INSERT INTO t1 VALUES(2,'two'),(2,'two'),(4,'four'); |
|||
|
|||
connect ddl,localhost,root,,test; |
|||
SET DEBUG_SYNC = 'inplace_after_index_build SIGNAL go WAIT_FOR done'; |
|||
send ALTER TABLE t1 ADD UNIQUE KEY (a,b(3)); |
|||
|
|||
connection default; |
|||
SET DEBUG_SYNC = 'now WAIT_FOR go'; |
|||
BEGIN; |
|||
SELECT * FROM t1 FOR UPDATE; |
|||
SET DEBUG_SYNC = 'now SIGNAL done'; |
|||
|
|||
connection ddl; |
|||
--error ER_DUP_ENTRY |
|||
reap; |
|||
|
|||
connection default; |
|||
DELETE FROM t1; |
|||
disconnect ddl; |
|||
|
|||
SET DEBUG_SYNC = 'RESET'; |
|||
|
|||
CHECK TABLE t1; |
|||
DROP TABLE t1; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue