Skip to content

Instantly share code, notes, and snippets.

@yfuruyama
Created December 2, 2018 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yfuruyama/1d24d503ab0dfa1f16e0c2e62a479c4e to your computer and use it in GitHub Desktop.
Save yfuruyama/1d24d503ab0dfa1f16e0c2e62a479c4e to your computer and use it in GitHub Desktop.
+---------------------------------------------------------------+---------------------------------------------------+
| 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