Skip Menu |

This queue is for tickets about the Class-DBI-Sweet CPAN distribution.

Report information
The Basics
Id: 16481
Status: resolved
Worked: 15 min
Priority: 0/
Queue: Class-DBI-Sweet

Owner: PHRED [...]
Requestors: cdbi-sweet [...]

Bug Information
Severity: Normal
Broken in: 0.05
Fixed in: (no value)

Subject: g modifier missing on s///e
Download (untitled) / with headers
text/plain 691b
Hi, When I have search criteria like: { rectype => undef, => undef } Where the error table also has a rectype column I get an error !! ERROR: 1 'ambiguous column name: rectype(1) at dbdimp.c line 268' (err#0) T <- prepare_cached('SELECT FROM line me, error errors WHERE ( IS NULL AND rectype IS NULL ) AND = errors.line ORDER BY LIMIT ? OFFSET ? ')= undef at line 391 It seems to be because only the first IS NOT NULL has the column aliased correctly by the s///: $sql =~ s/(\S+)( IS(?: NOT)? NULL)/$self->_default_tables($1).$2/e; It should be s///ge to replace them all. I'm using 0.05 but the bug is still present in 0.07
text/x-diff 485b
--- /usr/local/share/perl/5.8.4/Class/DBI/ 2005-12-14 11:53:27.947233896 +0100 +++ /home/bsb/ 2005-12-14 11:53:39.211521464 +0100 @@ -633,7 +633,7 @@ $sql .= $self->_sqlcase(' where ') . $wh if $wh; } - $sql =~ s/(\S+)( IS(?: NOT)? NULL)/$self->_default_tables($1).$2/e; + $sql =~ s/(\S+)( IS(?: NOT)? NULL)/$self->_default_tables($1).$2/ge; my $joins = delete $self->{cdbi_join_info}; my $tables = delete $self->{cdbi_table_aliases};
This fix is present in version 0.08, thanks for the report.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to