Good day monks.
It seems like I have stumbled with the bug described in here:
http://rt.cpan.org/Public/Bug/Display.html?id=13080
Just that it appears to affect arithmetic operations in general.
According to CPAN I am using the latest version of SQL::Statement, v 1.15 .
It seems like the bug has a fix available, a patch is on the on the bug report page, although for v 1.14, and also I'm not familiar with patching and editing modules, yet.
So I am asking for your help.
I assembled a small script, based on the bug report one but capable of testing more SQL Statements.
use DBI;
use strict;
my $db = DBI->connect(qq/DBI:CSV:/);
eval{$db->do('CREATE TABLE bug (a int, b int)')};
$db->do("INSERT INTO bug VALUES(0, 0)");
$db->do("update bug set a = 1");
eval{$db->do("update bug set b = 1 + 1")};
eval{$db->do("update bug set b = 1 - 1")};
eval{$db->do("update bug set b = 1 * 1")};
eval{$db->do("update bug set b = 1 / 1")};
When I run it I get this output:
DBD::CSV::db do failed: Can't use an undefined value as an ARRAY refer
+ence at /usr/lib/perl5/site_perl/5.10/SQL/Statement.pm line 1777, <GE
+N2> line 2.
[for Statement "update bug set b = 1 + 1"] at /cygdrive/c/Users/Profe
+sional/perl/databases/bug.pl line 9.
DBD::CSV::db do failed: Can't use an undefined value as an ARRAY refer
+ence at /usr/lib/perl5/site_perl/5.10/SQL/Statement.pm line 1777, <GE
+N3> line 2.
[for Statement "update bug set b = 1 - 1"] at /cygdrive/c/Users/Profe
+sional/perl/databases/bug.pl line 10.
DBD::CSV::db do failed: Can't use an undefined value as an ARRAY refer
+ence at /usr/lib/perl5/site_perl/5.10/SQL/Statement.pm line 1777, <GE
+N4> line 2.
[for Statement "update bug set b = 1 * 1"] at /cygdrive/c/Users/Profe
+sional/perl/databases/bug.pl line 11.
DBD::CSV::db do failed: Can't use an undefined value as an ARRAY refer
+ence at /usr/lib/perl5/site_perl/5.10/SQL/Statement.pm line 1777, <GE
+N5> line 2.
[for Statement "update bug set b = 1 / 1"] at /cygdrive/c/Users/Profe
+sional/perl/databases/bug.pl line 12.
The system is Cygwin installed on Windows Vista, using Perl 5.10