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: properly escape backquotes in identifiers in SHOW CREATE TABLE #8302

Merged
merged 4 commits into from
Nov 14, 2018

Conversation

kennytm
Copy link
Contributor

@kennytm kennytm commented Nov 13, 2018

What problem does this PR solve?

Fix #8259.

What is changed and how it works?

Added a method which properly escapes and doubles the backquotes in an identifier ("foo`bar""`foo``bar`")

In the implementation of SHOW CREATE TABLE and SHOW CREATE DATABASE, we replaced all usages of fmt.Sprintf("`%s`", stuff.Name.O) into escape(stuff.Name, sqlMode).

Check List

Tests

Code changes

Side effects

Related changes

@kennytm kennytm added type/bugfix This PR fixes a bug. sig/execution SIG execution and removed status/DNM labels Nov 13, 2018
@kennytm
Copy link
Contributor Author

kennytm commented Nov 14, 2018

/run-all-tests

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 14, 2018
@kennytm
Copy link
Contributor Author

kennytm commented Nov 14, 2018

/run-integration-ddl-test

@kennytm
Copy link
Contributor Author

kennytm commented Nov 14, 2018

(The "integration-ddl-test" failed previously in run 4106, which seems to be spurious. The re-run at run 4109 passed)

Copy link
Contributor

@winkyao winkyao left a comment

Choose a reason for hiding this comment

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

LGTM

@kennytm kennytm added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 14, 2018
@zz-jason zz-jason merged commit f88db4f into pingcap:master Nov 14, 2018
@zz-jason
Copy link
Member

@kennytm we should cherry pick this change to release-2.1 and release-2.0 branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution 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.

4 participants