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

Table name is keyword error #34137

Open
GuiwenChen opened this issue Dec 24, 2024 · 10 comments
Open

Table name is keyword error #34137

GuiwenChen opened this issue Dec 24, 2024 · 10 comments

Comments

@GuiwenChen
Copy link

Bug Report

For English only, other languages will not accept.

When I use ShardingSphere-proxy for data migration, when the table name is a keyword, such as user or unit, when I use the command:

"MIGRATE TABLE ds_0.user INTO user"

The migration task fails to be created with the following error: ERROR 1064 (42000): You have an error in your SQL syntax: no viable alternative at input 'MIGRATE' near '[@0,0:6='MIGRATE',<449>,1:0]' at line 1.

When I changed it to

“MIGRATE TABLE ds_0.user INTO user

The task can be created successfully, but the following error message is displayed in the log:

Can not get meta data for table 'user' when split by range.

This seems to be a bug, can you fix this problem?

@GuiwenChen
Copy link
Author

截屏2024-12-24 16 10 24

@GuiwenChen
Copy link
Author

截屏2024-12-24 16 12 51

@terrymanu
Copy link
Member

What is the version

@GuiwenChen
Copy link
Author

5.5.1

@jasneetsingh6114
Copy link

Hi team,

I noticed the issue regarding migration failure when using reserved keywords like user or unit as table names. This seems to be related to syntax handling and metadata fetching in ShardingSphere-Proxy during migration tasks.

I'd like to contribute by investigating and resolving this issue. Could you please assign it to me? I’ll ensure to follow the contribution guidelines and provide a detailed solution.

Looking forward to your approval!

@terrymanu
Copy link
Member

Great, please go ahead @jasneetsingh6114

@jasneetsingh6114
Copy link

jasneetsingh6114 commented Dec 27, 2024

@GuiwenChen

I wanted to ask if you could provide guidance on how to reproduce the problem.

I am currently referencing the ShardingSphere Migration documentation for setting up and to reproduce the error locally.

Looking forward to your response.

@GuiwenChen
Copy link
Author

You can create a table in source db with keywords, such as user, and then depending on the page: https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-proxy/migration/usage/

The guide starts the migration task so you can reproduce the problem

@jasneetsingh6114
Copy link

@terrymanu I was able to reproduce the error locally with version 5.5.1(apache-shardingsphere-5.5.1-shardingsphere-proxy-bin). Before proceeding with further investigation, I would like to check if the same issue exists in the master branch. Could you please guide me on how to run and debug the master branch code on my local environment.

@GuiwenChen
Copy link
Author

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

No branches or pull requests

3 participants