1--source include/have_rocksdb.inc
2--source include/count_sessions.inc
3
4# Tests if locks are held for the secondary keys of old rows in updates
5
6connect (con, localhost, root,,);
7
8connection default;
9create table t1 (a int primary key, b int unique key) engine = rocksdb;
10insert into t1 values(1, 1);
11
12connection con;
13begin;
14update t1 set b = 2 where b = 1; # this should lock the row where b = 1
15
16connection default;
17error ER_LOCK_WAIT_TIMEOUT;
18insert into t1 values(2, 1); # should error out with lock_wait_timeout
19
20connection con;
21rollback;
22select * from t1;
23
24# Cleanup
25connection default;
26drop table t1;
27disconnect con;
28
29--source include/wait_until_count_sessions.inc
30