-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Delete with alias error #2961
Comments
version 4.0.0.-RC1 and 4.0.0.RC2 have different error. delete goos_s from goods as goods_s where good_s.goods_id< 10 will execute successfully under RC1, but will execute error under RC2 |
Can you show some exception? |
Consider supporting DML for Multiple-Table with low ROI, SS can't support it for now. |
No, it is not multiple table. It is just add the table alias for delete operation. And it runs well under 4.0.0-RC1, and it can not support now, is it reasonable? |
Thanks for your issue. I'll look at it. |
just saw this piece of source code, is to parse sql bug |
Should take tableReferences this node to resolve table name |
Thank you for your help. But I can not see your picture, could you reply me again? |
|
Thank you very much. This solution does really work. Is it a bug or not? |
I think it is a bug, but the single table does not support it. Need to judge the data node |
It's looks like a bug, and I will work on it tomorrow. Please let me know if you have any advice. |
I follow strawhat925's advice. Download the source code, then change the xml in mysql-parser module. At the end, I run maven install locally to generate the jar package. In my application, i replace mysql parser with maven system scope. It really works. |
Need to consider no aliases, I did not consider |
Thank you very much. In my application, I will add alias default. |
ss only supports single table deletion, so you don't have much meaning with aliases. |
|
Sharding-jdbc
version:4.0.0-RC1
my logical sql
delete Goods from goods AS Goods WHERE Goods.goods_id <= ?
However sharding-jdbc replace alias and the table name totally, just like this
delete goods_1 from goods_1 AS Goods WHERE Goods.goods_id <= ?
this will execute error in mysql 5.6
One solution is to change to another alias different table name, but this may difficult for me. What else should I do?
The text was updated successfully, but these errors were encountered: