You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the second case which we want to set 2 different MAX_EXECUTION_TIME, the result seems acceptable. set_var is used to set variables for a query, we can't set 2 different values for the same variable in a single query, so it seems acceptable that both the outside query and the sub-query return 1234.
For the third case, the reason is that set_var is kind of specially handled at the optimization phase, but the uncorrelated sub-query is also specially evaluated at the rewriting phase, so the set_var doesn't take effect in this case.
It's hard to handle set_var at the rewriting phase, which can make our code complex and chaos.
I'll update our hint doc to guide the user to avoid this case.
Degrade this issue from Major to Minor.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
set_var affect the subquery
3. What did you see instead (Required)
set_var not works for the subquery
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: