make cast expander stable
Matt S Trout [Tue, 27 Aug 2019 00:49:57 +0000 (00:49 +0000)]
lib/SQL/Abstract/ExtraClauses.pm

index a632896..c9b332a 100644 (file)
@@ -177,6 +177,7 @@ sub register_defaults {
     $self->clause_renderer("${stmt}.with", $with_renderer);
   }
   $self->expander(cast => sub {
+    return { -func => [ cast => $_[2] ] } if ref($_[2]) eq 'HASH';
     my ($cast, $to) = @{$_[2]};
     +{ -func => [ cast => { -as => [
       $self->expand_expr($cast),