File tree Expand file tree Collapse file tree 1 file changed +23
-9
lines changed
Expand file tree Collapse file tree 1 file changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -1618,17 +1618,31 @@ impl<'a> Filter<'a> {
16181618 out. push_sql ( ") > 0" ) ;
16191619 }
16201620 }
1621- SqlValue :: List ( _) | SqlValue :: Numerics ( _) => {
1622- if op. negated ( ) {
1623- out. push_sql ( " not " ) ;
1624- column. walk_ast ( out. reborrow ( ) ) ?;
1625- out. push_sql ( " && " ) ;
1626- } else {
1621+ SqlValue :: List ( _) | SqlValue :: Numerics ( _) => match op {
1622+ // For case-insensitive operations
1623+ ContainsOp :: ILike | ContainsOp :: NotILike => {
1624+ if op. negated ( ) {
1625+ out. push_sql ( " not " ) ;
1626+ }
1627+ out. push_sql ( "exists (select 1 from unnest(" ) ;
16271628 column. walk_ast ( out. reborrow ( ) ) ?;
1628- out. push_sql ( " @> " ) ;
1629+ out. push_sql ( ") as elem where elem ilike any(" ) ;
1630+ qv. walk_ast ( out. reborrow ( ) ) ?;
1631+ out. push_sql ( "))" ) ;
16291632 }
1630- qv. walk_ast ( out) ?;
1631- }
1633+ _ => {
1634+ // For case-sensitive operations
1635+ if op. negated ( ) {
1636+ out. push_sql ( " not " ) ;
1637+ column. walk_ast ( out. reborrow ( ) ) ?;
1638+ out. push_sql ( " && " ) ;
1639+ } else {
1640+ column. walk_ast ( out. reborrow ( ) ) ?;
1641+ out. push_sql ( " @> " ) ;
1642+ }
1643+ qv. walk_ast ( out) ?;
1644+ }
1645+ } ,
16321646 SqlValue :: Null
16331647 | SqlValue :: Bool ( _)
16341648 | SqlValue :: Numeric ( _)
You can’t perform that action at this time.
0 commit comments