MDEV-16106 Record in index was not found on rollback, trying to insert: TUPLE
During rollback of temporary table logs, secondary index should delete mark the index entry instead of removing it completely.
This commit is contained in:
parent
9bcd0f5fea
commit
bd1d152d05
@ -638,3 +638,15 @@ t1 CREATE TEMPORARY TABLE `t1` (
|
|||||||
`j` int(11) DEFAULT NULL,
|
`j` int(11) DEFAULT NULL,
|
||||||
PRIMARY KEY (`i`) KEY_BLOCK_SIZE=8
|
PRIMARY KEY (`i`) KEY_BLOCK_SIZE=8
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TEMPORARY TABLE t1(f1 INT, KEY(f1)) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 VALUES(NULL);
|
||||||
|
UPDATE t1 SET f1 = 0;
|
||||||
|
START TRANSACTION;
|
||||||
|
UPDATE t1 SET f1 = 4;
|
||||||
|
UPDATE t1 SET f1 = 0;
|
||||||
|
ROLLBACK;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
f1
|
||||||
|
0
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -464,3 +464,14 @@ ALTER TABLE t1 ROW_FORMAT = DYNAMIC;
|
|||||||
set innodb_strict_mode = ON;
|
set innodb_strict_mode = ON;
|
||||||
ALTER TABLE t1 ADD COLUMN j INT;
|
ALTER TABLE t1 ADD COLUMN j INT;
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TEMPORARY TABLE t1(f1 INT, KEY(f1)) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 VALUES(NULL);
|
||||||
|
UPDATE t1 SET f1 = 0;
|
||||||
|
START TRANSACTION;
|
||||||
|
UPDATE t1 SET f1 = 4;
|
||||||
|
UPDATE t1 SET f1 = 0;
|
||||||
|
ROLLBACK;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -428,7 +428,6 @@ row_undo_mod_del_mark_or_remove_sec_low(
|
|||||||
btr_pcur_t pcur;
|
btr_pcur_t pcur;
|
||||||
btr_cur_t* btr_cur;
|
btr_cur_t* btr_cur;
|
||||||
ibool success;
|
ibool success;
|
||||||
ibool old_has = FALSE;
|
|
||||||
dberr_t err = DB_SUCCESS;
|
dberr_t err = DB_SUCCESS;
|
||||||
mtr_t mtr;
|
mtr_t mtr;
|
||||||
mtr_t mtr_vers;
|
mtr_t mtr_vers;
|
||||||
@ -507,13 +506,10 @@ row_undo_mod_del_mark_or_remove_sec_low(
|
|||||||
/* For temporary table, we can skip to check older version of
|
/* For temporary table, we can skip to check older version of
|
||||||
clustered index entry. Because the purge won't process
|
clustered index entry. Because the purge won't process
|
||||||
any no-redo rollback segment undo logs. */
|
any no-redo rollback segment undo logs. */
|
||||||
if (!dict_table_is_temporary(node->table)) {
|
if (dict_table_is_temporary(node->table)
|
||||||
old_has = row_vers_old_has_index_entry(
|
|| row_vers_old_has_index_entry(
|
||||||
FALSE, btr_pcur_get_rec(&(node->pcur)),
|
FALSE, btr_pcur_get_rec(&(node->pcur)),
|
||||||
&mtr_vers, index, entry, 0, 0);
|
&mtr_vers, index, entry, 0, 0)) {
|
||||||
}
|
|
||||||
|
|
||||||
if (old_has) {
|
|
||||||
err = btr_cur_del_mark_set_sec_rec(BTR_NO_LOCKING_FLAG,
|
err = btr_cur_del_mark_set_sec_rec(BTR_NO_LOCKING_FLAG,
|
||||||
btr_cur, TRUE, thr, &mtr);
|
btr_cur, TRUE, thr, &mtr);
|
||||||
ut_ad(err == DB_SUCCESS);
|
ut_ad(err == DB_SUCCESS);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user