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

[Bug] Keyword conflict #2381

Closed
1 task done
Malcolmjian opened this issue Aug 10, 2023 · 0 comments
Closed
1 task done

[Bug] Keyword conflict #2381

Malcolmjian opened this issue Aug 10, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Malcolmjian
Copy link
Contributor

Malcolmjian commented Aug 10, 2023

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!

@Malcolmjian Malcolmjian added the bug Something isn't working label Aug 10, 2023
Malcolmjian pushed a commit to Malcolmjian/flink-cdc-connectors that referenced this issue Aug 14, 2023
Malcolmjian pushed a commit to Malcolmjian/flink-cdc-connectors that referenced this issue Aug 14, 2023
ruanhang1993 pushed a commit that referenced this issue Aug 15, 2023
GOODBOY008 pushed a commit to GOODBOY008/flink-cdc that referenced this issue Oct 30, 2023
apache#2388)

Co-authored-by: DESKTOP-TQDONF3\狗狗jian <[email protected]>
(cherry picked from commit f7df47e)
GOODBOY008 pushed a commit to GOODBOY008/flink-cdc that referenced this issue Oct 30, 2023
apache#2388)

Co-authored-by: DESKTOP-TQDONF3\狗狗jian <[email protected]>
(cherry picked from commit f7df47e)
GOODBOY008 pushed a commit to GOODBOY008/flink-cdc that referenced this issue Oct 30, 2023
apache#2388)

Co-authored-by: DESKTOP-TQDONF3\狗狗jian <[email protected]>
(cherry picked from commit f7df47e)
leonardBang pushed a commit that referenced this issue Oct 31, 2023
Co-authored-by: DESKTOP-TQDONF3\狗狗jian <[email protected]>
(cherry picked from commit f7df47e)
zhongqishang pushed a commit to zhongqishang/flink-cdc that referenced this issue Dec 7, 2023
apache#2388)

Co-authored-by: DESKTOP-TQDONF3\狗狗jian <[email protected]>
(cherry picked from commit f7df47e)
ChaomingZhangCN pushed a commit to ChaomingZhangCN/flink-cdc that referenced this issue Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants