Skip to content

Commit 69e44a0

Browse files
committed
fix(parser): allow unquoted STATUS keyword in DESCRIBE statements
Add STATUS to the simple_ident grammar rule to fix syntax error when running DESCRIBE dolt.status without quoting the table name. The simple_ident rule only allowed IDENT tokens and PUBLIC keyword. Since STATUS is defined as an unreserved keyword in the grammar, it was rejected in DESCRIBE statements unless quoted. This follows the same pattern used when PUBLIC was added in PR #828. Enable the previously skipped test that validates this fix. Refs: #1057
1 parent 7078359 commit 69e44a0

2 files changed

Lines changed: 1 addition & 1 deletion

File tree

postgres/parser/parser/sql.y

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14549,6 +14549,7 @@ complex_db_object_name_no_keywords:
1454914549
simple_ident:
1455014550
IDENT
1455114551
| PUBLIC // PUBLIC is a keyword, but its use as the default schema makes it nice to include here
14552+
| STATUS // STATUS is a keyword, but needed for dolt.status system table (issue #1057)
1455214553

1455314554
// DB object name component -- this cannot not include any reserved
1455414555
// keyword because of ambiguity after FROM, but we've been too lax

testing/go/dolt_tables_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1910,7 +1910,6 @@ func TestUserSpaceDoltTables(t *testing.T) {
19101910
},
19111911
},
19121912
{
1913-
Skip: true, // TODO: ERROR: at or near "status": syntax error
19141913
Query: `DESCRIBE dolt.status`,
19151914
Expected: []sql.Row{
19161915
{"table_name", "text", "NO", "PRI", nil, ""},

0 commit comments

Comments
 (0)