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.

Revisions

  1. perepechaev created this gist Jun 30, 2015.
    41 changes: 41 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    ### Первый клиент

    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)