Skip to content

Commit 09bd0c7

Browse files
committed
Fix “histogram” rule by adding missing “USING DATA” clause
1 parent cd3c335 commit 09bd0c7

File tree

5 files changed

+48
-170
lines changed

5 files changed

+48
-170
lines changed

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

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14848,6 +14848,17 @@
1484814848
]
1484914849
]
1485014850
},
14851+
{
14852+
"name": "%histogram05_zero_or_one",
14853+
"bnf": [
14854+
[
14855+
"%histogram05"
14856+
],
14857+
[
14858+
"\u03b5"
14859+
]
14860+
]
14861+
},
1485114862
{
1485214863
"name": "histogram",
1485314864
"bnf": [
@@ -14856,7 +14867,8 @@
1485614867
"HISTOGRAM_SYMBOL",
1485714868
"ON_SYMBOL",
1485814869
"identifierList",
14859-
"%histogram04_zero_or_one"
14870+
"%histogram04_zero_or_one",
14871+
"%histogram05_zero_or_one"
1486014872
],
1486114873
[
1486214874
"DROP_SYMBOL",
@@ -14887,6 +14899,27 @@
1488714899
]
1488814900
]
1488914901
},
14902+
{
14903+
"name": "%histogram05_zero_or_one",
14904+
"bnf": [
14905+
[
14906+
"%histogram05"
14907+
],
14908+
[
14909+
"\u03b5"
14910+
]
14911+
]
14912+
},
14913+
{
14914+
"name": "%histogram05",
14915+
"bnf": [
14916+
[
14917+
"USING_SYMBOL",
14918+
"DATA_SYMBOL",
14919+
"textStringLiteral"
14920+
]
14921+
]
14922+
},
1489014923
{
1489114924
"name": "checkOption",
1489214925
"bnf": [

custom-parser/grammar-factoring/MySQLParser.g4

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2077,11 +2077,22 @@ tableAdministrationStatement:
20772077
| type = REPAIR_SYMBOL noWriteToBinLog? (TABLE_SYMBOL | TABLES_SYMBOL) tableRefList repairType*
20782078
;
20792079

2080-
histogram:
2080+
/*histogram:
20812081
UPDATE_SYMBOL HISTOGRAM_SYMBOL ON_SYMBOL identifierList (
20822082
WITH_SYMBOL INT_NUMBER BUCKETS_SYMBOL
20832083
)?
20842084
| DROP_SYMBOL HISTOGRAM_SYMBOL ON_SYMBOL identifierList
2085+
;*/
2086+
2087+
/*
2088+
* @FIX:
2089+
* Add missing optional "USING DATA 'json_data'" to UPDATE HISTOGRAM clause.
2090+
*/
2091+
histogram:
2092+
UPDATE_SYMBOL HISTOGRAM_SYMBOL ON_SYMBOL identifierList (
2093+
WITH_SYMBOL INT_NUMBER BUCKETS_SYMBOL
2094+
)? (USING_SYMBOL DATA_SYMBOL textStringLiteral)?
2095+
| DROP_SYMBOL HISTOGRAM_SYMBOL ON_SYMBOL identifierList
20852096
;
20862097

20872098
checkOption:

custom-parser/parser/grammar.php

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

0 commit comments

Comments
 (0)