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: Add missing pbcode for functions InetAton/InetNtoa/Inet6Aton/Inet6Ntoa/IsIPv4/IsIPv4Compat/IsIPv4Mapped/IsIPv6. #26939

Merged
merged 12 commits into from
Aug 6, 2021

Conversation

LittleFall
Copy link
Contributor

@LittleFall LittleFall commented Aug 5, 2021

What problem does this PR solve?

Issue Number: close #26942

Problem Summary: some scalar function hasn't pdcode for some reason, so it can't be pushed down as expected.

What is changed and how it works?

Proposal: xxx

What's Changed:

  1. add warnings for functions without pbcode.
  2. add pbcode for some functions.
  3. ban push down to tikv for these functions.
  4. add tests for them.

How it Works:

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 5, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • hanfei1991
  • lzmhhh123

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 5, 2021
@LittleFall
Copy link
Contributor Author

/cc @fuzhe1989

@ti-chi-bot
Copy link
Member

@LittleFall: GitHub didn't allow me to request PR reviews from the following users: fuzhe1989.

Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @fuzhe1989

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot
Copy link
Member

@fuzhe1989: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@LittleFall LittleFall changed the title expression: Add warning when function's pbcode is unexpected unspecified. expression: Add missing pbcode for some functions. Aug 5, 2021
@LittleFall LittleFall added the type/bugfix This PR fixes a bug. label Aug 5, 2021
@LittleFall LittleFall changed the title expression: Add missing pbcode for some functions. expression: Add missing pbcode for functions InetAton/InetNtoa/Inet6Aton/Inet6Ntoa/IsIPv4/IsIPv4Compat/IsIPv4Mapped/IsIPv6. Aug 5, 2021
Comment on lines +1017 to +1020
//jsonColumn := dg.genColumn(mysql.TypeJSON, 1)
//intColumn := dg.genColumn(mysql.TypeLonglong, 2)
//realColumn := dg.genColumn(mysql.TypeDouble, 3)
//decimalColumn := dg.genColumn(mysql.TypeNewDecimal, 4)
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

later will use

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 6, 2021
@LittleFall
Copy link
Contributor Author

/rebuild

@LittleFall LittleFall requested a review from ichn-hu August 6, 2021 07:12
expression/expression.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 6, 2021
@LittleFall
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 94473eb

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 6, 2021
@LittleFall
Copy link
Contributor Author

[2021-08-06T07:22:54.680Z] Using context: idc-jenkins-ci-tidb/check_dev

[2021-08-06T07:22:55.350Z] java.lang.InterruptedException

[2021-08-06T07:22:55.350Z] at java.lang.Object.wait(Native Method)

[2021-08-06T07:22:55.350Z] at java.lang.Object.wait(Object.java:502)

[2021-08-06T07:22:55.350Z] at java.lang.UNIXProcess.waitFor(UNIXProcess.java:395)

[2021-08-06T07:22:55.350Z] at hudson.Proc$LocalProc.join(Proc.java:327)

[2021-08-06T07:22:55.350Z] at hudson.Proc.joinWithTimeout(Proc.java:172)

[2021-08-06T07:22:55.350Z] at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2632)

[2021-08-06T07:22:55.350Z] at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2079)

[2021-08-06T07:22:55.350Z] at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84)

[2021-08-06T07:22:55.350Z] at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:601)

[2021-08-06T07:22:55.350Z] at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:365)

[2021-08-06T07:22:55.350Z] at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:197)

[2021-08-06T07:22:55.350Z] at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:173)

[2021-08-06T07:22:55.350Z] at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:114)

[2021-08-06T07:22:55.350Z] at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:68)

[2021-08-06T07:22:55.350Z] at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:309)

[2021-08-06T07:22:55.350Z] at hudson.model.ResourceController.execute(ResourceController.java:97)

[2021-08-06T07:22:55.350Z] at hudson.model.Executor.run(Executor.java:429)

[2021-08-06T07:22:55.350Z] Finished: FAILURE

@zhouqiang-cl
Copy link
Contributor

CI fails for many times


 FAIL: enforce_mpp_test.go:128: testEnforceMPPSuite.TestEnforceMPPWarning1

[2021-08-06T07:47:41.884Z] 

[2021-08-06T07:47:41.884Z] enforce_mpp_test.go:191:

[2021-08-06T07:47:41.884Z]     c.Assert(s.testData.ConvertSQLWarnToStrings(tk.Se.GetSessionVars().StmtCtx.GetWarnings()), DeepEquals, output[i].Warn)

