Skip to content

*: redact arguments for Error (#1051)#1083

Merged
crazycs520 merged 1 commit intorelease-4.0from
cherry-pick1051
Nov 10, 2020
Merged

*: redact arguments for Error (#1051)#1083
crazycs520 merged 1 commit intorelease-4.0from
cherry-pick1051

Conversation

@lonng
Copy link
Contributor

@lonng lonng commented Nov 10, 2020

Cherry-pick #1051


What problem does this PR solve?

part of pingcap/tidb#18566

What is changed and how it works?

  • changes in "github.com/pingcap/errors" Redact arguments for Error errors#27
    • redact errors in Error.GenWithStackByArgs & Error.FastGenByArgs
  • changes in "github.com/pingcap/parser" *: redact arguments for Error #1051
    • define mysql.Message to bind redactArgs which means which arguments of the error need to be redacted with each error message
    • MySQLErrName should be defined with mysql.Message.
    • ErrClass.NewStd considers redactArgs
    • All errors uses ErrClass.NewStd or mysql.Message to consider error redaction
  • changes in "github.com/pingcap/tidb" *: redact arguments for Error tidb#20436
    • inherit ErrClass.NewStd
    • All errors uses ErrClass.NewStd or mysql.Message to consider error redaction

Check List

Tests

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

Code changes

  • Has exported function/method change

Copy link
Contributor

@crazycs520 crazycs520 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 LGT1 label Nov 10, 2020
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
Copy link
Contributor

@SunRunAway, 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: ddl(slack).

@crazycs520 crazycs520 merged commit 77ed358 into release-4.0 Nov 10, 2020
@lonng lonng deleted the cherry-pick1051 branch November 10, 2020 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants