Skip to content

Commit 4018703

Browse files
committed
Add support for SHOW SETTING (singular) query
Add ShowSetting as a separate ShowType from ShowSettings (plural). When parsing SHOW queries, detect "SETTING" as an IDENT and set the appropriate type. This fixes 3 statements in 02905_show_setting_query and 3 statements in 00405_output_format_pretty_color.
1 parent 2a3480a commit 4018703

4 files changed

Lines changed: 4 additions & 12 deletions

File tree

ast/ast.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@ const (
810810
ShowDictionaries ShowType = "DICTIONARIES"
811811
ShowFunctions ShowType = "FUNCTIONS"
812812
ShowSettings ShowType = "SETTINGS"
813+
ShowSetting ShowType = "SETTING"
813814
ShowGrants ShowType = "GRANTS"
814815
)
815816

parser/parser.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5838,6 +5838,8 @@ func (p *Parser) parseShow() ast.Statement {
58385838
show.ShowType = ast.ShowDictionaries
58395839
case "FUNCTIONS":
58405840
show.ShowType = ast.ShowFunctions
5841+
case "SETTING":
5842+
show.ShowType = ast.ShowSetting
58415843
case "INDEXES", "INDICES", "KEYS":
58425844
// SHOW INDEXES/INDICES/KEYS FROM table - treat as ShowColumns
58435845
show.ShowType = ast.ShowColumns
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
{
2-
"explain_todo": {
3-
"stmt13": true,
4-
"stmt22": true,
5-
"stmt4": true
6-
}
7-
}
1+
{}
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
{
2-
"explain_todo": {
3-
"stmt2": true,
4-
"stmt4": true,
5-
"stmt5": true
6-
}
72
}

0 commit comments

Comments
 (0)