Created
December 2, 2018 08:24
-
-
Save yfuruyama/a2fef5cfabf7f94b8c4869943783242d 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
| +------------------------------------------------------+------------------------------------------------------+ | |
| | tx1 | tx2 | | |
| +------------------------------------------------------+------------------------------------------------------+ | |
| | spanner> BEGIN; | | | |
| | Query OK, 0 rows affected (0.01 sec) | | | |
| | | | | |
| | | spanner> BEGIN; | | |
| | | Query OK, 0 rows affected (0.05 sec) | | |
| | | | | |
| | spanner> SELECT * FROM Counters WHERE Id = 1; | | | |
| | +----+-------+ | | | |
| | | Id | Value | | | | |
| | +----+-------+ | | | |
| | | 1 | 0 | | | | |
| | +----+-------+ | | | |
| | 1 rows in set (20.02 msecs) | | | |
| | | | | |
| | | spanner> SELECT * FROM Counters WHERE Id = 1; | | |
| | | +----+-------+ | | |
| | | | Id | Value | | | |
| | | +----+-------+ | | |
| | | | 1 | 0 | | | |
| | | +----+-------+ | | |
| | | 1 rows in set (3.07 msecs) | | |
| | | | | |
| | spanner> UPDATE Counters SET Value = 1 WHERE Id = 1; | | | |
| | Query OK, 1 rows affected (0.58 sec) | | | |
| | | | | |
| | | spanner> UPDATE Counters SET Value = 1 WHERE Id = 1; | | |
| | | Query OK, 1 rows affected (0.57 sec) | | |
| | | | | |
| | spanner> COMMIT; | | | |
| | Query OK, 0 rows affected (0.46 sec) | | | |
| | | | | |
| | | spanner> COMMIT; | | |
| | | ERROR: transaction was aborted | | |
| | | | | |
| | spanner> SELECT * FROM Counters WHERE Id = 1; | | | |
| | +----+-------+ | | | |
| | | Id | Value | | | | |
| | +----+-------+ | | | |
| | | 1 | 1 | | | | |
| | +----+-------+ | | | |
| | 1 rows in set (19.3 msecs) | | | |
| | | | | |
| +------------------------------------------------------+------------------------------------------------------+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment