-
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
MySQL max() in nested subquery fails #30764
Comments
Hi @malachany, thank you for your feedback. Are you using SQL Federation? Can you provide your YAML configuration and table initialization SQL? I want to try to reproduce this exception. |
@strongduanmu , thank you for the fast reply. I'll create an example project with the same settings to replicate it. Will get that to you later today. 🙏🏻 |
@strongduanmu , I created a new repo with the example reproducible: https://github.com/malachany/shardingsphere-convert-to-long-example All in docker, so just run Thank you for looking into this |
@malachany Thank you for your help, I will try to reproduce and fix the problem. |
Sounds good, thank you |
Hey @strongduanmu. Checking in to see if there's any update in regards to reproducing the problem. Thanks |
Hey @strongduanmu , checking in on this. Hope you had a good weekend |
@malachany Sorry, I'm very busy recently, I will take some time this week to investigate this issue. |
No worries. Thanks for the update |
@malachany Hello, we have investigated the issue and currently you can resolve it using any of the following methods: Change the data type of your table field from |
thanks @strongduanmu and @zihaoAK47 for looking into this |
@malachany You are welcome to help us test sql federation. This feature is very important to ShardingSphere and can greatly improve the usage scenarios of ShardingSphere. |
@strongduanmu I'll be pulling latest and testing this out soon and will update you :) |
Bug Report
For English only, other languages will not accept.
Before report a bug, make sure you have:
Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot reproduce it on current information, we will close it.
Please answer these questions before submitting your issue. Thanks!
Which version of ShardingSphere did you use?
Tested in v5.41 and v5.4.2-SNAPSHOT
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
Expected behavior
Expected to return a list of recent chat_messages
Actual behavior
In 5.41:
General error: 30000 Unknown exception: Cannot convert 2022-09-14T18:25:06 to long
In 5.4.2-SNAPSHOT:
SQL federation doesn't support SQL
Reason analyze (If you can)
It looks like the MAX(created_at) isn't working correctly, and instead of showing the max DATETIME, it's trying to convert it to LONG.
One thing to note is that if I run the subquery by itself, it works fine.. it's only with it in the subquery that seems to be a problem:
this works fine
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
This is the query:
Example codes for reproduce this issue (such as a github link).
The text was updated successfully, but these errors were encountered: