Created
December 2, 2018 08:36
-
-
Save yfuruyama/cba2b942c89fc00d228511a01d3336d1 to your computer and use it in GitHub Desktop.
This file contains 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
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | |
| tx1 | tx2 | | |
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | |
| spanner> BEGIN; | | | |
| Query OK, 0 rows affected (0.03 sec) | | | |
| | | | |
| | spanner> BEGIN; | | |
| | Query OK, 0 rows affected (0.07 sec) | | |
| | | | |
| spanner> SELECT * FROM Accounts WHERE UserId >= 1 AND UserId <= 10; | | | |
| +--------+---------+----------+ | | | |
| | UserId | Balance | Type | | | | |
| +--------+---------+----------+ | | | |
| | 1 | 1000 | Checking | | | | |
| | 2 | 1000 | Checking | | | | |
| | 3 | 1000 | Checking | | | | |
| +--------+---------+----------+ | | | |
| 3 rows in set (3.16 msecs) | | | |
| | | | |
| | spanner> INSERT INTO Accounts (UserId, Balance, Type) VALUES (4, 1000, 'Checking'); | | |
| | Query OK, 1 rows affected (0.70 sec) | | |
| | | | |
| | spanner> COMMIT; | | |
| | <---- blocked forever! | | |
| | | | |
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment