Re: [Dbix-class] "search on row->has_many fails if row has prefetch join" after 0.08196 -> 0.08206 upgrade

2013-02-23 Thread Peter Rabbitson
On Sat, Feb 23, 2013 at 03:58:20AM +1100, Peter Rabbitson wrote:
> On Fri, Feb 22, 2013 at 04:46:46PM +, Chisel wrote:
> > At work we had to freeze our DBIC at 0.08196 until the prefetch/namespace
> > bug was fixed ... which it was recently.
> > 
> > Internally we've built the new perl+cpandeps RPM including DBIx::Class
> > 0.08206. Things are looking great for the prefetch/namespace fix but
> > something has come to light this week that we think is a bug in DBIC (or
> > maybe SQLA).
> > 
> > The co-worker has managed to distill it into the attached stand-alone test
> > case, and the output from the test is below.
> > 
> > Is this a bug, or are we doing 'bad things' that have come to light with
> > newer code in DBIC?
> 
> This is a blatant regression, I have no idea how it went undetected :(
> Bisection is running while writing this..

Fixed and merged: https://github.com/dbsrgits/dbix-class/commit/9ae300a

Please confirm this passes your test suite (use current master), we will 
have to cut yet another emergency release after that ;( 0.08205 was so 
full of crap.


___
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk


Re: [Dbix-class] "search on row->has_many fails if row has prefetch join" after 0.08196 -> 0.08206 upgrade

2013-02-22 Thread Chisel
On Fri, Feb 22, 2013 at 4:58 PM, Peter Rabbitson  wrote:
>
> The test is comprehensive enough, no further questions. It would be
> great if you could convert it to a DBIC-internal test, for example based
> off of:
> https://github.com/dbsrgits/dbix-class/blob/master/t/prefetch/via_search_related.t
> (otherwise one of us got to do it, tests added to the core suite need to
> follow the internal schema)



I've had a go, trying to preserve the intent of Colin's original test
- it still fails locally with the newer DBIC; I realise there's scope
for some improvement in the test, but I didn't want to start messing
about with it too much.

Hopefully it's easier for you to make any final tweaks:

 cut here 
use strict;
use warnings;

use Test::More;

use lib 't/lib';
use DBICTest;

my $schema = DBICTest->init_schema();

ok (my $artist = $schema->resultset('Artist')->create({artistid=>804,
name=>'thefoo'}), "Add an artist 'thefoo'");

my $cds = 
[{cdid=>101,title=>'foobar_1',year=>1974},{cdid=>102,title=>'foobar_2',year=>1974}];

foreach my $cd (@{$cds}){
ok ($artist->create_related('cds', $cd), "Added a CD for artist 'thefoo'");
}

my $found_artist = $schema->resultset('Artist')->find(
{'me.artistid' => 804},
{ prefetch=> 'cds' }
);

my $cd = $found_artist->cds->search({cdid => 102});
is ($cd->first->id, 102, "Expected CD with ID 102");

done_testing;
 cut here 





Chiz

--
Chisel
e: chi...@chizography.net
w: http://chizography.net

___
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk


Re: [Dbix-class] "search on row->has_many fails if row has prefetch join" after 0.08196 -> 0.08206 upgrade

2013-02-22 Thread Peter Rabbitson
On Fri, Feb 22, 2013 at 04:46:46PM +, Chisel wrote:
> At work we had to freeze our DBIC at 0.08196 until the prefetch/namespace
> bug was fixed ... which it was recently.
> 
> Internally we've built the new perl+cpandeps RPM including DBIx::Class
> 0.08206. Things are looking great for the prefetch/namespace fix but
> something has come to light this week that we think is a bug in DBIC (or
> maybe SQLA).
> 
> The co-worker has managed to distill it into the attached stand-alone test
> case, and the output from the test is below.
> 
> Is this a bug, or are we doing 'bad things' that have come to light with
> newer code in DBIC?

This is a blatant regression, I have no idea how it went undetected :(
Bisection is running while writing this..

> I'm not the resident expert on this problem in-house, but can proxy
> questions through the right channels here if necessary.

The test is comprehensive enough, no further questions. It would be 
great if you could convert it to a DBIC-internal test, for example based 
off of: 
https://github.com/dbsrgits/dbix-class/blob/master/t/prefetch/via_search_related.t
 
(otherwise one of us got to do it, tests added to the core suite need to 
follow the internal schema)

> Thanks in advance,

Thanks for finding this, fix should materialize in the next days.

___
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk


[Dbix-class] "search on row->has_many fails if row has prefetch join" after 0.08196 -> 0.08206 upgrade

2013-02-22 Thread Chisel
At work we had to freeze our DBIC at 0.08196 until the prefetch/namespace
bug was fixed ... which it was recently.

Internally we've built the new perl+cpandeps RPM including DBIx::Class
0.08206. Things are looking great for the prefetch/namespace fix but
something has come to light this week that we think is a bug in DBIC (or
maybe SQLA).

The co-worker has managed to distill it into the attached stand-alone test
case, and the output from the test is below.

Is this a bug, or are we doing 'bad things' that have come to light with
newer code in DBIC?

I'm not the resident expert on this problem in-house, but can proxy
questions through the right channels here if necessary.

Thanks in advance,

Chisel

 test output 
➔ perl -v |grep version
This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux
➔ perlversion DBIx::Class SQL::Abstract
[DBIx::Class] 0.08196
[SQL::Abstract] 1.72
➔ prove ./failing_test.t
./failing_test.t .. ok
All tests successful.
Files=1, Tests=4,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.19 cusr  0.09
csys =  0.31 CPU)
Result: PASS
➔ echo "Upgrading DBIx::Class and SQL::Abstract *only* in another
terminal..."
Upgrading DBIx::Class and SQL::Abstract *only* in another terminal...
➔ perlversion DBIx::Class SQL::Abstract
[DBIx::Class] 0.08206
[SQL::Abstract] 1.73
➔ prove ./failing_test.t
./failing_test.t .. 1/?
#   Failed test 'Expected CD with ID 2'
#   at ./failing_test.t line 58.
#  got: '1'
# expected: '2'
# Looks like you failed 1 test of 4.
./failing_test.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/4 subtests

Test Summary Report
---
./failing_test.t (Wstat: 256 Tests: 4 Failed: 1)
  Failed test:  4
  Non-zero exit status: 1
Files=1, Tests=4,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.25 cusr  0.06
csys =  0.34 CPU)
Result: FAIL
➔
 test output 

-- 
Chisel
e: chi...@chizography.net
w: http://chizography.net


failing_test.t
Description: Troff document
___
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk