@@ -2180,8 +2180,8 @@ fn parse_pg_regex_match_ops() {
21802180 ( "!~*" , BinaryOperator :: PGRegexNotIMatch ) ,
21812181 ] ;
21822182
2183+ // Match against a single value
21832184 for ( str_op, op) in pg_regex_match_ops {
2184- // Basic binary operator usage
21852185 let select = pg ( ) . verified_only_select ( & format ! ( "SELECT 'abc' {str_op} '^a'" ) ) ;
21862186 assert_eq ! (
21872187 SelectItem :: UnnamedExpr ( Expr :: BinaryOp {
@@ -2191,8 +2191,10 @@ fn parse_pg_regex_match_ops() {
21912191 } ) ,
21922192 select. projection[ 0 ]
21932193 ) ;
2194+ }
21942195
2195- // Binary operator with ANY operator
2196+ // Match against any value from an array
2197+ for ( str_op, op) in pg_regex_match_ops {
21962198 let select =
21972199 pg ( ) . verified_only_select ( & format ! ( "SELECT 'abc' {str_op} ANY(ARRAY['^a', 'x'])" ) ) ;
21982200 assert_eq ! (
@@ -2222,8 +2224,8 @@ fn parse_pg_like_match_ops() {
22222224 ( "!~~*" , BinaryOperator :: PGNotILikeMatch ) ,
22232225 ] ;
22242226
2227+ // Match against a single value
22252228 for ( str_op, op) in pg_like_match_ops {
2226- // Basic binary operator usage
22272229 let select = pg ( ) . verified_only_select ( & format ! ( "SELECT 'abc' {str_op} 'a_c%'" ) ) ;
22282230 assert_eq ! (
22292231 SelectItem :: UnnamedExpr ( Expr :: BinaryOp {
@@ -2233,8 +2235,10 @@ fn parse_pg_like_match_ops() {
22332235 } ) ,
22342236 select. projection[ 0 ]
22352237 ) ;
2238+ }
22362239
2237- // Binary operator with ALL operator
2240+ // Match against all values from an array
2241+ for ( str_op, op) in pg_like_match_ops {
22382242 let select =
22392243 pg ( ) . verified_only_select ( & format ! ( "SELECT 'abc' {str_op} ALL(ARRAY['a_c%'])" ) ) ;
22402244 assert_eq ! (
0 commit comments