Skip Menu |

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

Report information
The Basics
Id: 17703
Status: new
Priority: 0/
Queue: SQL-Abstract-Limit

People
Owner: Nobody in particular
Requestors: alan.humphrey [...] comcast.net
Cc:
AdminCc:

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



Subject: GenericSubQ doesn't handle table alias
If you have a table name using an alias the generated SQL is bad. Code: my @fields = ('me.artistid, me.name'); my %where = ( 'me.artistid' => { '>' => 0} ); my @order = ('me.artistid'); my $sql = SQL::Abstract::Limit->new( limit_dialect => "GenericSubQ"); my $stmt = $sql->select('artist me', \@fields, \%where, \@order, 3, 2 ); print $stmt . "\n"; Produces: SELECT me.artistid, me.name FROM artist X me WHERE ( me.artistid > ? ) AND ( SELECT COUNT(*) FROM artist WHERE me > X.me ) BETWEEN 2 AND 5 ORDER BY me DESC Note the problematic SQL following the first FROM and the second WHERE.