Skip to content

Instantly share code, notes, and snippets.

@perepechaev
Created June 30, 2015 07:16
Show Gist options
  • Save perepechaev/22bc7e8e341164ff0ac9 to your computer and use it in GitHub Desktop.
Save perepechaev/22bc7e8e341164ff0ac9 to your computer and use it in GitHub Desktop.
### Первый клиент
mysql-1> SHOW VARIABLES LIKE '%tx_isolation%';
+---------------+-----------------+
| Variable_name | Value |
+---------------+-----------------+
| tx_isolation | REPEATABLE-READ |
+---------------+-----------------+
1 row in set (0.00 sec)
mysql-1> select * from t1;
Empty set (0.00 sec)
mysql-1> START TRANSACTION;
Query OK, 0 rows affected (0.00 sec)
### Затем второй клиент
mysql-2> insert into t1 values(null, 'aaa');
Query OK, 1 row affected (0.00 sec)
mysql-2> select * from t1;
+----+------+
| id | name |
+----+------+
| 1 | aaa |
+----+------+
1 row in set (0.00 sec)
### Возвращаемся в первый клиент
mysql-1> select * from t1;
+----+------+
| id | name |
+----+------+
| 1 | aaa |
+----+------+
1 row in set (0.00 sec)
mysql-1> commit;
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