From af6756b86c0d800e5e95638c455525eddf44d22c Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 26 Aug 2013 15:57:39 +0200 Subject: [PATCH] AM.pm::get_warehouse: keinen teuren Cross Join MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Ein Cross Join wird nicht benötigt, weil nur die Existenz einer Zeile in mind. einer der beiden relevanten Tabellen interessant ist. Das auch entsprechend coden. Fixt #2359. --- SL/AM.pm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/SL/AM.pm b/SL/AM.pm index 5764c6a3e..adb240d28 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -1900,15 +1900,14 @@ sub get_warehouse { map { $form->{$_} = $ref->{$_} } keys %{ $ref }; - $query = qq|SELECT b.*, EXISTS - (SELECT i.warehouse_id, p.warehouse_id - FROM inventory i, parts p - WHERE i.bin_id = b.id - OR p.bin_id = b.id - LIMIT 1) - AS in_use - FROM bin b - WHERE b.warehouse_id = ?|; + $query = <{BINS} = selectall_hashref_query($form, $dbh, $query, conv_i($form->{id})); -- 2.20.1