[Bast-commits] r8102 -
DBIx-Class/0.08/branches/mssql_limit_regression/lib/DBIx/Class
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sat Dec 12 23:19:57 GMT 2009
Author: ribasushi
Date: 2009-12-12 23:19:57 +0000 (Sat, 12 Dec 2009)
New Revision: 8102
Modified:
DBIx-Class/0.08/branches/mssql_limit_regression/lib/DBIx/Class/ResultSet.pm
Log:
Fix corner case regression on search_related on a prefetching rs
Modified: DBIx-Class/0.08/branches/mssql_limit_regression/lib/DBIx/Class/ResultSet.pm
===================================================================
--- DBIx-Class/0.08/branches/mssql_limit_regression/lib/DBIx/Class/ResultSet.pm 2009-12-12 23:17:44 UTC (rev 8101)
+++ DBIx-Class/0.08/branches/mssql_limit_regression/lib/DBIx/Class/ResultSet.pm 2009-12-12 23:19:57 UTC (rev 8102)
@@ -2638,10 +2638,19 @@
||
$self->_has_resolved_attr (@force_subq_attrs)
) {
+ # Nuke the prefetch (if any) before the new $rs attrs
+ # are resolved (prefetch is useless - we are wrapping
+ # a subquery anyway).
+ my $rs_copy = $self->search;
+ $rs_copy->{attrs}{join} = $self->_merge_attr (
+ $rs_copy->{attrs}{join},
+ delete $rs_copy->{attrs}{prefetch},
+ );
+
$from = [{
-source_handle => $source->handle,
-alias => $attrs->{alias},
- $attrs->{alias} => $self->as_query,
+ $attrs->{alias} => $rs_copy->as_query,
}];
delete @{$attrs}{@force_subq_attrs, 'where'};
$seen->{-relation_chain_depth} = 0;
More information about the Bast-commits
mailing list