Skip to content

Commit 8f54a3f

Browse files
committed
Fix "userIdentifierOrText" to support omitting sequence after "@"
1 parent 9bdd088 commit 8f54a3f

File tree

5 files changed

+23
-12
lines changed

5 files changed

+23
-12
lines changed

custom-parser/grammar-factoring/MySQLParser-factored-versioned.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28047,6 +28047,17 @@
2804728047
]
2804828048
]
2804928049
},
28050+
{
28051+
"name": "textOrIdentifier_zero_or_one",
28052+
"bnf": [
28053+
[
28054+
"textOrIdentifier"
28055+
],
28056+
[
28057+
"\u03b5"
28058+
]
28059+
]
28060+
},
2805028061
{
2805128062
"name": "%userIdentifierOrText01_zero_or_one",
2805228063
"bnf": [
@@ -28063,7 +28074,7 @@
2806328074
"bnf": [
2806428075
[
2806528076
"AT_SIGN_SYMBOL",
28066-
"textOrIdentifier"
28077+
"textOrIdentifier_zero_or_one"
2806728078
],
2806828079
[
2806928080
"AT_TEXT_SUFFIX"

custom-parser/grammar-factoring/MySQLParser.g4

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3994,8 +3994,16 @@ replacePassword:
39943994
REPLACE_SYMBOL textString
39953995
;
39963996

3997-
userIdentifierOrText:
3997+
/*userIdentifierOrText:
39983998
textOrIdentifier (AT_SIGN_SYMBOL textOrIdentifier | AT_TEXT_SUFFIX)?
3999+
;*/
4000+
4001+
/*
4002+
* @FIX:
4003+
* Fix "userIdentifierOrText" to support omitting sequence after "@".
4004+
*/
4005+
userIdentifierOrText:
4006+
textOrIdentifier (AT_SIGN_SYMBOL textOrIdentifier? | AT_TEXT_SUFFIX)?
39994007
;
40004008

40014009
user:

custom-parser/parser/grammar.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/parser/data/failures.csv

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,7 @@ fid INTEGER NOT NULL PRIMARY KEY,
288288
name CHARACTER VARYING(64),
289289
boundary POLYGON)"
290290
"CREATE TABLE t1 (g GEOMCOLLECTION)"
291-
"create user mysqltest_7@"
292291
"alter user mysqltest_7@ identified by 'systpass'"
293-
"show grants for mysqltest_7@"
294-
"drop user mysqltest_7@"
295-
"grant select on mysqltest.* to mysqltest_8@"
296-
"show grants for mysqltest_8@"
297292
"CREATE TEMPORARY TABLE t6(a INT) ENGINE = MERGE UNION = ()"
298293
"ALTER TABLE t6 UNION = ()"
299294
"ALTER TABLE mysqltest_db2.t2_2 UNION = ()"
@@ -848,9 +843,6 @@ WHERE t1.i <= SOME ( SELECT 8 UNION SELECT 3 ) ) )"
848843
"SELECT JSON_VALUE('{""data"": ""2019-01-01 11:11::11""}', '$.data' RETURNING DATETIME) AS v"
849844
"SELECT JSON_VALUE('{""data"": ""2019-01/01""}', '$.data' RETURNING DATE) AS v"
850845
"SELECT JSON_VALUE('{""data"": ""10:11:12.098700 ""}', '$.data' RETURNING TIME) AS v"
851-
"CREATE USER user1@"
852-
"GRANT UPDATE (a) ON t1 TO user1@"
853-
"DROP USER user1@"
854846
"create trigger t1_whoupdated before update on t1 for each row
855847
begin
856848
declare user varchar(32);

tests/parser/data/stats.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Total: 69524 | Failures: 350 / 0% | Exceptions: 0 / 0%
1+
Total: 69524 | Failures: 342 / 0% | Exceptions: 0 / 0%

0 commit comments

Comments
 (0)