LucaCappelletti94 commented on code in PR #3045:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/3045#discussion_r4693842386
##########
tests/sqlparser_common.rs:
##########
@@ -23670,3 +23670,37 @@ fn parse_grant_revoke_all_privileges_columns() {
fn parse_pgq_keywords_as_identifiers() {
all_dialects().verified_stmt("SELECT edge.label AS property FROM graph AS
edge");
}
+
+#[test]
+fn test_select_where_with_ilike_any_escape() {
+ match verified_stmt(r#"SELECT * FROM x WHERE a ILIKE ANY pat ESCAPE '!'"#)
{
+ Statement::Query(query) => {
+ let select = query.body.as_select().unwrap();
+ assert_eq!(
+ select.selection,
+ Some(Expr::ILike {
+ negated: false,
+ any: true,
+ expr: Box::new(Expr::Identifier(Ident::new("a"))),
+ pattern: Box::new(Expr::Identifier(Ident::new("pat"))),
+ escape_char: Some(Box::new(Expr::Value(
+ Value::SingleQuotedString("!".into()).with_empty_span()
+ ))),
+ })
+ );
+ }
+ _ => unreachable!(),
+ }
+
+ verified_stmt(r#"SELECT * FROM x WHERE a NOT ILIKE ANY pat ESCAPE '!'"#);
Review Comment:
Why are you using raw strings here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]