-
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
builtin: logic op not compatibility with float #11587
Conversation
Hi contributor, thanks for your PR. This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically. |
According to my test,mysql will convert args of logic operato to float64.(not read the mysql source code) convert '1e-324' to float64 is 0. "0 or null" is null. |
6ae55c6
to
9b34b0f
Compare
Codecov Report
@@ Coverage Diff @@
## master #11587 +/- ##
===========================================
Coverage 81.4299% 81.4299%
===========================================
Files 452 452
Lines 97194 97194
===========================================
Hits 79145 79145
Misses 12394 12394
Partials 5655 5655 |
@jingyugao Thanks for your contribution, and we will review this PR soon. |
At last I use sed to add |
By the way, this change fix a bug about
because tidb convert 0.1 to 0. |
@jingyugao Could you merge the master branch and resolve conflicts? |
Signed-off-by: jingyugao <[email protected]>
b8a90be
to
ce04a0b
Compare
Signed-off-by: jingyugao <[email protected]>
82239d6
to
4fa6acf
Compare
@@ -37,8 +37,10 @@ var ( | |||
) | |||
|
|||
var ( | |||
_ builtinFunc = &builtinLogicAndSig{} | |||
_ builtinFunc = &builtinLogicOrSig{} | |||
_ builtinFunc = &builtinIntLogicAndSig{} |
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.
Do we have to remove ast.And
and ast.Or
from canFuncBePushed
since the implementation of these two functions are not consistent with TiKV
now?
What's your opinion @XuHuaiyu ?
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 refer to this pr, #10498 . ShouId keep the builtinLogicAndSig
signature compatible to tiKV?
@jingyugao Sorry for my late reply, this issue seems fixed by this PR/12173. |
sorry, too. busy these days. |
Signed-off-by: jingyugao [email protected]
What problem does this PR solve?
#11552
logic operate not compatibility with float.
What is changed and how it works?
Make logic op cast args to real instead of int.
convert 0.1 to int will be 0, "0 or null" is null.
convert 0.1 to float will be 0.1, "0.1 or null" is 1.
Check List
Tests
add unit test
Code changes
changed in function body
Side effects
no
Related changes
no