-
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
expression: fix incorrect result of logical operators when isTrue/ isFalse function is pushed down #15926
Conversation
Codecov Report
@@ Coverage Diff @@
## master #15926 +/- ##
===========================================
Coverage 80.3437% 80.3437%
===========================================
Files 506 506
Lines 136618 136618
===========================================
Hits 109764 109764
Misses 18276 18276
Partials 8578 8578 |
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
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
/merge |
Your auto merge job has been accepted, waiting for 15907, 15845, 15758, 15956, 15776, 15889 |
/run-all-tests |
@Reminiscent merge failed. |
@Reminiscent CI failed, please check it. |
Is this expectant? [2020-04-16T06:33:09.000Z] FAIL: const_test.go:180: testMySQLConstSuite.TestHighNotPrecedenceMode
[2020-04-16T06:33:09.000Z]
[2020-04-16T06:33:09.000Z] const_test.go:191:
[2020-04-16T06:33:09.000Z] r = tk.MustQuery(`SELECT * FROM t1 WHERE NOT a BETWEEN 2 AND 3;`)
[2020-04-16T06:33:09.000Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2@2/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:288:
[2020-04-16T06:33:09.000Z] tk.c.Check(err, check.IsNil, comment)
[2020-04-16T06:33:09.000Z] ... value *errors.fundamental = runtime error: invalid memory address or nil pointer dereference ("runtime error: invalid memory address or nil pointer dereference")
[2020-04-16T06:33:09.000Z] ... sql:SELECT * FROM t1 WHERE NOT a BETWEEN 2 AND 3;, args:[] |
[2020-04-16T09:05:14.887Z] PANIC: distsql_builtin_test.go:159: testEvalSuite.TestEval
[2020-04-16T09:05:14.887Z]
[2020-04-16T09:05:14.887Z] ... Panic: interface conversion: proto.Message is nil, not *tipb.InUnionMetadata (PC=0xFAA711)
[2020-04-16T09:05:14.887Z]
[2020-04-16T09:05:14.887Z] /usr/local/go/src/runtime/panic.go:679
[2020-04-16T09:05:14.887Z] in gopanic
[2020-04-16T09:05:14.887Z] /usr/local/go/src/runtime/iface.go:255
[2020-04-16T09:05:14.887Z] in panicdottypeE
[2020-04-16T09:05:14.887Z] /usr/local/go/src/runtime/iface.go:265
[2020-04-16T09:05:14.887Z] in panicdottypeI
[2020-04-16T09:05:14.887Z] distsql_builtin.go:74
[2020-04-16T09:05:14.887Z] in getSignatureByPB
[2020-04-16T09:05:14.887Z] distsql_builtin.go:1056
[2020-04-16T09:05:14.887Z] in newDistSQLFunctionBySig
[2020-04-16T09:05:14.887Z] distsql_builtin.go:1138
[2020-04-16T09:05:14.887Z] in PBToExpr
[2020-04-16T09:05:14.887Z] distsql_builtin_test.go:856
[2020-04-16T09:05:14.887Z] in testEvalSuite.TestEval
[2020-04-16T09:05:14.887Z] /usr/local/go/src/reflect/value.go:321
[2020-04-16T09:05:14.887Z] in Value.Call
[2020-04-16T09:05:14.887Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2@2/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:850
[2020-04-16T09:05:14.887Z] in suiteRunner.forkTest.func1
[2020-04-16T09:05:14.887Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2@2/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739
[2020-04-16T09:05:14.887Z] in suiteRunner.forkCall.func1
[2020-04-16T09:05:14.887Z] /usr/local/go/src/runtime/asm_amd64.s:1357
[2020-04-16T09:05:14.887Z] in goexit |
@XuHuaiyu @breeswish PTAL. Thanks! |
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
/merge |
/run-all-tests |
/run-all-tests |
@Reminiscent merge failed. |
Do we need to fix at TiKV side as well? Otherwise the results will be different so that copr-test will fail. |
After an offline discussion, we decided to use another method to solve this problem. We will close this PR and reopen a new one. |
What problem does this PR solve?
Close: #15718 #15987
Related PR: #12173
Need to review TiPB176 first
Related to #13962
What is changed and how it works?
See an example of this comment
Before this PR:
After this PR:
The cause of this problem is that when the order by expression in the
topN
executor islogicalAnd
orlogicalOr
,keepNull
should be set to true when thetopN
executor is pushed down.Check List
Tests