Commit 644d877c authored by marko's avatar marko

branches/5.1: row_unlock_for_mysql(): When the clustered index is unknown,

refuse to unlock the record.
(Bug #45357, caused by the fix of Bug #39320).
rb://132 approved by Sunny Bains.
parent 1cd4bc17
set session transaction isolation level read committed;
create table bug45357(a int, b int,key(b))engine=innodb;
insert into bug45357 values (25170,6122);
update bug45357 set a=1 where b=30131;
delete from bug45357 where b < 20996;
delete from bug45357 where b < 7001;
drop table bug45357;
-- source include/have_innodb.inc
set session transaction isolation level read committed;
create table bug45357(a int, b int,key(b))engine=innodb;
insert into bug45357 values (25170,6122);
update bug45357 set a=1 where b=30131;
delete from bug45357 where b < 20996;
delete from bug45357 where b < 7001;
drop table bug45357;
...@@ -1529,9 +1529,14 @@ row_unlock_for_mysql( ...@@ -1529,9 +1529,14 @@ row_unlock_for_mysql(
index = btr_pcur_get_btr_cur(clust_pcur)->index; index = btr_pcur_get_btr_cur(clust_pcur)->index;
} }
if (UNIV_UNLIKELY(!(index->type & DICT_CLUSTERED))) {
/* This is not a clustered index record. We
do not know how to unlock the record. */
goto no_unlock;
}
/* If the record has been modified by this /* If the record has been modified by this
transaction, do not unlock it. */ transaction, do not unlock it. */
ut_a(index->type & DICT_CLUSTERED);
if (index->trx_id_offset) { if (index->trx_id_offset) {
rec_trx_id = trx_read_trx_id(rec rec_trx_id = trx_read_trx_id(rec
...@@ -1568,7 +1573,7 @@ row_unlock_for_mysql( ...@@ -1568,7 +1573,7 @@ row_unlock_for_mysql(
prebuilt->select_lock_type); prebuilt->select_lock_type);
} }
} }
no_unlock:
mtr_commit(&mtr); mtr_commit(&mtr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment