Skip to content

Commit 8be8f27

Browse files
fix: change to ilike pattern
1 parent 5449d01 commit 8be8f27

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/parser/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8822,7 +8822,7 @@ impl<'a> Parser<'a> {
88228822
let next_token = self.next_token();
88238823
let pattern = match next_token.token {
88248824
Token::SingleQuotedString(s) => Ok(s),
8825-
_ => self.expected("single quoted string", next_token),
8825+
_ => self.expected("ilike pattern", next_token),
88268826
};
88278827
Some(IlikeSelectItem { pattern: pattern? })
88288828
} else {

tests/sqlparser_snowflake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,7 +1633,7 @@ fn test_select_wildcard_with_ilike_double_quote() {
16331633
let res = snowflake().parse_sql_statements(r#"SELECT * ILIKE "%id" FROM tbl"#);
16341634
assert_eq!(
16351635
res.unwrap_err().to_string(),
1636-
"sql parser error: Expected single quoted string, found: \"%id\""
1636+
"sql parser error: Expected ilike pattern, found: \"%id\""
16371637
);
16381638
}
16391639

@@ -1642,7 +1642,7 @@ fn test_select_wildcard_with_ilike_number() {
16421642
let res = snowflake().parse_sql_statements(r#"SELECT * ILIKE 42 FROM tbl"#);
16431643
assert_eq!(
16441644
res.unwrap_err().to_string(),
1645-
"sql parser error: Expected single quoted string, found: 42"
1645+
"sql parser error: Expected ilike pattern, found: 42"
16461646
);
16471647
}
16481648

0 commit comments

Comments
 (0)