From: Matt S Trout Date: Thu, 19 Sep 2019 16:51:33 +0000 (+0000) Subject: make render_statement consistent with other render_ methods X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=21ad3e4bd0b2f6488e88407dd2d1a7e4916978a1;p=scpubgit%2FQ-Branch.git make render_statement consistent with other render_ methods --- diff --git a/lib/SQL/Abstract/Clauses.pm b/lib/SQL/Abstract/Clauses.pm index 88a3226..aae5782 100644 --- a/lib/SQL/Abstract/Clauses.pm +++ b/lib/SQL/Abstract/Clauses.pm @@ -220,9 +220,9 @@ sub render_aqt { sub render_statement { my ($self, $expr, $default_scalar_to) = @_; - $self->render_aqt( + @{$self->render_aqt( $self->expand_expr($expr, $default_scalar_to), 1 - ); + )}; } sub select { @@ -243,8 +243,8 @@ sub select { } }; - my $rendered = $self->render_statement({ -select => $stmt }); - return wantarray ? @$rendered : $rendered->[0]; + my @rendered = $self->render_statement({ -select => $stmt }); + return wantarray ? @rendered : $rendered[0]; } sub update { @@ -262,8 +262,8 @@ sub update { \%clauses; } }; - my $rendered = $self->render_statement({ -update => $stmt }); - return wantarray ? @$rendered : $rendered->[0]; + my @rendered = $self->render_statement({ -update => $stmt }); + return wantarray ? @rendered : $rendered[0]; } sub delete { @@ -277,8 +277,8 @@ sub delete { \%clauses; } }; - my $rendered = $self->render_statement({ -delete => $stmt }); - return wantarray ? @$rendered : $rendered->[0]; + my @rendered = $self->render_statement({ -delete => $stmt }); + return wantarray ? @rendered : $rendered[0]; } sub insert { @@ -292,8 +292,8 @@ sub insert { \%clauses; } }; - my $rendered = $self->render_statement({ -insert => $stmt }); - return wantarray ? @$rendered : $rendered->[0]; + my @rendered = $self->render_statement({ -insert => $stmt }); + return wantarray ? @rendered : $rendered[0]; } sub _expand_insert_clause_target {