From: Matt S Trout Date: Thu, 18 Apr 2019 18:34:52 +0000 (+0000) Subject: improve infinite recursion debugging, fix infinite recursion bug X-Git-Tag: v2.000000~3^2~197 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b9e452e4df9c70000c671713211728f0243c9e39;p=dbsrgits%2FSQL-Abstract.git improve infinite recursion debugging, fix infinite recursion bug --- diff --git a/lib/SQL/Abstract/Clauses.pm b/lib/SQL/Abstract/Clauses.pm index 4379c6c..5fd0fdd 100644 --- a/lib/SQL/Abstract/Clauses.pm +++ b/lib/SQL/Abstract/Clauses.pm @@ -48,13 +48,13 @@ sub register_defaults { $self->{expand_clause}{'insert.target'} = '_expand_insert_clause_target'; $self->{expand_clause}{'insert.fields'} = sub { return +{ -row => [ - shift->_expand_maybe_list_expr($_[2], -ident) + $_[0]->_expand_maybe_list_expr($_[2], -ident) ] } if ref($_[2]) eq 'ARRAY'; return $_[2]; # should maybe still expand somewhat? }; $self->{expand_clause}{'insert.values'} = '_expand_insert_clause_values'; $self->{expand_clause}{'insert.returning'} = sub { - shift->_expand_maybe_list_expr(@_, -ident); + $_[0]->_expand_maybe_list_expr($_[2], -ident); }; $self->{render_clause}{'insert.fields'} = sub { return $_[0]->render_aqt($_[2]); diff --git a/t/01generate.t b/t/01generate.t index 87bce6a..16f4d0d 100644 --- a/t/01generate.t +++ b/t/01generate.t @@ -863,7 +863,13 @@ for my $t (@tests) { } else { lives_ok(sub { - alarm(5); local $SIG{ALRM} = sub { die "Timed out" }; + alarm(1); local $SIG{ALRM} = sub { + no warnings 'redefine'; + my $orig = Carp->can('caller_info'); + local *Carp::caller_info = sub { return if $_[0] > 20; &$orig }; + print STDERR "ARGH ($SQL::Abstract::Default_Scalar_To): ".Carp::longmess(); + die "timed out"; + }; warnings_like( sub { $cref->() }, $t->{warns} || [],