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

executor, session, sessionctx: fix the error message of read-only variable is corrupted #21948

Merged
merged 5 commits into from
Dec 23, 2020

Conversation

TszKitLo40
Copy link
Contributor

@TszKitLo40 TszKitLo40 commented Dec 22, 2020

What problem does this PR solve?

Issue Number: close #21944

Problem Summary:

What is changed and how it works?

What's Changed:
fix the error message of read-only variable is corrupted
How it Works:
format the error message when read-only variable is set

Check List

Tests

  • Integration test

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM
  • Breaking backward compatibility

Release note

  • No release note

@TszKitLo40
Copy link
Contributor Author

PTAL @bb7133

@morgo morgo self-requested a review December 22, 2020 16:25
@morgo
Copy link
Contributor

morgo commented Dec 22, 2020

LGTM (See suggestion)

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 22, 2020
func (s *testSessionSerialSuite) TestIssue21944(c *C) {
tk1 := testkit.NewTestKitWithInit(c, s.store)
_, err := tk1.Exec("set @@tidb_current_ts=1;")
c.Assert(err.Error(), Equals, "[variable:1621]tidb_current_ts variable 'tidb_current_ts' is read-only. Use SET tidb_current_ts to assign the value")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is different from the expected error message described in #21944

@ichn-hu ichn-hu mentioned this pull request Dec 22, 2020
@TszKitLo40
Copy link
Contributor Author

PTAL @SunRunAway @morgo

sessionctx/variable/sysvar.go Show resolved Hide resolved
sessionctx/variable/sysvar.go Outdated Show resolved Hide resolved
@TszKitLo40 TszKitLo40 requested a review from a team as a code owner December 23, 2020 03:17
@TszKitLo40 TszKitLo40 requested review from XuHuaiyu and removed request for a team December 23, 2020 03:17
@TszKitLo40 TszKitLo40 changed the title session, sessionctx: fix the error message of read-only variable is corrupted executor, session, sessionctx: fix the error message of read-only variable is corrupted Dec 23, 2020
@github-actions github-actions bot added the sig/execution SIG execution label Dec 23, 2020
@morgo
Copy link
Contributor

morgo commented Dec 23, 2020

LGTM

@ti-srebot
Copy link
Contributor

@morgo, Thanks for your review. The bot only counts LGTMs from Reviewers and higher roles, but you're still welcome to leave your comments. See the corresponding SIG page for more information. Related SIG: execution(slack).

@XuHuaiyu XuHuaiyu added the type/bugfix This PR fixes a bug. label Dec 23, 2020
Copy link
Member

@wjhuang2016 wjhuang2016 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/LGT1 Indicates that a PR has LGTM 1. label Dec 23, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Dec 23, 2020
@wjhuang2016
Copy link
Member

/merge

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

/run-all-tests

@ti-srebot ti-srebot merged commit 5aebcee into pingcap:master Dec 23, 2020
Tjianke pushed a commit to Tjianke/tidb that referenced this pull request Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution 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.

The error message of read-only variable is corrupted
6 participants