Commit da93efe
committed
fix(postgres): treat FULLTEXT and SPATIAL as unreserved identifiers
FULLTEXT and SPATIAL are MySQL-specific table constraint keywords. When
parse_optional_table_constraint encountered them in a PostgreSQL context
it would consume the token, fall through to the _ arm, and call
prev_token() to restore it — but the consume-then-backtrack round-trip
left room for a subtle parser-state bug that caused the next call to
parse_data_type to see 'fulltext' instead of the actual column type.
Fix: add an explicit peek-based guard at the top of
parse_optional_table_constraint so that for dialects other than MySQL /
Generic the FULLTEXT / SPATIAL tokens are never consumed at all. The
caller (parse_columns) then correctly falls through to parse_column_def
and treats the word as an ordinary column identifier.
Also add a parser unit test covering a tsvector column literally named
'fulltext' (as in the pagila DVD-rental schema) and a GiST index that
references the same column by name.
Bump version to 0.60.13.1 parent 9a1cd68 commit da93efe
3 files changed
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10018 | 10018 | | |
10019 | 10019 | | |
10020 | 10020 | | |
| 10021 | + | |
| 10022 | + | |
| 10023 | + | |
| 10024 | + | |
| 10025 | + | |
| 10026 | + | |
| 10027 | + | |
| 10028 | + | |
| 10029 | + | |
| 10030 | + | |
| 10031 | + | |
| 10032 | + | |
| 10033 | + | |
10021 | 10034 | | |
10022 | 10035 | | |
10023 | 10036 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7220 | 7220 | | |
7221 | 7221 | | |
7222 | 7222 | | |
| 7223 | + | |
| 7224 | + | |
| 7225 | + | |
| 7226 | + | |
| 7227 | + | |
| 7228 | + | |
| 7229 | + | |
| 7230 | + | |
| 7231 | + | |
| 7232 | + | |
| 7233 | + | |
| 7234 | + | |
| 7235 | + | |
| 7236 | + | |
7223 | 7237 | | |
7224 | 7238 | | |
7225 | 7239 | | |
| |||
0 commit comments