Skip Menu |

This queue is for tickets about the SQL-Abstract CPAN distribution.

Report information
The Basics
Id: 43483
Status: resolved
Priority: 0/
Queue: SQL-Abstract

People
Owner: Nobody in particular
Requestors: wenbinye [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 1.51



Subject: method `values' gives inconsistent bind value
I tested with code as following: use SQL::Abstract; use Data::Dumper qw(Dumper); my $sql = SQL::Abstract->new; my $row = { 'time' => ['now()']}; my ($stmt, @v1) = $sql->insert('table', $row); my @v2 = $sql->values($row); print Dumper(\@v1, \@v2), "\n"; Output: $VAR1 = []; $VAR2 = [ [ 'now()' ] ]; So if the where clause contains array ref as field's value, the code snippet in "PERFORMANCE" can not used. I don't know whether this is a bug, but I think if it can fix it may be better.
On Fri Feb 20 19:21:36 2009, YEWENBIN wrote: Show quoted text
> I tested with code as following: > use SQL::Abstract; > use Data::Dumper qw(Dumper); > my $sql = SQL::Abstract->new; > my $row = { 'time' => ['now()']}; > my ($stmt, @v1) = $sql->insert('table', $row); > my @v2 = $sql->values($row); > print Dumper(\@v1, \@v2), "\n";
This use case doesn't seem to be valid, as the hashref supplied to insert/values is documented as a column/value one. Thus the now() in an arrayref seems out of place - please clarify. Additionally 'now()' is just a value, you'd want \'now()' for literal sql. This indeed doesn't work properly, and I committed a failing test for this behavior: http://pastebin.com/f55b43b21 Please review and let me know if there is something I omitted.