Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using special comment syntax with /*!90000 */ caused TiCDC to report an error. #3755

Closed
SE-Bin opened this issue Dec 7, 2021 · 6 comments · Fixed by #3845
Closed

Using special comment syntax with /*!90000 */ caused TiCDC to report an error. #3755

SE-Bin opened this issue Dec 7, 2021 · 6 comments · Fixed by #3845
Assignees

Comments

@SE-Bin
Copy link
Contributor

SE-Bin commented Dec 7, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

I found that creating a table by using special comment syntax with /*!90000 */ caused TiCDC to report an error.
The following step:

  1. In TiDB :
create table cdc_test (id varchar(10) primary key ,c1 varchar(10)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin/*!90000  SHARD_ROW_ID_BITS=4 PRE_SPLIT_REGIONS=3 */

2. What did you expect to see? (Required)

TiCDC can sync DDL to downstream successfully.

3. What did you see instead (Required)

TiCDC cause the error

[WARN] [mysql.go:208] ["execute DDL with error, retry later"] [query="create table cdc_test (id varc
har(10) primary key ,c1 varchar(10)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin/*!90000 /*T! SHARD_ROW_ID_BITS=4 PRE_SPLIT_REGIONS=3 */ */"] [error="[CDC:ErrMySQLTxnError]Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 182 near \"*/\" "]

4. What is your TiDB version? (Required)

TiDB & TiCDC: v5.0.3

@lance6716
Copy link
Contributor

I'll transfer this issue to repo TiCDC.

@lance6716 lance6716 transferred this issue from pingcap/tidb Dec 7, 2021
@lance6716 lance6716 added the type/bug The issue is confirmed as a bug. label Dec 7, 2021
@Rustin170506 Rustin170506 added the area/ticdc Issues or PRs related to TiCDC. label Dec 7, 2021
@Rustin170506
Copy link
Member

Is your downstream TiDB or MySQL?

@SE-Bin
Copy link
Contributor Author

SE-Bin commented Dec 7, 2021

In my case ,downstream is TiDB.

@maxshuang
Copy link
Contributor

maxshuang commented Dec 17, 2021

@sdojjy The pr related to this issue can rewrite the following DDL to compatible with MySQL?

[2021/12/17 11:24:16.467 +08:00] [WARN] [mysql.go:218] ["execute DDL with error, retry later"] [query="/* init */ create table t (id int primary key, v int) shard_row_id_bits 4;"] [error="[CDC:ErrMySQLTxnError]Error 8200: Unsupported shard_row_id_bits for table with primary key as row id"] [errorVerbose="[CDC:ErrMySQLTxnError]Error 8200: Unsupported shard_row_id_bits for table with primary key as row

Move "shard_row_id_bits 4;" to SQL comment ?

@sdojjy
Copy link
Member

sdojjy commented Dec 17, 2021

@maxshuang #3845 will rewrite
/* init */ create table t (id int primary key, v int) shard_row_id_bits 4; to CREATE TABLE t (id INT PRIMARY KEY,v INT) /*T! SHARD_ROW_ID_BITS = 4 */

@sdojjy
Copy link
Member

sdojjy commented Dec 21, 2021

TiCDC introduced this bug in v4.0.0, and it is fixed since v5.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants