Cleanup ResultSourceHandle handling after M.A.D. introduction
[dbsrgits/DBIx-Class-Historic.git] / lib / DBIx / Class / Storage / DBI.pm
index 494161d..4e2d2b9 100644 (file)
@@ -2025,7 +2025,7 @@ sub _select_args {
     from => $ident,
     where => $where,
     $rs_alias && $alias2source->{$rs_alias}
-      ? ( _rsroot_source_handle => $alias2source->{$rs_alias}->handle )
+      ? ( _rsroot_rsrc => $alias2source->{$rs_alias} )
       : ()
     ,
   };
@@ -2087,9 +2087,7 @@ sub _select_args {
         &&
       @{$attrs->{group_by}}
         &&
-      $attrs->{_prefetch_select}
-        &&
-      @{$attrs->{_prefetch_select}}
+      $attrs->{_prefetch_selector_range}
     )
   ) {
     ($ident, $select, $where, $attrs)
@@ -2822,11 +2820,7 @@ sub _max_column_bytesize {
         $max_size = $inf->{size} * 4 if $inf->{size};
       }
       # Blob types
-      elsif ($data_type =~ /(?:blob|clob|bfile|text|image|bytea)/
-          || $data_type =~ /^long(?:\s*(?:raw|bit\s*varying|varbit|binary
-                                        |varchar|character\s*varying|nvarchar
-                                        |national\s*character\s*varying))?$/
-      ) {
+      elsif ($self->_is_lob_type($data_type)) {
         # default to longreadlen
       }
       else {
@@ -2838,6 +2832,15 @@ sub _max_column_bytesize {
   };
 }
 
+# Determine if a data_type is some type of BLOB
+sub _is_lob_type {
+  my ($self, $data_type) = @_;
+  $data_type && ($data_type =~ /(?:lob|bfile|text|image|bytea|memo)/i
+    || $data_type =~ /^long(?:\s*(?:raw|bit\s*varying|varbit|binary
+                                  |varchar|character\s*varying|nvarchar
+                                  |national\s*character\s*varying))?$/xi);
+}
+
 1;
 
 =head1 USAGE NOTES