From e547b2f02d444a6a721bc76f1027c2e8991906b4 Mon Sep 17 00:00:00 2001 From: Andrew Nugged Date: Wed, 13 Oct 2021 16:49:11 +0300 Subject: [PATCH] Bug 20447: (QA follow-up) Unify SQL queries formatting --- Koha/OAI/Server/ListBase.pm | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Koha/OAI/Server/ListBase.pm b/Koha/OAI/Server/ListBase.pm index d552bb0245..fa4c4d2951 100644 --- a/Koha/OAI/Server/ListBase.pm +++ b/Koha/OAI/Server/ListBase.pm @@ -90,16 +90,14 @@ sub GetRecords { # but avoiding joins or subqueries makes this so much faster that it does not matter. if ( $include_items && !$deleted ) { $sql = " - (SELECT biblionumber - FROM $table main - WHERE $where $order_limit) + (SELECT biblionumber FROM $table main WHERE $where $order_limit) UNION - (SELECT DISTINCT(biblionumber) FROM deleteditems main JOIN biblio USING (biblionumber) WHERE $where - $order_limit) + (SELECT DISTINCT(biblionumber) FROM deleteditems main JOIN biblio USING (biblionumber) WHERE $where $order_limit) UNION (SELECT DISTINCT(biblionumber) FROM holdings main WHERE $where $order_limit) UNION - (SELECT DISTINCT(biblionumber) FROM items main WHERE $where $order_limit)"; + (SELECT DISTINCT(biblionumber) FROM items main WHERE $where $order_limit) + "; push @bind_params, @part_bind_params; push @bind_params, @part_bind_params; push @bind_params, @part_bind_params; @@ -119,9 +117,7 @@ sub GetRecords { "; } else { $sql = " - SELECT biblionumber - FROM $table main - WHERE $where + SELECT biblionumber FROM $table main WHERE $where "; $ts_sql = "SELECT max(timestamp) FROM $table WHERE biblionumber = ?"; -- 2.33.0