Move prefetch selector injection a bit further down in rsattr resolution
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / ResultSource / RowParser.pm
index 704ebf8..107a53f 100644 (file)
@@ -8,7 +8,6 @@ use base 'DBIx::Class';
 
 use Try::Tiny;
 use List::Util qw(first max);
-use B 'perlstring';
 
 use DBIx::Class::ResultSource::RowParser::Util qw(
   assemble_simple_parser
@@ -93,7 +92,7 @@ sub _resolve_prefetch {
 # any sort of adjustment/rewrite should be relatively easy (fsvo relatively)
 #
 sub _mk_row_parser {
-  # $args and $attrs are seperated to delineate what is core collapser stuff and
+  # $args and $attrs are separated to delineate what is core collapser stuff and
   # what is dbic $rs specific
   my ($self, $args, $attrs) = @_;
 
@@ -137,6 +136,9 @@ sub _mk_row_parser {
     });
   };
 
+  utf8::upgrade($src)
+    if DBIx::Class::_ENV_::STRESSTEST_UTF8_UPGRADE_GENERATED_COLLAPSER_SOURCE;
+
   return (
     $args->{eval} ? ( eval "sub $src" || die $@ ) : $src,
     $check_null_columns,
@@ -243,7 +245,7 @@ sub _resolve_collapse {
       if $args->{_parent_info}{collapser_reusable};
   }
 
-  # Still dont know how to collapse - try to resolve based on our columns (plus already inserted FK bridges)
+  # Still don't know how to collapse - try to resolve based on our columns (plus already inserted FK bridges)
   if (
     ! $collapse_map->{-identifying_columns}
       and
@@ -364,7 +366,7 @@ sub _resolve_collapse {
       # if we got here - we are good to go, but the construction is tricky
       # since our children will want to include our collapse criteria - we
       # don't give them anything (safe, since they are all collapsible on their own)
-      # in addition we record the individual collapse posibilities
+      # in addition we record the individual collapse possibilities
       # of all left children node collapsers, and merge them in the rowparser
       # coderef later
       $collapse_map->{-identifying_columns} = [];