[Bast-commits] r3572 - in trunk/DBIx-Class: . lib/DBIx/Class t
captainL at dev.catalyst.perl.org
captainL at dev.catalyst.perl.org
Mon Jul 9 11:40:46 GMT 2007
Author: captainL
Date: 2007-07-09 11:40:46 +0100 (Mon, 09 Jul 2007)
New Revision: 3572
Modified:
trunk/DBIx-Class/Changes
trunk/DBIx-Class/lib/DBIx/Class/ResultSetColumn.pm
trunk/DBIx-Class/t/88result_set_column.t
Log:
updated changes. fixed ResultSetColumn w/prefetch problem
Modified: trunk/DBIx-Class/Changes
===================================================================
--- trunk/DBIx-Class/Changes 2007-07-04 22:03:59 UTC (rev 3571)
+++ trunk/DBIx-Class/Changes 2007-07-09 10:40:46 UTC (rev 3572)
@@ -5,6 +5,9 @@
with debian packaging
- Patch to fix ? in data for NoBindVars (from Tom Hukins)
- Restored mk_classaccessor method for compatibility
+ - Fixed group_by problem with oracle limit syntax
+ - Fixed attr merging problem
+ - Fixed $rs->get_column w/prefetch problem
0.08002 2007-06-20 06:10:00
- add scope guard to Row::insert to ensure rollback gets called
Modified: trunk/DBIx-Class/lib/DBIx/Class/ResultSetColumn.pm
===================================================================
--- trunk/DBIx-Class/lib/DBIx/Class/ResultSetColumn.pm 2007-07-04 22:03:59 UTC (rev 3571)
+++ trunk/DBIx-Class/lib/DBIx/Class/ResultSetColumn.pm 2007-07-09 10:40:46 UTC (rev 3572)
@@ -35,7 +35,9 @@
sub new {
my ($class, $rs, $column) = @_;
$class = ref $class if ref $class;
- my $new = bless { _column => $column, _parent_resultset => $rs }, $class;
+ my $new_parent_rs = $rs->search_rs; # we don't want to mess up the original, so clone it
+ $new_parent_rs->{attrs}->{prefetch} = undef; # prefetch causes additional columns to be fetched
+ my $new = bless { _column => $column, _parent_resultset => $new_parent_rs }, $class;
$new->throw_exception("column must be supplied") unless $column;
return $new;
}
Modified: trunk/DBIx-Class/t/88result_set_column.t
===================================================================
--- trunk/DBIx-Class/t/88result_set_column.t 2007-07-04 22:03:59 UTC (rev 3571)
+++ trunk/DBIx-Class/t/88result_set_column.t 2007-07-09 10:40:46 UTC (rev 3572)
@@ -7,7 +7,7 @@
my $schema = DBICTest->init_schema();
-plan tests => 8;
+plan tests => 9;
my $cd;
my $rs = $cd = $schema->resultset("CD")->search({});
@@ -42,3 +42,8 @@
ok(defined($psrs->get_column('count')), '+select/+as arrayref count');
ok(defined($psrs->get_column('addedtitle')), '+select/+as title');
+{
+ my $rs = $schema->resultset("CD")->search({}, { prefetch => 'artist' });
+ my $rsc = $rs->get_column('year');
+ is( $rsc->{_parent_resultset}->{attrs}->{prefetch}, undef, 'prefetch wiped' );
+}
More information about the Bast-commits
mailing list