[Dbix-class] Attached Test for review (was: Re: Possible trouble with ResultSet::new_result....)

John Napiorkowski jjn1056 at yahoo.com
Fri May 5 10:19:44 CEST 2006


I've attached a tarfile with a self contained test
that uses a temporary sqlite database to demonstrate
the issue I am running into.

I'm not sure if this test is in the format you prefer
(I can't really find any guidelines except the source
code for existing tests which was a little confusing
to me).  To be honest I am not sure if this issue I am
having should really be considered a bug.

There are 18 tests total, but most of them are just to
make sure the database is running as expected.  The
heart of it is on the last two tests where I compare
the behavior of resultsets returned from
->search_related(...) methods.  Test 17 uses
search_related and just names the relations while test
18 (the one that breaks) adds a condition.

Test 17 (line 171) executes and returns without error,
but test 18 (line 180) dies with the error message
I've been talking about ("-and" not a column.)

I tried lots of different condition clauses, even
inane ones line "id=>id" and I get the same error.

Please check it out and let me know what I should do
to improve it.  I'd offer a patch for an existing test
but as I said the existing tests are a bit hard for me
to follow.

Thanks for the help!

John Napiorkowski

--- Matt S Trout <dbix-class at trout.me.uk> wrote:

> John Napiorkowski wrote:
> > I got an answer to one more question before giving
> up
> > on this:
> > 
> > [big snip]
> > 
> >> I can't figure out what module/method that
> >> ...->new(\%new) is referring to.  It's not
> referring
> >> to the new method in ResultSet.pm but I can't
> trace
> >> it
> >> from here.
> > 
> > [another big snip]
> > 
> > Turns out that for the case given,
> > ResultSet::new_result appears to be calling
> > InflateColumn::new during the line in question:
> > 
> > [In ResultSet:new_result]
> > my $obj = $self->result_class->new(\%new); 
> > 
> > This InflateColumn::new is extending Row::new(). 
> > However it is InflateColumn::new that is calling
> > column_info("-and") and causing the program to
> die.
> 
> Bugger. If you can do me a failing test case against
> trunk we'll get it 
> fixed for the next release.
> 
> _______________________________________________
> List:
>
http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
> SVN:
>
http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.tar.gz
Type: application/gzip
Size: 2037 bytes
Desc: 3576997595-t.tar.gz
Url : http://lists.rawmode.org/pipermail/dbix-class/attachments/20060505/ba2ae3fb/attachment.bin 


More information about the Dbix-class mailing list