Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Test for MySQL "serializable" transaction, part 1
-- test for "serializable" -- first run this session (with sleep) -- while sleeping, run the second script -- one should end up in a deadlock drop table if exists person123_so_UUU; CREATE TABLE person123_so_UUU ( person_id INTEGER PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50) NOT NULL ) engine = InnoDB; rollback; -- for rextester internal transaction; delete from person123_so_UUU; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; START TRANSACTION; SELECT * FROM person123_so_UUU WHERE name = 'Bob Ross'; select sleep(5); INSERT INTO person123_so_UUU (name) VALUES ('Bob Ross'); SELECT last_insert_id(); SELECT * FROM person123_so_UUU; COMMIT;
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
restaurants_menu
MySQL subtract 8 hours
kuy09:admin@pkms99.info
Newspaper Site
ayushagg31.c
TEST
How to run query to keep maximum 3 rows with the same name
list with indented categories
SQL transaction
Srinivas
Please log in to post a comment.