[Dbix-class] Re: Bind order bug, patch/test for review

Marc Mims marc at questright.com
Sat Sep 29 20:12:43 GMT 2007


* Marc Mims <marc at questright.com> [070928 00:45]:
> === lib/DBIx/Class/Storage/DBI.pm
> ==================================================================
> --- lib/DBIx/Class/Storage/DBI.pm       (revision 1335)
> +++ lib/DBIx/Class/Storage/DBI.pm       (local)
> @@ -913,7 +913,7 @@
>    my ($self, $op, $extra_bind, $ident, $args) = @_;
>  
>    my ($sql, @bind) = $self->sql_maker->$op($ident, @$args);
> -  unshift(@bind,
> +  push(@bind,
>      map { ref $_ eq 'ARRAY' ? $_ : [ '!!dummy', $_ ] } @$extra_bind)
>        if $extra_bind;
> 
> 
> The attached test fails without the patch, succeeds with it, and all
> other tests in 0.08/trunk pass with it.
> 
> Can it be this simple?  Surely there was some reason for unshift instead
> of push, but I didn't discover it.

No.  It's not that simple.  An updated test is attached.  The simple
cases pass with the patch applied.  But the complex tests, based on the
Cookbook "Arbitrary SQL" technique fail.
http://search.cpan.org/~ash/DBIx-Class-0.08007/lib/DBIx/Class/Manual/Cookbook.pod#Arbitrary_SQL_through_a_custom_ResultSource

I'm not sure how to tackle this problem in a way that will satisfy all
the tests...yet.

	-Marc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 47bind_attribute.t
Type: text/x-perl
Size: 2087 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20070929/27f4ef7e/47bind_attribute.pm


More information about the DBIx-Class mailing list