From: Matt S Trout Date: Sun, 17 Mar 2019 16:43:45 +0000 (+0000) Subject: default_scalar_to only needs to happen in expand_expr now X-Git-Tag: v2.000000~3^2~399 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d17a928237a77233680cc65ae2cd6b0760c3c39d;p=dbsrgits%2FSQL-Abstract.git default_scalar_to only needs to happen in expand_expr now --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 1f3bb3b..cb9ab3d 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -525,8 +525,7 @@ sub render_expr { } sub _expand_expr { - my ($self, $expr, $logic, $default_scalar_to) = @_; - local our $Default_Scalar_To = $default_scalar_to if $default_scalar_to; + my ($self, $expr, $logic) = @_; our $Expand_Depth ||= 0; local $Expand_Depth = $Expand_Depth + 1; return undef unless defined($expr); if (ref($expr) eq 'HASH') { @@ -577,7 +576,7 @@ sub _expand_expr { return +{ -literal => $literal }; } if (!ref($expr) or Scalar::Util::blessed($expr)) { - if (my $d = $Default_Scalar_To) { + if (my $d = our $Default_Scalar_To) { return $self->_expand_expr({ $d => $expr }); } if (my $m = our $Cur_Col_Meta) {