File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9810,10 +9810,9 @@ impl<'a> Parser<'a> {
98109810 None
98119811 };
98129812
9813- // FULLTEXT and SPATIAL are MySQL-specific table constraint keywords. For
9814- // dialects that don't support them (e.g. PostgreSQL) they are valid
9815- // identifiers and must not be consumed here — the caller will parse them
9816- // as column names instead.
9813+ // Peek instead of consuming: FULLTEXT/SPATIAL are only table constraints in
9814+ // MySQL/Generic, so consuming them before confirming the dialect would break
9815+ // the column-name fallback in other dialects (e.g. PostgreSQL).
98179816 if name.is_none()
98189817 && self
98199818 .peek_one_of_keywords(&[Keyword::FULLTEXT, Keyword::SPATIAL])
Original file line number Diff line number Diff line change @@ -7129,6 +7129,8 @@ fn parse_fulltext_as_column_name() {
71297129 pg ( ) . verified_stmt ( "CREATE TABLE geo (spatial TEXT NOT NULL)" ) ;
71307130
71317131 pg ( ) . verified_stmt ( "CREATE INDEX film_fulltext_idx ON film USING GIST (fulltext)" ) ;
7132+
7133+ pg ( ) . verified_stmt ( "CREATE INDEX geo_spatial_idx ON geo USING GIST (spatial)" ) ;
71327134}
71337135
71347136#[ test]
You can’t perform that action at this time.
0 commit comments