dble icon indicating copy to clipboard operation
dble copied to clipboard

'select syntax' results in implicit submission with ddl on no-sharding-tables preceding

Open zhunina opened this issue 7 years ago • 1 comments

mysql> begin;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from t5 limit 1 for update;
+--------------------+------+------+
| id                 | name | sex  |
+--------------------+------+------+
| 940051999573934080 | aa   | NULL |
+--------------------+------+------+
1 row in set (18.84 sec)

mysql> drop table tt;
Query OK, 0 rows affected (0.01 sec)

mysql> select * from t1;
+------+------+
| id   | name |
+------+------+
|  512 | aa   |
|  513 | aa   |
|    2 | bb   |
|  511 | bb   |
| 1024 | bb   |
+------+------+
5 rows in set (0.00 sec)

Results:the last 'select syntax' results in implicit submission

zhunina avatar Dec 11 '17 08:12 zhunina

The issue is when Mysql Client start a transaction and doing some DML sql
After that execute a DDL sql,the transaction will be commit e.g.
  begin;                   --(1)
  insert into test_a set id= 99;        --(2)
  create table test_b (id int);          --(3)
After (3) executed ,(2) is commited

We investigated the behavior of mysql,the transaction would be commit whatever the DDL execute successfully,so dble is supposed to commit the session before DDL execute

sunsun314 avatar Aug 03 '18 06:08 sunsun314