dble
dble copied to clipboard
'select syntax' results in implicit submission with ddl on no-sharding-tables preceding
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
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