-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: When get_row_by_rowid() call in ha_rocksdb::secondary_index_read returns an error, then the error must be returned from ha_rocksdb::secondary_index_read, too. Test Plan: mtr Reviewers: jtolmer, jkedgar, yoshinorim, hermanlee4 Reviewed By: hermanlee4 Subscribers: webscalesql-eng Differential Revision: https://reviews.facebook.net/D52113
- Loading branch information
Showing
3 changed files
with
78 additions
and
5 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,32 @@ | ||
create table t1 ( | ||
pk int not null primary key, | ||
col1 int not null, | ||
col2 int not null, | ||
key(col1) | ||
) engine=rocksdb; | ||
create table ten(a int primary key); | ||
insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); | ||
create table one_k(a int primary key); | ||
insert into one_k select A.a + B.a* 10 + C.a * 100 from ten A, ten B, ten C; | ||
insert into t1 select a,a,a from one_k; | ||
# Start the transaction, get the snapshot | ||
begin; | ||
select * from t1 where col1<10; | ||
pk col1 col2 | ||
0 0 0 | ||
1 1 1 | ||
2 2 2 | ||
3 3 3 | ||
4 4 4 | ||
5 5 5 | ||
6 6 6 | ||
7 7 7 | ||
8 8 8 | ||
9 9 9 | ||
# Connect with another connection and make a conflicting change | ||
begin; | ||
update t1 set col2=123456 where pk=0; | ||
commit; | ||
update t1 set col2=col2+1 where col1 < 10 limit 5; | ||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction | ||
drop table t1, ten, one_k; |
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,38 @@ | ||
--source include/have_rocksdb.inc | ||
|
||
connect (con2,localhost,root,,); | ||
connection default; | ||
|
||
create table t1 ( | ||
pk int not null primary key, | ||
col1 int not null, | ||
col2 int not null, | ||
key(col1) | ||
) engine=rocksdb; | ||
|
||
create table ten(a int primary key); | ||
insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); | ||
|
||
create table one_k(a int primary key); | ||
insert into one_k select A.a + B.a* 10 + C.a * 100 from ten A, ten B, ten C; | ||
|
||
insert into t1 select a,a,a from one_k; | ||
|
||
--echo # Start the transaction, get the snapshot | ||
begin; | ||
select * from t1 where col1<10; | ||
|
||
--echo # Connect with another connection and make a conflicting change | ||
connection con2; | ||
|
||
begin; | ||
update t1 set col2=123456 where pk=0; | ||
commit; | ||
|
||
connection default; | ||
|
||
--error ER_LOCK_DEADLOCK | ||
update t1 set col2=col2+1 where col1 < 10 limit 5; | ||
|
||
disconnect con2; | ||
drop table t1, ten, one_k; |
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