-
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
planner: fix panic in expression rewriter caused by asScalar
#20956
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/run-check_dev_2 |
Closed
/run-check_dev_2 |
/cc winoros |
eurekaka
reviewed
Nov 12, 2020
tk.MustExec("INSERT INTO t1 VALUES(1,1),(2,2),(3,3);") | ||
tk.MustExec("ANALYZE TABLE t1;") | ||
tk.MustExec("SELECT * FROM t1 WHERE ISNULL(t1.a IN (SELECT t3.a FROM t1 t3));") | ||
tk.MustExec("SELECT * FROM t1 WHERE CASE (1 IN (SELECT a FROM t1)) WHEN 0 THEN 0 END;") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the results of these 2 queries as well.
Closed it because #19797 has done the same fix. |
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: close #20552
Problem Summary:
SQLs like
SELECT * FROM t1 WHERE ISNULL(t1.a IN (SELECT t3.a FROM t1 t3));
andSELECT * FROM t1 WHERE CASE (1 IN (SELECT a FROM t1)) WHEN 0 THEN 0 END;
will cause panic.What is changed and how it works?
What's Changed:
Set
asScalar
to true in(*expressionRewriter).Enter()
when meetFuncCallExpr
orCaseExpr
.How it Works:
FuncCallExpr
andCaseExpr
need args be put onctxStack
, which means thatasScalar
should betrue
, however it wasn't set totrue
.Related changes
Check List
Tests
Release note