# skip empty elements, otherwise get invalid trailing AND stuff
ARRAYREF => sub {$self->_recurse_where($el) if @$el},
+ ARRAYREFREF => sub { @{${$el}} if @{${$el}}},
+
HASHREF => sub {$self->_recurse_where($el, 'and') if %$el},
# LDNOTE : previous SQLA code for hashrefs was creating a dirty
# side-effect: the first hashref within an array would change
return $self->_join_sql_clauses($logic, \@sql_clauses, \@all_bind);
}
+#======================================================================
+# WHERE: top-level ARRAYREFREF
+#======================================================================
+sub _where_ARRAYREFREF {
+ my ($self, $where) = @_;
+ my ($sql, @bind) = @{${$where}};
+
+ return ($sql, @bind);
+}
#======================================================================
# WHERE: top-level HASHREF
my $not_stringifiable = bless {}, 'SQLA::NotStringifiable';
my@x=(
+);my @handle_tests = (
{
where => {
requestor => 'inna',
bind => [ $not_stringifiable ],
},
-);my @handle_tests = (
{
- where => \[ 'foo ?','bar' ],
+ where => \[ 'foo = ?','bar' ],
stmt => " WHERE (foo = ?)",
bind => [ "bar" ],
},
-);my@x2=(
{
- where => [ \[ 'foo ?','bar' ] ],
+ where => [ \[ 'foo = ?','bar' ] ],
stmt => " WHERE (foo = ?)",
bind => [ "bar" ],
},
+);my@x2=(
);
[$sql->values ($data)],
[@bind],
'values() output matches that of initial bind'
- ) || diag "Corresponding SQL statement: $stmt";
+ );# || diag "Corresponding SQL statement: $stmt";
}