[2021-08-06T07:47:41.884Z] ... obtained []string = []string{"Scalar function 'is_ipv4'(signature: IsIPv4) can not be pushed to tiflash", "Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs", "Scalar function 'is_ipv4'(signature: IsIPv4) can not be pushed to tiflash", "Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs", "Scalar function 'is_ipv4'(signature: IsIPv4) can not be pushed to tiflash", "Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs"}

[2021-08-06T07:47:41.884Z] ... expected []string = []string{"Scalar function 'is_ipv4'(signature: Unspecified) can not be pushed to tiflash", "Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs", "Scalar function 'is_ipv4'(signature: Unspecified) can not be pushed to tiflash", "Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs", "Scalar function 'is_ipv4'(signature: Unspecified) can not be pushed to tiflash", "Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs"}

in https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_check_2/detail/tidb_ghpr_check_2/23511/pipeline

@LittleFall
Copy link
Contributor Author

/merge

@LittleFall
Copy link
Contributor Author

CI fails for many times


 FAIL: enforce_mpp_test.go:128: testEnforceMPPSuite.TestEnforceMPPWarning1

[2021-08-06T07:47:41.884Z] 

[2021-08-06T07:47:41.884Z] enforce_mpp_test.go:191:

[2021-08-06T07:47:41.884Z]     c.Assert(s.testData.ConvertSQLWarnToStrings(tk.Se.GetSessionVars().StmtCtx.GetWarnings()), DeepEquals, output[i].Warn)

[2021-08-06T07:47:41.884Z] ... obtained []string = []string{"Scalar function 'is_ipv4'(signature: IsIPv4) can not be pushed to tiflash", "Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs", "Scalar function 'is_ipv4'(signature: IsIPv4) can not be pushed to tiflash", "Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs", "Scalar function 'is_ipv4'(signature: IsIPv4) can not be pushed to tiflash", "Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs"}

[2021-08-06T07:47:41.884Z] ... expected []string = []string{"Scalar function 'is_ipv4'(signature: Unspecified) can not be pushed to tiflash", "Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs", "Scalar function 'is_ipv4'(signature: Unspecified) can not be pushed to tiflash", "Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs", "Scalar function 'is_ipv4'(signature: Unspecified) can not be pushed to tiflash", "Aggregation can not be pushed to tiflash because groupByItems contain unsupported exprs"}

in https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_check_2/detail/tidb_ghpr_check_2/23511/pipeline

my code failed, fixed

@LittleFall
Copy link
Contributor Author

[2021-08-06T08:02:11.933Z] + rm -rf /tmp/tidb

[2021-08-06T08:02:11.933Z] + mkdir -p plugin-so

[2021-08-06T08:02:11.933Z] + cp /home/jenkins/agent/workspace/tidb_ghpr_build/go/src/github.com/pingcap/enterprise-plugin/audit/audit-1.so ./plugin-so/

[2021-08-06T08:02:11.933Z] + cp /home/jenkins/agent/workspace/tidb_ghpr_build/go/src/github.com/pingcap/enterprise-plugin/whitelist/whitelist-1.so ./plugin-so/

[2021-08-06T08:02:12.192Z] + sleep 5

[2021-08-06T08:02:12.192Z] + /home/jenkins/agent/workspace/tidb_ghpr_build/go/src/github.com/pingcap/tidb/bin/tidb-server -plugin-dir=/home/jenkins/agent/workspace/tidb_ghpr_build/go/src/github.com/pingcap/tidb/plugin-so -plugin-load=audit-1,whitelist-1

[2021-08-06T08:02:17.453Z] + mysql -h 127.0.0.1 -P 4000 -u root -e 'select tidb_version()'

[2021-08-06T08:02:17.453Z] ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)

@LittleFall
Copy link
Contributor Author

/merge

@ti-chi-bot ti-chi-bot merged commit 4d9473a into pingcap:master Aug 6, 2021
@LittleFall LittleFall deleted the bugfix/warning branch August 6, 2021 08:11
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Aug 6, 2021
@ti-srebot
Copy link
Contributor

cherry pick to release-5.0 in PR #26960

@ti-srebot
Copy link
Contributor

cherry pick to release-5.1 in PR #26961

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression needs-cherry-pick-release-5.0 needs-cherry-pick-release-5.1 release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

builtinFunc InetAton/InetNtoa/Inet6Aton/Inet6Ntoa/IsIPv4/IsIPv4Compat/IsIPv4Mapped/IsIPv6 miss to fill pbCode
9 participants