Subject: | Order of values in insert incorrect |
Date: | Mon, 13 Dec 2010 10:45:14 -0700 |
To: | bug-fey [...] rt.cpan.org |
From: | John Daschbach <jldasch [...] mac.com> |
The following appears to be a bug.
my $ins = Fey::SQL->new_insert();
my ($datecnttable, $sdate, $dcnt)
= $dbUtil->getTableAndColumns('datecount',['sdate', 'dcnt']);
$ins->into($datecnttable);
$ins->values( sdate => $ph, $dcnt->name() => $ph);
my $sth2 = $dbUtil->prepareSth( $ins, 1 );
==================
Printing the sql via $sql->sql( $dbh )
=================
INSERT INTO "datecount" ("dcnt", "sdate") VALUES (?, ?)
Somehow Fey is reversing the order of the values passed in the values() call when constructing the SQL.
Also, although not a bug, it seems odd that a few->insert->values() method will not take a column object, but requires an explicit name call. It would seem more consistent with a Fey select if one could pass a column object to the values() method.
-John