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

planner: make unsafe substitute can be used in generated column #37779

Merged
merged 6 commits into from
Sep 16, 2022

Conversation

xiongjiwei
Copy link
Contributor

@xiongjiwei xiongjiwei commented Sep 13, 2022

Signed-off-by: xiongjiwei [email protected]

What problem does this PR solve?

Issue Number: close #35490

Problem Summary:

What is changed and how it works?

add a system variable tidb_enable_unsafe_substitute, it controls if a string type generate column can be substituted by an expression even if the expression's length is not the same as the column definition.
use this variable has a chance to query the wrong result, the user should guarantee they do not break the table column constraint.
for more detail, see #35490 (comment)

Check List

Tests

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

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

add a system variable `tidb_enable_unsafe_substitute` to control if an expression can be substituted by a column unsafely

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 13, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • wjhuang2016
  • xuyifangreeneyes

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 13, 2022
@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Sep 13, 2022
@xiongjiwei xiongjiwei force-pushed the gcol-unsafe branch 2 times, most recently from c99e006 to 976344e Compare September 13, 2022 08:46
@xiongjiwei xiongjiwei changed the title planner: unsafe substitute planner: make unsafe substitute can be used in generated column Sep 13, 2022
@xiongjiwei xiongjiwei marked this pull request as ready for review September 13, 2022 09:05
@xiongjiwei xiongjiwei requested a review from a team as a code owner September 13, 2022 09:05
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 13, 2022
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 14, 2022
Copy link
Contributor

@xuyifangreeneyes xuyifangreeneyes left a comment

Choose a reason for hiding this comment

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

rest LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 14, 2022
Signed-off-by: xiongjiwei <[email protected]>
Signed-off-by: xiongjiwei <[email protected]>
Signed-off-by: xiongjiwei <[email protected]>
Signed-off-by: xiongjiwei <[email protected]>
@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 Sep 14, 2022
Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

@xiongjiwei
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: b6eb75e

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 16, 2022
@ti-chi-bot ti-chi-bot merged commit 20d46c2 into pingcap:master Sep 16, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Sep 16, 2022

TiDB MergeCI notify

🔴 Bad News! [2] CI still failing after this pr merged.
These failed integration tests don't seem to be introduced by the current PR.

CI Name Result Duration Compare with Parent commit
idc-jenkins-ci-tidb/common-test 🔴 failed 1, success 10, total 11 52 min Existing failure
idc-jenkins-ci-tidb/integration-ddl-test 🔴 failed 1, success 5, total 6 22 min Existing failure
idc-jenkins-ci/integration-cdc-test 🟢 all 37 tests passed 27 min Existing passed
idc-jenkins-ci-tidb/integration-common-test 🟢 all 17 tests passed 8 min 41 sec Existing passed
idc-jenkins-ci-tidb/tics-test 🟢 all 1 tests passed 5 min 38 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-2 🟢 all 28 tests passed 4 min 9 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-1 🟢 all 26 tests passed 3 min 47 sec Existing passed
idc-jenkins-ci-tidb/mybatis-test 🟢 all 1 tests passed 3 min 18 sec Existing passed
idc-jenkins-ci-tidb/integration-compatibility-test 🟢 all 1 tests passed 3 min 3 sec Existing passed
idc-jenkins-ci-tidb/plugin-test 🟢 build success, plugin test success 4min Existing passed

@xiongjiwei xiongjiwei deleted the gcol-unsafe branch September 23, 2022 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generated columns index replacement rule not support JSON functions like MySQL
6 participants