Skip to content
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: avoid unnecessary warnings/errors when folding constants in shortcut-able expressions #19797

Merged
merged 6 commits into from
Nov 13, 2020

Conversation

fzhedu
Copy link
Contributor

@fzhedu fzhedu commented Sep 4, 2020

What problem does this PR solve?

Issue Number: close #17725

Problem Summary: following #19675, avoid unnecessary warnings/errors when folding constants in shortcut-able expressions

What is changed and how it works?

Proposal: xxx

What's Changed:

How it Works:

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

Release note

  • avoid unnecessary warnings/errors when folding constants in shortcut-able expressions

@fzhedu
Copy link
Contributor Author

fzhedu commented Sep 18, 2020

/run-check_dev_2

Copy link
Contributor

@wshwsh12 wshwsh12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 22, 2020
Copy link
Contributor

@lzmhhh123 lzmhhh123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 22, 2020
ti-srebot
ti-srebot previously approved these changes Sep 22, 2020
@lzmhhh123
Copy link
Contributor

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 22, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@fzhedu merge failed.

@qw4990
Copy link
Contributor

qw4990 commented Sep 22, 2020

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@fzhedu merge failed.

@fzhedu
Copy link
Contributor Author

fzhedu commented Sep 24, 2020

/rebuild

1 similar comment
@fzhedu
Copy link
Contributor Author

fzhedu commented Sep 24, 2020

/rebuild

@fzhedu
Copy link
Contributor Author

fzhedu commented Sep 24, 2020

/merge

@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 20175
  • 20108

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@fzhedu merge failed.

@fzhedu
Copy link
Contributor Author

fzhedu commented Sep 27, 2020

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@zz-jason
Copy link
Member

zz-jason commented Oct 4, 2020

@fzhedu please fix the failed UT:

[2020-10-04T05:42:22.034Z] PANIC: binloginfo_test.go:507: testBinlogSuite.TestDeleteSchema
[2020-10-04T05:42:22.035Z]
[2020-10-04T05:42:22.035Z] ... Panic: runtime error: index out of range [-1] (PC=0x12288D1)
[2020-10-04T05:42:22.035Z]
[2020-10-04T05:42:22.035Z] /usr/local/go/src/runtime/panic.go:679
[2020-10-04T05:42:22.035Z]   in gopanic
[2020-10-04T05:42:22.035Z] /usr/local/go/src/runtime/panic.go:75
[2020-10-04T05:42:22.035Z]   in goPanicIndex
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/src/github.com/pingcap/tidb/planner/core/expression_rewriter.go:1200
[2020-10-04T05:42:22.035Z]   in expressionRewriter.binaryOpToExpression
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/src/github.com/pingcap/tidb/planner/core/expression_rewriter.go:991
[2020-10-04T05:42:22.035Z]   in expressionRewriter.Leave
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/pkg/mod/github.com/pingcap/parser@v0.0.0-20200929032957-9678b2b7cefb/ast/expressions.go:217
[2020-10-04T05:42:22.035Z]   in BinaryOperationExpr.Accept
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/src/github.com/pingcap/tidb/planner/core/expression_rewriter.go:185
[2020-10-04T05:42:22.035Z]   in PlanBuilder.rewriteExprNode
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/src/github.com/pingcap/tidb/planner/core/expression_rewriter.go:133
[2020-10-04T05:42:22.035Z]   in PlanBuilder.rewriteWithPreprocess
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/src/github.com/pingcap/tidb/planner/core/expression_rewriter.go:101
[2020-10-04T05:42:22.035Z]   in PlanBuilder.rewrite
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/src/github.com/pingcap/tidb/planner/core/logical_plan_builder.go:830
[2020-10-04T05:42:22.035Z]   in PlanBuilder.buildSelection
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/src/github.com/pingcap/tidb/planner/core/logical_plan_builder.go:3834
[2020-10-04T05:42:22.035Z]   in PlanBuilder.buildDelete
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/src/github.com/pingcap/tidb/planner/core/planbuilder.go:570
[2020-10-04T05:42:22.035Z]   in PlanBuilder.Build
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/src/github.com/pingcap/tidb/planner/optimize.go:215
[2020-10-04T05:42:22.035Z]   in optimize
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/src/github.com/pingcap/tidb/planner/optimize.go:114
[2020-10-04T05:42:22.035Z]   in Optimize
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/src/github.com/pingcap/tidb/executor/compiler.go:62
[2020-10-04T05:42:22.035Z]   in Compiler.Compile
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/src/github.com/pingcap/tidb/session/session.go:1155
[2020-10-04T05:42:22.035Z]   in session.ExecuteStmt
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:161
[2020-10-04T05:42:22.035Z]   in TestKit.Exec
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:207
[2020-10-04T05:42:22.035Z]   in TestKit.MustExec
[2020-10-04T05:42:22.035Z] binloginfo_test.go:517
[2020-10-04T05:42:22.035Z]   in testBinlogSuite.TestDeleteSchema
[2020-10-04T05:42:22.035Z] /usr/local/go/src/reflect/value.go:321
[2020-10-04T05:42:22.035Z]   in Value.Call
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:850
[2020-10-04T05:42:22.035Z]   in suiteRunner.forkTest.func1
[2020-10-04T05:42:22.035Z] /home/jenkins/agent/workspace/tidb_ghpr_check_2/go/pkg/mod/github.com/pingcap/check@v0.0.0-20200212061837-5e12011dc712/check.go:739
[2020-10-04T05:42:22.035Z]   in suiteRunner.forkCall.func1
[2020-10-04T05:42:22.035Z] /usr/local/go/src/runtime/asm_amd64.s:1357
[2020-10-04T05:42:22.035Z]   in goexit

@zz-jason zz-jason added status/require-change and removed status/can-merge Indicates a PR has been approved by a committer. labels Nov 12, 2020
@fzhedu
Copy link
Contributor Author

fzhedu commented Nov 13, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 13, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@fzhedu
Copy link
Contributor Author

fzhedu commented Nov 13, 2020

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

/run-all-tests

Copy link
Contributor

@SunRunAway SunRunAway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-srebot ti-srebot removed the status/LGT2 Indicates that a PR has LGTM 2. label Nov 13, 2020
@ti-srebot ti-srebot added the status/LGT3 The PR has already had 3 LGTM. label Nov 13, 2020
@SunRunAway SunRunAway merged commit 6e3d2ec into pingcap:master Nov 13, 2020
@fzhedu
Copy link
Contributor Author

fzhedu commented Nov 13, 2020

/run-cherry-picker

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Nov 13, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #21040

ti-srebot added a commit that referenced this pull request Nov 13, 2020
…in shortcut-able expressions (#19797) (#21040)

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression status/can-merge Indicates a PR has been approved by a committer. status/LGT3 The PR has already had 3 LGTM.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

expression: short-cut expressions cause unnecessary warnings, which even causes errors in update statements.
7 participants