Revision history for SQL::Abstract
- Fix parsing of foo.* in SQLA::Tree
+ - Fix bindtype fail when using -between with arrayrefref literals
revision 1.71 2010-11-09
----------------------------
foreach my $val (@$vals) {
my ($sql, @bind) = $self->_SWITCH_refkind($val, {
SCALAR => sub {
- return ($placeholder, $val);
+ return ($placeholder, $self->_bindtype($k, $val) );
},
SCALARREF => sub {
return $$val;
return (
(join $and, @all_sql),
- $self->_bindtype($k, @all_bind),
+ @all_bind
);
},
FALLBACK => sub {
bind => [1, 2, 1, 2, 'stuff'],
test => '-between POD test',
},
+ {
+ args => { bindtype => 'columns' },
+ where => {
+ start0 => { -between => [ 1, { -upper => 2 } ] },
+ start1 => { -between => \["? AND ?", [ start1 => 1], [start1 => 2] ] },
+ start2 => { -between => \"lower(x) AND upper(y)" },
+ start3 => { -between => [
+ \"lower(x)",
+ \["upper(?)", [ start3 => 'stuff'] ],
+ ] },
+ },
+ stmt => "WHERE (
+ ( start0 BETWEEN ? AND UPPER ? )
+ AND ( start1 BETWEEN ? AND ? )
+ AND ( start2 BETWEEN lower(x) AND upper(y) )
+ AND ( start3 BETWEEN lower(x) AND upper(?) )
+ )",
+ bind => [
+ [ start0 => 1 ],
+ [ start0 => 2 ],
+ [ start1 => 1 ],
+ [ start1 => 2 ],
+ [ start3 => 'stuff' ],
+ ],
+ test => '-between POD test',
+ },
{
parenthesis_significant => 1,