From: Martin Helmling martin.helmling@octosoft.eu Date: Fri, 20 Jan 2017 08:44:19 +0000 (+0100) Subject: Historien Suchmaschine: Stacküberlauf vermeiden X-Git-Tag: release-3.5.4~1680 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=af9a1f44788ded346d8510511d26a760d996ba14;p=kivitendo-erp.git Historien Suchmaschine: Stacküberlauf vermeiden Die Fehlermeldung 'DBD::Pg::st execute failed: ERROR: stack depth limit exceeded' wird durch Anpassung des queries vermieden statt: WHERE (trans_id = 2088 OR trans_id=2090 OR trans_id=2092 ... (10000 fach) nun: WHERE (trans_id = 2088 OR trans_id IN (2090,2092,2094, ... --- diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index cf5eeb13c..af30987e8 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -1257,8 +1257,9 @@ sub show_am_history { my @ids = grep { $_ * 1 } selectall_array_query($form, $dbh, $query); my $daten .= shift @ids; - $daten .= join '', map { " OR trans_id = $_" } @ids; - + if (scalar(@ids) > 0 ) { + $daten .= ' OR trans_id IN (' . join(',', @ids) . ')'; + } my ($sort, $sortby) = split(/\-\-/, $form->{order}); $sort =~ s/.*\.(.*)$/$1/;