Skip Menu |

This queue is for tickets about the SQL-Statement CPAN distribution.

Report information
The Basics
Id: 26058
Status: resolved
Priority: 0/
Queue: SQL-Statement

People
Owner: REHSACK [...] cpan.org
Requestors: manuel.j.palacios [...] wellsfargo.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.15
Fixed in: (no value)



Subject: functions on computed columns aliased to the underlying column name are not called
Using SQL-Statement-1.15, Perl 5.8.7 on cygwin 1.5.24 and Perl 5.8.8 on aix 5.2, queries like this: select rpad(foo_col, 7, '.') foo_col from foo_tbl display results like this: foo_col ------- 1 2 when I am expecting this: foo_col ------- 1...... 2...... The following patch fixes the behavior describe above: $ diff - ur /lib/perl5/site_perl/5.8/SQL/Statement.pm /patches/SQL/Statement.pm --- /lib/perl5/site_perl/5.8/SQL/Statement.pm 2007-03-21 14:55:00.317514800 -0500 +++ /patches/SQL/Statement.pm 2007-03-21 17:44:03.448136400 -0500 @@ -840,7 +840,7 @@ $table->column_num($tbl . $dlm . $col) : $table->column_num($col); - if (!defined $cnum) { + if (!defined $cnum || $column->{function}) { $funcs{$col} = $column->{function}; $cnum = $col; }
Patch applied as it doesn't break any test. Next time please add a test-scenario or a working test-script which demonstrates the error.