Subject: | Cannot update a field based on its previous value |
SQL::Statement cannot update a field based on its previous value - That is, a simple "UPDATE table SET field = field + 1" will fail. In order to illustrate, try this snippet with DBD::CSV:
#!/usr/bin/perl
use DBI;
my $dbh = DBI->connect("DBI:CSV:f_dir=.");
$dbh->do("create table test (a int, b int, c int, d int)");
$dbh->do("insert into test values (0, 0, 0, 0)");
$dbh->do("update test set a = 1");
$dbh->do("update test set b = b + 1");
I tested it as well with DBD::Excel, with the same results:
DBD::CSV::db do failed: Can't use an undefined value as an ARRAY reference at /usr/share/perl5/SQL/Statement.pm line 1772, <GEN3> line 2.
[for Statement "update test set b = b + 1"] at test.pl line 7.
This bug report was initially filed in the Debian bug tracking system - Please refer to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=311788 for further information.