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

Niko Tyni ntyni at iki.fi
Thu Dec 15 13:59:13 UTC 2005


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	ntyni at iki.fi
-------------- next part --------------
--- 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}};


More information about the pkg-perl-maintainers mailing list