if $op =~ $self->like_op or $op =~ $self->not_like_op;
if ($op =~ $self->equality_op or $op =~ $self->like_op or $op eq 'IS') {
'IS NULL'
- } elsif ($op =~ $self->inequality_op or $op =~ $self->not_like_op or $op eq 'IS NOT') {
+ } elsif (
+ $op =~ $self->inequality_op or $op =~ $self->not_like_op
+ or
+ $op eq 'IS NOT' or $op eq 'NOT'
+ ) {
'IS NOT NULL'
} else {
die "Can't do undef -> NULL transform for operator ${op}";
},
);
+# check is( not) => undef
+for my $op ( qw(not is is_not), 'is not' ) {
+ (my $sop = uc $op) =~ s/_/ /gi;
+
+ $sop = 'IS NOT' if $sop eq 'NOT';
+
+ for my $uc (0, 1) {
+ for my $prefix ('', '-') {
+ push @tests, {
+ func => 'where',
+ args => [{ a => { ($prefix . ($uc ? uc $op : lc $op) ) => undef } }],
+ stmt => "WHERE a $sop NULL",
+ stmt_q => "WHERE `a` $sop NULL",
+ bind => [],
+ };
+ }
+ }
+}
+
for my $t (@tests) {
local $"=', ';