From: Peter Rabbitson Date: Thu, 14 May 2009 10:12:44 +0000 (+0000) Subject: Sometimes _prepare_for_execute may not return a set of bind vars - guard against... X-Git-Tag: v0.08103~85 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=01c04b1b0550aeacf3e3214d687a1d056739c699;p=dbsrgits%2FDBIx-Class.git Sometimes _prepare_for_execute may not return a set of bind vars - guard against that --- diff --git a/lib/DBIx/Class/Storage/DBI/Cursor.pm b/lib/DBIx/Class/Storage/DBI/Cursor.pm index 0fe570f..ddad661 100644 --- a/lib/DBIx/Class/Storage/DBI/Cursor.pm +++ b/lib/DBIx/Class/Storage/DBI/Cursor.pm @@ -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 diff --git a/lib/DBIx/Class/Storage/DBI/NoBindVars.pm b/lib/DBIx/Class/Storage/DBI/NoBindVars.pm index 349f658..7027ad6 100644 --- a/lib/DBIx/Class/Storage/DBI/NoBindVars.pm +++ b/lib/DBIx/Class/Storage/DBI/NoBindVars.pm @@ -61,7 +61,7 @@ sub _prep_for_execute { } $new_sql .= join '', @sql_part; - return ($new_sql); + return ($new_sql, []); } =head1 AUTHORS