[Koha-bugs] [Bug 27580] New: NULL values not correctly handled in Koha::Items->filter_by_visible_in_opac

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jan 29 20:39:48 CET 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27580

            Bug ID: 27580
           Summary: NULL values not correctly handled in
                    Koha::Items->filter_by_visible_in_opac
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: tomascohen at gmail.com
        QA Contact: testopia at bugs.koha-community.org

As pointed by @andrew on bug 15448, NULL values are not handled correctly here,
because NOT IN <LIST> considers NULL to be included in <LIST>:

MariaDB [koha_kohadev]> SELECT itemnumber,copynumber FROM items WHERE
itemnumber=1;
+------------+------------+
| itemnumber | copynumber |
+------------+------------+
|          1 | NULL       |
+------------+------------+
1 row in set (0.00 sec)

MariaDB [koha_kohadev]> SELECT itemnumber,copynumber FROM items WHERE
itemnumber=1 AND copynumber NOT IN (2);
Empty set (0.00 sec)

MariaDB [koha_kohadev]> UPDATE items SET copynumber=1 WHERE itemnumber=1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [koha_kohadev]> SELECT itemnumber,copynumber FROM items WHERE
itemnumber=1 AND copynumber NOT IN (2);
+------------+------------+
| itemnumber | copynumber |
+------------+------------+
|          1 | 1          |
+------------+------------+
1 row in set (0.00 sec)

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list