diff --git a/pkg/sql/opt/norm/rules/comp.opt b/pkg/sql/opt/norm/rules/comp.opt index 08d978d5ca63..203ccedc649b 100644 --- a/pkg/sql/opt/norm/rules/comp.opt +++ b/pkg/sql/opt/norm/rules/comp.opt @@ -98,8 +98,8 @@ [FoldNullComparisonLeft, Normalize] (Eq | Ne | Ge | Gt | Le | Lt | Like | NotLike | ILike | NotILike | SimilarTo | NotSimilarTo | RegMatch | NotRegMatch - | RegIMatch | NotRegIMatch | Contains | Overlaps - | JsonExists | JsonSomeExists | JsonAllExists + | RegIMatch | NotRegIMatch | Contains | ContainedBy + | Overlaps | JsonExists | JsonSomeExists | JsonAllExists $left:(Null) * ) diff --git a/pkg/sql/opt/norm/testdata/rules/comp b/pkg/sql/opt/norm/testdata/rules/comp index 3c9e36947089..c67b81f4014c 100644 --- a/pkg/sql/opt/norm/testdata/rules/comp +++ b/pkg/sql/opt/norm/testdata/rules/comp @@ -301,6 +301,7 @@ WHERE null::string !~* 'foo' OR 'foo' !~* null::string OR null::string[] && ARRAY['foo'] OR ARRAY['foo'] && null::string[] OR null::jsonb @> '"foo"' OR '"foo"' <@ null::jsonb OR + null::jsonb <@ '"foo"' OR '"foo"' @> null::jsonb OR null::jsonb ? 'foo' OR '{}' ? null::string OR null::jsonb ?| ARRAY['foo'] OR '{}' ?| null::string[] OR null::jsonb ?& ARRAY['foo'] OR '{}' ?& null::string[]