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

parser,ast: Support for authentication plugins #1236

Merged
merged 1 commit into from
Jun 7, 2021

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented Jun 1, 2021

What problem does this PR solve?

Required changes to support authentication plugins in CREATE USER statements.

What is changed and how it works?

  • This puts the authentication plugin in ast.AuthOption.AuthPlugin
  • This also fixes support for hex literals for HashString. This improves MySQL compatibility and makes it easier to use with caching_sha2_password which can contain non-ASCII/non-printable characters.

Note that the IDENTIFIED BY PASSWORD <HashString> is still excepted, but when restoring this this gets rewritten as IDENTIFIED BY 'mysql_native_password' AS <HashString>. The former is no longer supported by MySQL 8.0.

Check List

Tests

  • Unit test

Code changes

  • Has exported variable/fields change

Side effects

  • Increased code complexity

Note that this is based on top of:

This is needed for pingcap/tidb#24991 to be able to support CREATE USER statements that create users with caching_sha2_password support.

@dveeden dveeden requested a review from morgo June 1, 2021 10:44
@dveeden dveeden changed the title Auth plugin parser,ast: Support for authentication plugins Jun 1, 2021
@dveeden dveeden requested a review from tiancaiamao June 1, 2021 10:46
@dveeden dveeden marked this pull request as ready for review June 1, 2021 10:48
@morgo
Copy link
Contributor

morgo commented Jun 1, 2021

/LGTM

@ti-srebot ti-srebot added the status/LGT1 LGT1 label Jun 1, 2021
@dveeden dveeden mentioned this pull request Jun 1, 2021
@tiancaiamao
Copy link
Collaborator

#1232 is merged, please update master for this one @dveeden

@tiancaiamao
Copy link
Collaborator

rest LGTM

@dveeden
Copy link
Contributor Author

dveeden commented Jun 3, 2021

@morgo @tiancaiamao PTAL

@dveeden
Copy link
Contributor Author

dveeden commented Jun 7, 2021

@tiancaiamao could you have another look?

@tiancaiamao
Copy link
Collaborator

/LGTM

@ti-srebot ti-srebot removed the status/LGT1 LGT1 label Jun 7, 2021
@ti-srebot ti-srebot added the status/LGT2 LGT2 label Jun 7, 2021
@tiancaiamao tiancaiamao merged commit 90e8102 into pingcap:master Jun 7, 2021
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