-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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 row compare logic for ast.LE and ast.GE #8248
Conversation
LGTM |
/run-all-tests tidb-test=pr/646 |
CI failed |
/run-all-tests tidb-test=pr/646 |
planner/core/expression_rewriter.go
Outdated
expr1 = expression.NewFunctionInternal(er.ctx, ast.EQ, types.NewFieldType(mysql.TypeTiny), expr1, expression.Zero) | ||
expr2 = expression.Zero | ||
} else if op == ast.LT || op == ast.GT { | ||
if op == ast.LT || op == ast.GT || op == ast.LE || op == ast.GE { |
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.
This check can be removed?
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.
Is there any other operator?
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.
I'm not really sure about this.
But expr1 and expr2 will be used out of this check block,
if there are other operators, it may cause unexpected errors.
You may be better to confirm it.
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.
ok
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.
@XuHuaiyu addressed
/run-all-tests |
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.
LGTM
PTAL @zz-jason |
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.
LGTM
What problem does this PR solve?
Row compare logic fixed before in #8241 did not cover some case like
<=
and>=
.For example, in TiDB:
MySQL:
What is changed and how it works?
Replace old compare logic of
<=
and>=
operator with new compare logic.Check List
Tests
Side effects
Related changes