Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug] Keyword conflict #2381

@Malcolmjian

Description

@Malcolmjian

Search before asking

  • I searched in the issues and found nothing similar.

Flink version

1.16.0

Flink CDC version

2.3.0

Database and its version

mysql 5.7

Minimal reproduce step

CREATE TABLE feed_topic_links (
index int(10) unsigned NOT NULL AUTO_INCREMENT ,
topic_id int(10) unsigned NOT NULL COMMENT 'Topic ID',
feed_id int(10) unsigned NOT NULL COMMENT 'Feed ID',
PRIMARY KEY (index),
KEY feed_topic_links_topic_id_index (topic_id),
KEY feed_topic_links_feed_id_index (feed_id)
) ENGINE=InnoDB AUTO_INCREMENT=17028 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

image

When the primary key of a table is a MySQL keyword, it will cause an SQL exception. My solution is to add backticks (`) around the keyword. Please help me translate this into English and optimize the statement.

When the primary key of a table coincides with a MySQL keyword, it triggers an SQL exception. To resolve this issue, simply place backticks (`) around the keyword.

What did you expect to see?

select * from xxx whre `index` >=100 and not(`index` = 100)

What did you see instead?

image

Anything else?

No response

Are you willing to submit a PR?

I'm willing to submit a PR!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions