# got documented. mst hates everything.
if (ref($rhs) eq 'SCALAR') {
my $x = $$rhs;
- $x = "($x)" unless $x =~ /^\s*\(/;
+ 1 while ($x =~ s/\A\s*\((.*)\)\s*\Z/$1/s);
$rhs = \$x;
} else {
my ($x, @rest) = @{$$rhs};
- $x = "($x)" unless $x =~ /^\s*\(/;
+ 1 while ($x =~ s/\A\s*\((.*)\)\s*\Z/$1/s);
$rhs = \[ $x, @rest ];
}
}
- return $self->_literal_with_prepend_to_dq("$k $op", $$rhs);
+ return +{
+ type => DQ_OPERATOR,
+ operator => { 'SQL.Naive' => $op },
+ args => [ $self->_ident_to_dq($k), $self->_literal_to_dq($$rhs) ]
+ };
}
return $self->_literal_to_dq($self->{sqlfalse}) unless @$rhs;
return +{
{
parenthesis_significant => 1,
where => { x => { -in => \['( ( ?,?,lower(y) ) )', 1, 2] } },
- stmt => "WHERE ( x IN ( ( ?,?,lower(y) ) ) )", # note that outer parens are opened even though literal was requested (RIBASUSHI)
+ stmt => "WHERE ( x IN ( ?,?,lower(y) ) )", # note that outer parens are opened even though literal was requested (RIBASUSHI)
bind => [1, 2],
test => '-in with a literal arrayrefref',
},