From ef0cc670ba9358610ae7a38b130b0d06574c17b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Tue, 2 Jul 2024 07:43:44 +0200 Subject: [PATCH 1/4] Update EBNF for password options --- sql-statements/sql-statement-create-user.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sql-statements/sql-statement-create-user.md b/sql-statements/sql-statement-create-user.md index 39ef112943a66..8880acc28a760 100644 --- a/sql-statements/sql-statement-create-user.md +++ b/sql-statements/sql-statement-create-user.md @@ -21,8 +21,8 @@ UserSpecList ::= UserSpec ( ',' UserSpec )* RequireClauseOpt ::= - ( 'REQUIRE' 'NONE' | 'REQUIRE' 'SSL' | 'REQUIRE' 'X509' | 'REQUIRE' RequireList )? - + ( 'REQUIRE' 'NONE' | 'REQUIRE' 'SSL' | 'REQUIRE' 'X509' | 'REQUIRE' RequireList )? + RequireList ::= ( "ISSUER" stringLit | "SUBJECT" stringLit | "CIPHER" stringLit | "SAN" stringLit | "TOKEN_ISSUER" stringLit )* @@ -36,7 +36,12 @@ StringName ::= stringLit | Identifier -PasswordOption ::= ( 'PASSWORD' 'EXPIRE' ( 'DEFAULT' | 'NEVER' | 'INTERVAL' N 'DAY' )? | 'PASSWORD' 'HISTORY' ( 'DEFAULT' | N ) | 'PASSWORD' 'REUSE' 'INTERVAL' ( 'DEFAULT' | N 'DAY' ) | 'FAILED_LOGIN_ATTEMPTS' N | 'PASSWORD_LOCK_TIME' ( N | 'UNBOUNDED' ) )* +PasswordOption ::= ( 'PASSWORD' 'EXPIRE' ( 'DEFAULT' | 'NEVER' | 'INTERVAL' N 'DAY' )? +| 'PASSWORD' 'HISTORY' ( 'DEFAULT' | N ) +| 'PASSWORD' 'REUSE' 'INTERVAL' ( 'DEFAULT' | N 'DAY' ) +| 'PASSWORD' 'REQUIRE' 'CURRENT' 'DEFAULT' +| 'FAILED_LOGIN_ATTEMPTS' N +| 'PASSWORD_LOCK_TIME' ( N | 'UNBOUNDED' ) )* LockOption ::= ( 'ACCOUNT' 'LOCK' | 'ACCOUNT' 'UNLOCK' )? @@ -162,7 +167,12 @@ SELECT USER, HOST, USER_ATTRIBUTES FROM MYSQL.USER WHERE USER='newuser7'; The following `CREATE USER` options are not yet supported by TiDB, and will be parsed but ignored: * TiDB does not support `WITH MAX_QUERIES_PER_HOUR`, `WITH MAX_UPDATES_PER_HOUR`, and `WITH MAX_USER_CONNECTIONS` options. +* TiDB does not support `PASSWORD REQUIRE CURRENT DEFAULT`. + +In addition to that these options are also not supported by TiDB, and are *not* accepted by the parser: + * TiDB does not support the `DEFAULT ROLE` option. +* TiDB does not support `PASSWORD REQUIRE CURRENT OPTIONAL`. ## See also From b50dc69a5599f02a1f8e85decbcd0a670772947e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Tue, 2 Jul 2024 08:54:48 +0200 Subject: [PATCH 2/4] Update sql-statements/sql-statement-create-user.md Co-authored-by: Grace Cai --- sql-statements/sql-statement-create-user.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql-statements/sql-statement-create-user.md b/sql-statements/sql-statement-create-user.md index 8880acc28a760..6ea036c612106 100644 --- a/sql-statements/sql-statement-create-user.md +++ b/sql-statements/sql-statement-create-user.md @@ -169,10 +169,10 @@ The following `CREATE USER` options are not yet supported by TiDB, and will be p * TiDB does not support `WITH MAX_QUERIES_PER_HOUR`, `WITH MAX_UPDATES_PER_HOUR`, and `WITH MAX_USER_CONNECTIONS` options. * TiDB does not support `PASSWORD REQUIRE CURRENT DEFAULT`. -In addition to that these options are also not supported by TiDB, and are *not* accepted by the parser: +The following `CREATE USER` options are also not supported by TiDB, and are *not* accepted by the parser: -* TiDB does not support the `DEFAULT ROLE` option. -* TiDB does not support `PASSWORD REQUIRE CURRENT OPTIONAL`. +* `DEFAULT ROLE` +* `PASSWORD REQUIRE CURRENT OPTIONAL` ## See also From c7f79031599570bce66f0d8ca93598f018c6b1ee Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Tue, 2 Jul 2024 14:56:34 +0800 Subject: [PATCH 3/4] adjust the format --- sql-statements/sql-statement-create-user.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sql-statements/sql-statement-create-user.md b/sql-statements/sql-statement-create-user.md index 6ea036c612106..1b962646decaf 100644 --- a/sql-statements/sql-statement-create-user.md +++ b/sql-statements/sql-statement-create-user.md @@ -166,8 +166,10 @@ SELECT USER, HOST, USER_ATTRIBUTES FROM MYSQL.USER WHERE USER='newuser7'; The following `CREATE USER` options are not yet supported by TiDB, and will be parsed but ignored: -* TiDB does not support `WITH MAX_QUERIES_PER_HOUR`, `WITH MAX_UPDATES_PER_HOUR`, and `WITH MAX_USER_CONNECTIONS` options. -* TiDB does not support `PASSWORD REQUIRE CURRENT DEFAULT`. +* `PASSWORD REQUIRE CURRENT DEFAULT` +* `WITH MAX_QUERIES_PER_HOUR` +* `WITH MAX_UPDATES_PER_HOUR` +* `WITH MAX_USER_CONNECTIONS` The following `CREATE USER` options are also not supported by TiDB, and are *not* accepted by the parser: From 2558358a3cea250ad72f10b94b8acbe73344ffd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 3 Jul 2024 05:33:53 +0200 Subject: [PATCH 4/4] Update sql-statements/sql-statement-create-user.md Co-authored-by: xixirangrang --- sql-statements/sql-statement-create-user.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-create-user.md b/sql-statements/sql-statement-create-user.md index 1b962646decaf..5ee1ba1f2a4ae 100644 --- a/sql-statements/sql-statement-create-user.md +++ b/sql-statements/sql-statement-create-user.md @@ -171,7 +171,7 @@ The following `CREATE USER` options are not yet supported by TiDB, and will be p * `WITH MAX_UPDATES_PER_HOUR` * `WITH MAX_USER_CONNECTIONS` -The following `CREATE USER` options are also not supported by TiDB, and are *not* accepted by the parser: +The following `CREATE USER` options are not supported by TiDB either, and are *not* accepted by the parser: * `DEFAULT ROLE` * `PASSWORD REQUIRE CURRENT OPTIONAL`