tiflow icon indicating copy to clipboard operation
tiflow copied to clipboard

DM can sync binlog `CRATE TABLE AS SELECT`, but TiDB can not execute it

Open jackysp opened this issue 1 month ago • 3 comments

What did you do?

DM can synchronize the binlog generated by CREATE TABLE AS SELECT, which produces a CREATE TABLE ... START TRANSACTION binlog. TiDB cannot handle it. This will cause synchronization to be interrupted.

Image

What did you expect to see?

No sync error.

What did you see instead?

Sync failed with syntax error.

Versions of the cluster

DM version (run dmctl -V or dm-worker -V or dm-master -V):

TiDB Cloud v8.5.3

Upstream MySQL/MariaDB server version:

v8.0.42 of MySQL / Aurora v3.10.0 

Downstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

TiDB Cloud v8.5.3

How did you deploy DM: tiup or manually?

TiDB Cloud v8.5.3

Other interesting information (system version, hardware config, etc):

>
>

current status of DM cluster (execute query-status <task-name> in dmctl)

(paste current status of DM cluster here)

jackysp avatar Nov 25 '25 03:11 jackysp

I think DM can rewrite it as a CREATE TABLE statement, and also converts the following COMMIT to no-op and ROLLBACK to DROP TABLE

/cc @GMHDBJD @D3Hunter

lance6716 avatar Nov 25 '25 04:11 lance6716

I think DM can rewrite it as a CREATE TABLE statement, and also converts the following COMMIT to no-op and ROLLBACK to DROP TABLE

/cc @GMHDBJD @D3Hunter

lgtm, i think rollback shouldn't appear in the binlog in this case

D3Hunter avatar Nov 25 '25 06:11 D3Hunter

I think DM is not designed for TiDB only. Why not support create table ... start transaction in TiDB?

jackysp avatar Nov 26 '25 06:11 jackysp