-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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 alias is not propagated to subquery #26945
Comments
@wolf31o2 you said you identified this problem due to a query generated by Hibernate, is that correct? I don't know a great deal about Hibernate, but is it possible for you to share information about the code path, methods, etc., that cause Hibernate to generate this query? |
Hibernate is a Java ORM. I could probably create some code to generate this. This is a simplified test case of a single query which is failing in TiDB, but passes in MySQL, and is automatically generated in Hibernate using the |
@wolf31o2 I've located the cause of the problem and have started working on a fix. When the fix is complete, issue will be updated. |
@wolf31o2 Thanks for your issue. I found that |
@rebelice how did you come to the conclusion that "order by (subquery) is not legal"? The document you linked to discusses certain order by optimizations, it certainly does not try to cover all the legal syntax of the order by clause. Please try testing the reproduce steps in MySQL, and you will find that they work correctly there. |
Also, this syntax DOES work in TiDB:
So having one.b in the outer query produces a correct query and is processed the same in TiDB as in MySQL. Both syntax work in MySQL. |
@hawkingrei is there any update on the fix? I'm assigning this back to you to follow up for now. |
Currently TiDB does not support the following statements |
/assign @AilinKid |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: