Created
December 2, 2018 08:22
-
-
Save yfuruyama/1d24d503ab0dfa1f16e0c2e62a479c4e 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 (1.17 sec) | | | |
| | | | |
| | spanner> BEGIN; | | |
| | Query OK, 0 rows affected (0.06 sec) | | |
| | | | |
| spanner> UPDATE Accounts Set Balance = 2000 WHERE UserId = 1; | | | |
| Query OK, 1 rows affected (1.02 sec) | | | |
| | | | |
| | spanner> SELECT * FROM Accounts WHERE UserId = 1; | | |
| | +--------+---------+----------+ | | |
| | | UserId | Balance | Type | | | |
| | +--------+---------+----------+ | | |
| | | 1 | 1000 | Checking | | | |
| | +--------+---------+----------+ | | |
| | 1 rows in set (3.03 msecs) | | |
| | | | |
| spanner> COMMIT; | | | |
| Query OK, 0 rows affected (1.19 sec) | | | |
| | | | |
| spanner> SELECT * FROM Accounts WHERE UserId = 1; | | | |
| +--------+---------+----------+ | | | |
| | UserId | Balance | Type | | | | |
| +--------+---------+----------+ | | | |
| | 1 | 2000 | Checking | | | | |
| +--------+---------+----------+ | | | |
| 1 rows in set (2.89 msecs) | | | |
| | | | |
+---------------------------------------------------------------+---------------------------------------------------+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment