From: Rob Kinyon Date: Sun, 1 Mar 2009 03:46:19 +0000 (+0000) Subject: Added comment to describe the proposed fix in the test X-Git-Tag: v0.08240~53 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ff57f45bf455ea502418094f56c849eef3cac909;p=dbsrgits%2FDBIx-Class.git Added comment to describe the proposed fix in the test --- diff --git a/t/98rows_prefetch.t b/t/98rows_prefetch.t index 8619c13..10bc2a9 100644 --- a/t/98rows_prefetch.t +++ b/t/98rows_prefetch.t @@ -10,6 +10,7 @@ use DBICTest; plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 2); my $schema = DBICTest->init_schema(); +$schema->storage->debug(1); my $no_prefetch = $schema->resultset('Artist')->search( undef, { rows => 3 } @@ -28,6 +29,12 @@ my $use_prefetch_count = 0; is($no_prefetch->count, $use_prefetch->count, '$no_prefetch->count == $use_prefetch->count'); +# The fix is to, when using prefetch, take the query and put it into a subquery +# joined to the tables we're prefetching from. This might result in the same +# table being joined once in the main subquery and once in the main query. This +# may actually resolve other, unknown edgecase bugs. It is also the right way +# to do prefetching. Optimizations can come later. + TODO: { local $TODO = "This is a difficult bug to fix, workaround is not to use prefetch with rows"; $no_prefetch_count++ while $no_prefetch->next;