Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
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
par
sale
new_road
new_road
Pivot Table test
nw
Práctica MySQL 2
salamatova
Estudiantes
media challenge response