Bug#311788: libdbd-csv-perl: Error when "update tbl set a = a + 1;"

2005-12-15 Thread Niko Tyni
tags 311788 patch upstream
forwarded 311788 http://rt.cpan.org/NoAuth/Bug.html?id=13080
thanks

On Fri, Jun 03, 2005 at 08:24:55PM +0900, SUGITA Toshinori wrote:
 
> my perl script get error in bellow SQL statement
> 
>   update tbl set a = a + 1;
> 
> when use column name in right side.

Hi,

the attached patch seems to fix this. I'll send it to the
upstream author too.

Cheers,
-- 
Niko Tyni   [EMAIL PROTECTED]
--- libsql-statement-perl-1.14/lib/SQL/Statement.pm 2005/12/15 13:48:44 
1.1
+++ libsql-statement-perl-1.14/lib/SQL/Statement.pm 2005/12/15 13:49:09
@@ -1757,7 +1757,8 @@
 # we use the existing S::S::Func object
 #
 use SQL::Statement::Util;
-if ( $type eq 'function' and $structure->{name} !~ /(TRIM|SUBSTRING)/i ){
+if ( $type eq 'function' and $structure->{name} =~ /[A-Z]/ and
+ $structure->{name} !~ /(TRIM|SUBSTRING)/i ){
 $self->{loaded_function}->{$structure->{name}}
 ||= SQL::Statement::Util::Function->new($structure);
 $structure = $self->{loaded_function}->{$structure->{name}};


Bug#311788: libdbd-csv-perl: Error when "update tbl set a = a + 1;"

2005-06-03 Thread Gunnar Wolf
reassign 311788 libsql-statement-perl
thanks

This bug is not in DBD::CSV, but in SQL::Statement, the SQL
mini-engine - I tested this using DBD::Excel and I get the same
erroneous behavior :-(

Anyway, I'm also the maintainer for libsql-statement-perl, so that
does not free me from digging into it :)

-- 
Gunnar Wolf - [EMAIL PROTECTED] - (+52-55)1451-2244 / 5623-0154
PGP key 1024D/8BB527AF 2001-10-23
Fingerprint: 0C79 D2D1 2C4E 9CE4 5973  F800 D80E F35A 8BB5 27AF


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#311788: libdbd-csv-perl: Error when "update tbl set a = a + 1;"

2005-06-03 Thread SUGITA Toshinori
Package: libdbd-csv-perl
Version: 0.2100-2
Severity: normal

my perl script get error in bellow SQL statement

  update tbl set a = a + 1;

when use column name in right side.
I remember that SQL statement had done correctly in Feb/2005.

Error message is:
DBD::CSV::db do failed: Can't use an undefined value as an ARRAY reference at 
/usr/share/perl5/SQL/Statement.pm line 1772,  line 2.
 [for Statement "update test set b = b + 1"] at test.pl line 7.

that test code is:
--
#!/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");
--


-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.10
Locale: LANG=ja_JP.eucJP, LC_CTYPE=ja_JP.eucJP (charmap=EUC-JP) (ignored: 
LC_ALL set to ja_JP.eucJP)

Versions of packages libdbd-csv-perl depends on:
ii  libdbi-perl   1.46-6 Perl5 database interface by Tim Bu
ii  libsql-statement-perl 1.14-1 perl SQL::Statement - SQL parsing 
ii  libtext-csv-perl  0.23-5 perl Text::CSV_XS - comma-separate
ii  perl  5.8.4-8Larry Wall's Practical Extraction 

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]