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 Report: Regression in subquery planning wrt v18 #16401

Closed
GuptaManan100 opened this issue Jul 16, 2024 · 0 comments · Fixed by #16402
Closed

Bug Report: Regression in subquery planning wrt v18 #16401

GuptaManan100 opened this issue Jul 16, 2024 · 0 comments · Fixed by #16402

Comments

@GuptaManan100
Copy link
Member

Overview of the Issue

The following query would work as expected in v18, but now fails in main - select col, trim((select user_name from user where id = 3)) val from user_extra where user_id = 3 group by col order by val

Plan from v18 -

{
          "QueryType": "SELECT",
          "Original": "select col, trim((select user_name from user where id = 3)) val from user_extra where user_id = 3 group by col order by val",
          "Instructions": {
            "OperatorType": "Route",
            "Variant": "EqualUnique",
            "Keyspace": {
              "Name": "user",
              "Sharded": true
            },
            "FieldQuery": "select col, trim((select user_name from `user` where 1 != 1)) as val from user_extra where 1 != 1 group by col",
            "Query": "select col, trim((select user_name from `user` where id = 3)) as val from user_extra where user_id = 3 group by col order by trim((select `user`.user_name from `user` where `user`.id = 3)) asc",
            "Table": "user_extra",
            "Values": [
              "3"
            ],
            "Vindex": "user_index"
          },
          "TablesUsed": [
            "user.user",
            "user.user_extra"
          ]
        }

The error in main -

"VT12001: unsupported: subquery with aggregation in order by"

Reproduction Steps

Run the given query in the plan_test on main and v18

Binary Version

main, 20, 19

Operating System and Environment details

-

Log Fragments

No response

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