Sometimes _prepare_for_execute may not return a set of bind vars - guard against...
Peter Rabbitson [Thu, 14 May 2009 10:12:44 +0000 (10:12 +0000)]
lib/DBIx/Class/Storage/DBI/Cursor.pm
lib/DBIx/Class/Storage/DBI/NoBindVars.pm

index 0fe570f..ddad661 100644 (file)
@@ -72,7 +72,7 @@ sub as_query {
 
   my @args = $storage->_select_args(@{$self->{args}});
   my ($sql, $bind)  = $storage->_prep_for_execute(@args[0 .. 2], [@args[4 .. $#args]]);
-  return \[ "($sql)", @$bind ];
+  return \[ "($sql)", @{ $bind || [] }];
 }
 
 =head2 next
index 349f658..7027ad6 100644 (file)
@@ -61,7 +61,7 @@ sub _prep_for_execute {
   }
   $new_sql .= join '', @sql_part;
 
-  return ($new_sql);
+  return ($new_sql, []);
 }
 
 =head1 AUTHORS