[Bast-commits] r5671 - DBIx-Class/0.08/branches/prefetch/t
robkinyon at dev.catalyst.perl.org
robkinyon at dev.catalyst.perl.org
Sun Mar 1 03:46:19 GMT 2009
Author: robkinyon
Date: 2009-03-01 03:46:19 +0000 (Sun, 01 Mar 2009)
New Revision: 5671
Modified:
DBIx-Class/0.08/branches/prefetch/t/98rows_prefetch.t
Log:
Added comment to describe the proposed fix in the test
Modified: DBIx-Class/0.08/branches/prefetch/t/98rows_prefetch.t
===================================================================
--- DBIx-Class/0.08/branches/prefetch/t/98rows_prefetch.t 2009-03-01 00:54:09 UTC (rev 5670)
+++ DBIx-Class/0.08/branches/prefetch/t/98rows_prefetch.t 2009-03-01 03:46:19 UTC (rev 5671)
@@ -10,6 +10,7 @@
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 @@
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;
More information about the Bast-commits
mailing list