Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 100972
Status: resolved
Priority: 0/
Queue: SQL-Abstract-Complete

People
Owner: gryphon [...] cpan.org
Requestors: dinis [...] lage.pw
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 1.01
  • 1.02
  • 1.03
  • 1.04
Fixed in: (no value)



Subject: Missing bind parameters for statements with HAVING clauses
Hello, It seems to me like the @bind array returned should include the binds for the WHERE clause as well as the binds for the "HAVING" statement, which does not currently happen. I've been able to fix it using the following change (git diff): index 7c2aa62..40dde39 100644 --- a/SQL/Abstract/Complete.pm +++ b/SQL/Abstract/Complete.pm @@ -127,7 +127,11 @@ sub select { _wipe_space($group_by); } : undef ), ( ( $meta->{'having'} ) ? do { - ( my $having = scalar( $self->where( $meta->{'having'} ) ) ) =~ s/\s*WHERE/HAVING/; + my ( $having, @having_bind ) = $self->where( $meta->{'having'} ); + $having =~ s/\s*WHERE/HAVING/; + if ( $having and scalar( @having_bind ) ) { + push( @bind, @having_bind ); + } _wipe_space($having); } : undef ), ( ( $meta->{'order_by'} ) ? _wipe_space( $self->_order_by( $meta->{'order_by'} ) ) : undef ), ############################################################# Hope this helps. Regards, Dinis
Resolved with v1.05 Thanks for the report and the patch.