Created
July 4, 2024 07:17
-
-
Save grooverdan/ae1c56ca2c4a02052811a14eb343c472 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
worker[01] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019 | |
create table Person(IDPerson INT UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, LastLogin DATETIME); | |
insert into Person(LastLogin) values (NOW()), (NOW()), (NOW()); | |
select sleep(3); | |
sleep(3) | |
0 | |
create table Log ( | |
IDLog INT UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, | |
FKIDPerson INT UNSIGNED, | |
Hash VARCHAR(50), | |
CONSTRAINT `fk_person` | |
FOREIGN KEY (FKIDPerson) REFERENCES Person (IDPerson) | |
ON UPDATE NO ACTION ON DELETE CASCADE | |
); | |
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; | |
START TRANSACTION; | |
UPDATE Person SET LastLogin=NOW() WHERE IDPerson=1; | |
connect con1, localhost, root,,; | |
connection con1; | |
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; | |
START TRANSACTION; | |
INSERT INTO Log (FKIDPerson, Hash) VALUES (1, '95baa69a26a95db2'); | |
COMMIT; | |
connection default; | |
COMMIT; | |
SELECT * FROM Log; | |
IDLog FKIDPerson Hash | |
1 1 95baa69a26a95db2 | |
SELECT * FROM Person; | |
IDPerson LastLogin | |
1 2024-07-04 17:15:21 | |
2 2024-07-04 17:15:18 | |
3 2024-07-04 17:15:18 | |
DROP TABLE Log; | |
DROP TABLE Person; | |
main.t [ pass ] 3009 |
This file contains hidden or 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
--source include/have_innodb.inc | |
create table Person(IDPerson INT UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, LastLogin DATETIME); | |
insert into Person(LastLogin) values (NOW()), (NOW()), (NOW()); | |
select sleep(3); | |
create table Log ( | |
IDLog INT UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, | |
FKIDPerson INT UNSIGNED, | |
Hash VARCHAR(50), | |
CONSTRAINT `fk_person` | |
FOREIGN KEY (FKIDPerson) REFERENCES Person (IDPerson) | |
ON UPDATE NO ACTION ON DELETE CASCADE | |
); | |
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; | |
START TRANSACTION; | |
UPDATE Person SET LastLogin=NOW() WHERE IDPerson=1; | |
connect (con1, localhost, root,,); | |
connection con1; | |
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; | |
START TRANSACTION; | |
INSERT INTO Log (FKIDPerson, Hash) VALUES (1, '95baa69a26a95db2'); | |
COMMIT; | |
connection default; | |
COMMIT; | |
SELECT * FROM Log; | |
SELECT * FROM Person; | |
DROP TABLE Log; | |
DROP TABLE Person; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment