MDEV-37713/MDEV-37714 Fold boolean literals in SELECT-list#4754
MDEV-37713/MDEV-37714 Fold boolean literals in SELECT-list#4754jaeheonshim wants to merge 1 commit into
Conversation
8acdfc3 to
3dc42db
Compare
gkodinov
left a comment
There was a problem hiding this comment.
Thank you for your contribution! This is a preliminary review.
Please also add a test case.
And, the jira mentions one optimization you're not really doing:
SELECT (a > 0 AND a < 0) FROM t1;
SELECT (a > 0 OR a <=0) FROM t1;
Would you consider doing this too? Or, if you wont, we'll need to open a sub-task Jira instead of using the current one.
Unfortunately, I don't think something like that can be added. We would risk breaking the semantics of the sql query. For example, if |
|
There hasn't been any activity for more than 3 weeks now. Closing due to inactivity. If you would like to keep working on that please ping me or anybody else of the MariaDB committers to re-open the PR for you. |
c439d1a to
8003be3
Compare
|
@jaeheonshim , generally we try to avoid test files names like |
|
The recursive |
|
@Olernov , thanks for the suggestions! I added the |
And please address other unresolved comments here, thank you! |
|
@Olernov , I moved Ready for your review! |
The order of evaluation of the expressions that appear in a SELECT-list is undefined. This change exploits this fact by recursively folding TRUE/FALSE literals in OR/AND expressions which may allow for skipping evaluation of some parts of the expression or even the whole expression.
Olernov
left a comment
There was a problem hiding this comment.
@jaeheonshim, now everything is OK, thanks for good work! Now this PR needs to pass the testing, I'll re-assign JIRA tasks to the QA team.
The order of evaluation of the expressions that appear in a SELECT-list is undefined. This change exploits this fact by recursively folding TRUE/FALSE literals in OR/AND expressions which may allow for skipping evaluation of some parts of the expression or even the whole expression.
Example
Setup
Before
After