Skip to content

Instantly share code, notes, and snippets.

@honux77
Last active August 20, 2019 15:40
Show Gist options
  • Save honux77/00c0a88e1bf6da1ed6b2462eca38adb1 to your computer and use it in GitHub Desktop.
Save honux77/00c0a88e1bf6da1ed6b2462eca38adb1 to your computer and use it in GitHub Desktop.
mysql atomic increment example
USE honuxdb;
SET SESSION transaction_isolation='SERIALIZABLE';
# SELECT @@GLOBAL.transaction_isolation, @@transaction_isolation;
START TRANSACTION;
SELECT SLEEP(3);
UPDATE SUA SET B = B + 1 WHERE A = 'YJ';
SELECT * FROM SUA;
COMMIT;
@honux77
Copy link
Author

honux77 commented Aug 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment