the "root" columns are in fact injected from the right rs side
- Fix the join optimizer to correctly preserve the non-multi path to
a multi relationship ( x -> might_have y -> has_many z )
+ - Fix object-derived custom-relationship resultsets to resultsources
+ with multilevel monikers (e.g. $schema->source('Foo::Bar') )
* Misc
- Rewire all warnings to a new Carp-like implementation internal
# root alias as 'me', instead of $rel (as opposed to invoking
# $rs->search_related)
-
local $source->{_relationships}{me} = $source->{_relationships}{$rel}; # make the fake 'me' rel
my $obj_table_alias = lc($source->source_name) . '__row';
+ $obj_table_alias =~ s/\W+/_/g;
$source->resultset->search(
$self->ident_condition($obj_table_alias),
],
]
);
+
+# re-test with ::-containing moniker name
+# (we don't have any currently, so fudge it with lots of local() )
+{
+ local $schema->source('Artist')->{source_name} = 'Ar::Tist';
+ local $artist2->{related_resultsets};
+
+ is_same_sql_bind(
+ $artist2->cds_90s->as_query,
+ '(
+ SELECT me.cdid, me.artist, me.title, me.year, me.genreid, me.single_track
+ FROM artist ar_tist__row
+ JOIN cd me
+ ON ( me.artist = ar_tist__row.artistid AND ( me.year < ? AND me.year > ? ) )
+ WHERE ( ar_tist__row.artistid = ? )
+ )',
+ [
+ [
+ { sqlt_datatype => 'varchar', sqlt_size => 100, dbic_colname => 'me.year' }
+ => 2000
+ ],
+ [
+ { sqlt_datatype => 'varchar', sqlt_size => 100, dbic_colname => 'me.year' }
+ => 1989
+ ],
+ [ { sqlt_datatype => 'integer', dbic_colname => 'ar_tist__row.artistid' }
+ => 22
+ ],
+ ]
+ );
+}
+
+
my @cds_90s = $cds_90s_rs->all;
is(@cds_90s, 6, '6 90s cds found (1990 - 1995) even with non-optimized search');
map { ok($_->year < 2000 && $_->year > 1989) } @cds_90s;