Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
cfc90216
Commit
cfc90216
authored
Oct 03, 2013
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#90 add a test scenario where the 2nd txn succeeds
parent
4bfee013
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
17 deletions
+91
-17
mysql-test/suite/tokudb/r/i_s_tokudb_lock_waits_released.result
...test/suite/tokudb/r/i_s_tokudb_lock_waits_released.result
+35
-3
mysql-test/suite/tokudb/t/i_s_tokudb_lock_waits_released.test
...l-test/suite/tokudb/t/i_s_tokudb_lock_waits_released.test
+56
-14
No files found.
mysql-test/suite/tokudb/r/i_s_tokudb_lock_waits_released.result
View file @
cfc90216
...
...
@@ -2,13 +2,12 @@ set default_storage_engine='tokudb';
set tokudb_prelock_empty=false;
drop table if exists t;
create table t (id int primary key);
set autocommit=0;
select * from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
select * from information_schema.tokudb_locks;
locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right
select * from information_schema.tokudb_lock_waits;
requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time
select * from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
set autocommit=0;
insert into t values (1);
set autocommit=0;
...
...
@@ -28,8 +27,41 @@ select * from information_schema.tokudb_locks;
locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right
TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000
TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000
select * from information_schema.tokudb_lock_waits;
requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
commit;
select * from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
select * from information_schema.tokudb_locks;
locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right
select * from information_schema.tokudb_lock_waits;
requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time
set autocommit=0;
replace into t values (1);
set autocommit=0;
replace into t values (1);
select * from information_schema.tokudb_locks;
locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right
TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000
select * from information_schema.tokudb_lock_waits;
requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time
REQUEST_TRX_ID BLOCK_TRX_ID ./test/t-main 0001000000 0001000000 LOCK_WAITS_START_TIME
select * from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
TRX_ID MYSQL_ID
TRX_ID MYSQL_ID
commit;
select * from information_schema.tokudb_locks;
locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right
TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000
select * from information_schema.tokudb_lock_waits;
requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time
commit;
select * from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
select * from information_schema.tokudb_locks;
locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right
select * from information_schema.tokudb_lock_waits;
requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time
drop table t;
mysql-test/suite/tokudb/t/i_s_tokudb_lock_waits_released.test
View file @
cfc90216
...
...
@@ -9,57 +9,99 @@ drop table if exists t;
enable_warnings
;
create
table
t
(
id
int
primary
key
);
set
autocommit
=
0
;
let
$default_id
=
`select connection_id()`
;
# verify that txn_a insert (1) blocks txn_b insert (1) and txn_b gets a duplicate key error
# should be empty
select
*
from
information_schema
.
tokudb_trx
;
select
*
from
information_schema
.
tokudb_locks
;
select
*
from
information_schema
.
tokudb_lock_waits
;
select
*
from
information_schema
.
tokudb_trx
;
connect
(
conn_a
,
localhost
,
root
,,);
set
autocommit
=
0
;
let
$a_id
=
`select connection_id()`
;
insert
into
t
values
(
1
);
connect
(
conn_b
,
localhost
,
root
,,);
set
autocommit
=
0
;
let
$b_id
=
`select connection_id()`
;
send
insert
into
t
values
(
1
);
# should find the presence of a lock on 1st transaction
connection
default
;
replace_column
1
TRX_ID
2
MYSQL_ID
;
eval
select
*
from
information_schema
.
tokudb_locks
;
select
*
from
information_schema
.
tokudb_locks
;
# should find the presence of a lock_wait on the 2nd transaction
replace_column
1
REQUEST_TRX_ID
2
BLOCK_TRX_ID
6
LOCK_WAITS_START_TIME
;
eval
select
*
from
information_schema
.
tokudb_lock_waits
;
select
*
from
information_schema
.
tokudb_lock_waits
;
# should find the presence of two transactions
replace_column
1
TRX_ID
2
MYSQL_ID
;
eval
select
*
from
information_schema
.
tokudb_trx
;
select
*
from
information_schema
.
tokudb_trx
;
connection
conn_a
;
commit
;
# verify that the lock on the 1st transaction is released and replaced by the lock for the 2nd transaction
replace_column
1
TRX_ID
2
MYSQL_ID
;
eval
select
*
from
information_schema
.
tokudb_locks
;
select
*
from
information_schema
.
tokudb_locks
;
select
*
from
information_schema
.
tokudb_lock_waits
;
connection
conn_b
;
--
error
1062
--
error
1062
# duplicate key
reap
;
commit
;
connection
default
;
disconnect
conn_a
;
disconnect
conn_b
;
connection
default
;
# verify that txn_a replace (1) blocks txn_b replace (1) and txn_b eventually gets the lock on (1) and completes
# verify that the lock on the 2nd transaction has been released
# should be be empty
select
*
from
information_schema
.
tokudb_trx
;
select
*
from
information_schema
.
tokudb_locks
;
select
*
from
information_schema
.
tokudb_lock_waits
;
connect
(
conn_a
,
localhost
,
root
,,);
set
autocommit
=
0
;
replace
into
t
values
(
1
);
connect
(
conn_b
,
localhost
,
root
,,);
set
autocommit
=
0
;
send
replace
into
t
values
(
1
);
# should find the presence of a lock on 1st transaction
connection
default
;
replace_column
1
TRX_ID
2
MYSQL_ID
;
select
*
from
information_schema
.
tokudb_locks
;
# should find the presence of a lock_wait on the 2nd transaction
replace_column
1
REQUEST_TRX_ID
2
BLOCK_TRX_ID
6
LOCK_WAITS_START_TIME
;
select
*
from
information_schema
.
tokudb_lock_waits
;
# should find the presence of two transactions
replace_column
1
TRX_ID
2
MYSQL_ID
;
select
*
from
information_schema
.
tokudb_trx
;
connection
conn_a
;
commit
;
# verify that the lock on the 1st transaction is released and replaced by the lock for the 2nd transaction
replace_column
1
TRX_ID
2
MYSQL_ID
;
select
*
from
information_schema
.
tokudb_locks
;
select
*
from
information_schema
.
tokudb_lock_waits
;
connection
conn_b
;
reap
;
commit
;
connection
default
;
disconnect
conn_a
;
disconnect
conn_b
;
# verify that the lock on the 2nd transaction has been released
# should be be empty
select
*
from
information_schema
.
tokudb_trx
;
select
*
from
information_schema
.
tokudb_locks
;
select
*
from
information_schema
.
tokudb_lock_waits
;
drop
table
t
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment