]> git.koha-community.org Git - koha.git/commit
Bug 27808: (QA follow-up) Make sure the update catches the items we want
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 1 Mar 2021 14:56:23 +0000 (11:56 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 2 Mar 2021 08:03:36 +0000 (09:03 +0100)
commit8df3e02885f94ef8a6f960f693c398b6646daf09
tree41d783aab19d21d5d47f57502f1e20fe5c14dc37
parentaa41987dbfebcd61e1a7b5847095f55261c55d5e
Bug 27808: (QA follow-up) Make sure the update catches the items we want

This query:

SELECT *
FROM items
LEFT JOIN issues
ON issues.itemnumber=items.itemnumber
WHERE items.onloan IS NULL;

returns 961 rows on the sample data, with 2 items checked out and onloan
set to NULL.

With this tweak, the query only matches the 2 checkout items with onloan
set to NULL:

SELECT *
FROM items
LEFT JOIN issues
ON issues.itemnumber=items.itemnumber
WHERE items.onloan IS NULL AND issues.issue_id IS NOT NULL;

This is the query that needs to be used on the atomic update for
filtering the items to be updated.

This patch does that.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
installer/data/mysql/updatedatabase.pl