diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 95f1f8edc..2c5584c83 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -793,7 +793,9 @@ impl<'a> Parser<'a> { Keyword::EXTRACT => self.parse_extract_expr(), Keyword::CEIL => self.parse_ceil_floor_expr(true), Keyword::FLOOR => self.parse_ceil_floor_expr(false), - Keyword::POSITION => self.parse_position_expr(), + Keyword::POSITION if self.peek_token().token == Token::LParen => { + self.parse_position_expr() + } Keyword::SUBSTRING => self.parse_substring_expr(), Keyword::OVERLAY => self.parse_overlay_expr(), Keyword::TRIM => self.parse_trim_expr(), diff --git a/tests/sqlparser_snowflake.rs b/tests/sqlparser_snowflake.rs index e92656d0b..4859a8f06 100644 --- a/tests/sqlparser_snowflake.rs +++ b/tests/sqlparser_snowflake.rs @@ -1064,3 +1064,9 @@ fn test_snowflake_trim() { snowflake().parse_sql_statements(error_sql).unwrap_err() ); } + +#[test] +fn parse_position_not_function_columns() { + snowflake_and_generic() + .verified_stmt("SELECT position FROM tbl1 WHERE position NOT IN ('first', 'last')"); +}