From af9a1f44788ded346d8510511d26a760d996ba14 Mon Sep 17 00:00:00 2001 From: "Martin Helmling martin.helmling@octosoft.eu" Date: Fri, 20 Jan 2017 09:44:19 +0100 Subject: [PATCH] =?utf8?q?Historien=20Suchmaschine:=20Stack=C3=BCberlauf?= =?utf8?q?=20vermeiden?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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, ... --- bin/mozilla/am.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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/; -- 2.20.1