Last active
December 2, 2018 08:41
-
-
Save yfuruyama/68b8f166ffba273c665482832cf9fc2e 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 RO; | | | |
| Query OK, 0 rows affected (0.00 sec) | | | |
| | | | |
| | spanner> BEGIN; | | |
| | Query OK, 0 rows affected (0.26 sec) | | |
| | | | |
| spanner> SELECT * FROM Accounts WHERE UserId = 1; | | | |
| +--------+---------+----------+ | | | |
| | UserId | Balance | Type | | | | |
| +--------+---------+----------+ | | | |
| | 1 | 1000 | Checking | | | | |
| +--------+---------+----------+ | | | |
| 1 rows in set (4.54 msecs) | | | |
| | | | |
| | spanner> UPDATE Accounts Set Balance = 500 WHERE UserId = 1; | | |
| | Query OK, 1 rows affected (0.72 sec) | | |
| | | | |
| | spanner> UPDATE Accounts Set Balance = 1500 WHERE UserId = 2; | | |
| | Query OK, 1 rows affected (0.74 sec) | | |
| | | | |
| | spanner> COMMIT; | | |
| | Query OK, 0 rows affected (0.31 sec) | | |
| | | | |
| spanner> SELECT * FROM Accounts WHERE UserId = 2; | | | |
| +--------+---------+----------+ | | | |
| | UserId | Balance | Type | | | | |
| +--------+---------+----------+ | | | |
| | 2 | 1000 | Checking | | | | |
| +--------+---------+----------+ | | | |
| 1 rows in set (2.13 msecs) | | | |
| | | | |
| spanner> CLOSE; | | | |
| Query OK, 0 rows affected (0.00 sec) | | | |
| | | | |
+---------------------------------------------------+---------------------------------------------------------------+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment