[Bug 24148] New: black magic in Circulation/Returns.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24148 Bug ID: 24148 Summary: black magic in Circulation/Returns. Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org On the newly created job Koha_Master_D9_MDB_Latest: koha_1 | # Looks like you planned 2 tests but ran 1. koha_1 | koha_1 | # Failed test 'AddReturn logging on statistics table (item-level_itypes=0)' koha_1 | # at t/db_dependent/Circulation/Returns.t line 249. koha_1 | Can't call method "itemtype" on an undefined value at t/db_dependent/Circulation/Returns.t line 247. I recreate locally with this configuration (latest MariaDB version), and tried to debug: modified: t/db_dependent/Circulation/Returns.t @ Returns.t:245 @ subtest "AddReturn logging on statistics table (item-level_itypes=0)" => sub { branch => $branch, type => 'return', itemnumber => $item_without_itemtype->{ itemnumber } - }, { order_by => { -asc => 'datetime' } })->next(); + }, { order_by => { -asc => 'datetime' } }); + warn $stat->count; + $stat = $stat->next; is( $stat->itemtype, $blevel_itemtype, "biblio-level itype recorded on statistics for return"); }; subtest 'Handle ids duplication' => sub { Guess what? ->count returns 1 but ->next returns undef! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24148 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|black magic in |black magic in |Circulation/Returns. |Circulation/Returns.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24148 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 96153 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96153&action=edit Bug 24148: Using some black magic -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24148 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Recreated from the MariaDB CLI. MariaDB [koha_kohadev]> SELECT itemnumber, `type`, borrowernumber from statistics WHERE ( `itemnumber` = 1087 AND `type` = 'return' ); +------------+--------+----------------+ | itemnumber | type | borrowernumber | +------------+--------+----------------+ | 1087 | return | 122 | +------------+--------+----------------+ 1 row in set (0.00 sec) MariaDB [koha_kohadev]> SELECT itemnumber, borrowernumber, datetime from statistics WHERE ( `itemnumber` = 1087 AND `type` = 'return' ) ORDER BY `datetime` ASC; +------------+----------------+---------------------+ | itemnumber | borrowernumber | datetime | +------------+----------------+---------------------+ | 1087 | 122 | 2019-12-10 13:35:55 | +------------+----------------+---------------------+ 1 row in set (0.00 sec) MariaDB [koha_kohadev]> SELECT itemnumber, borrowernumber, datetime, type from statistics WHERE ( `itemnumber` = 1087 AND `type` = 'return' ) ORDER BY `datetime` ASC; +------------+----------------+---------------------+--------+ | itemnumber | borrowernumber | datetime | type | +------------+----------------+---------------------+--------+ | 1087 | 122 | 2019-12-10 13:35:55 | return | +------------+----------------+---------------------+--------+ 1 row in set (0.00 sec) MariaDB [koha_kohadev]> SELECT * from statistics WHERE ( `itemnumber` = 1087 AND `type` = 'return' ) ORDER BY `datetime` ASC; Empty set (0.00 sec) MariaDB [koha_kohadev]> SELECT * from statistics WHERE ( `itemnumber` = 1087 AND `type` = 'return' ) ORDER BY `itemnumber` ASC; +---------------------+-----------+--------+--------+-------+------------+----------+----------+----------------+----------------------------------------------------------------------------------+ | datetime | branch | value | type | other | itemnumber | itemtype | location | borrowernumber | ccode | +---------------------+-----------+--------+--------+-------+------------+----------+----------+----------------+----------------------------------------------------------------------------------+ | 2019-12-10 13:35:55 | iObbbKovf | 0.0000 | return | | 1087 | SgqzzzD | NULL | 122 | vghO1ljHGphe13fp_LDxGDhsYFQqTSEMJ3S2aQXYyK2gMVlo1Q3b3rpn_FQCEPKqlIgCv0iSHpc1tRdy | +---------------------+-----------+--------+--------+-------+------------+----------+----------+----------------+----------------------------------------------------------------------------------+ 1 row in set (0.00 sec) MariaDB [koha_kohadev]> SELECT * from statistics WHERE ( `itemnumber` = 1087 AND `type` = 'return' ) ORDER BY `datetime` ASC; Empty set (0.00 sec) MariaDB [koha_kohadev]> SELECT itemnumber, borrowernumber from statistics WHERE ( `itemnumber` = 1087 AND `type` = 'return' ) ORDER BY `datetime` ASC; +------------+----------------+ | itemnumber | borrowernumber | +------------+----------------+ | 1087 | 122 | +------------+----------------+ 1 row in set (0.00 sec) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24148 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- MariaDB [koha_kohadev]> SELECT `type`, `itemnumber` FROM `statistics` WHERE ( ( `branch` = 'iObbbKovf' AND `itemnumber` = 1087 AND `type` = 'return' ) ) ORDER BY `datetime` ASC; +--------+------------+ | type | itemnumber | +--------+------------+ | return | 1087 | +--------+------------+ 1 row in set (0.00 sec) MariaDB [koha_kohadev]> SELECT `type`, `itemnumber`, `other` FROM `statistics` WHERE ( ( `branch` = 'iObbbKovf' AND `itemnumber` = 1087 AND `type` = 'return' ) ) ORDER BY `datetime` ASC; Empty set (0.00 sec) MariaDB [koha_kohadev]> SELECT `type`, `itemnumber`, `borrowernumber` FROM `statistics` WHERE ( ( `branch` = 'iObbbKovf' AND `itemnumber` = 1087 AND `type` = 'return' ) ) ORDER BY `datetime` ASC; +--------+------------+----------------+ | type | itemnumber | borrowernumber | +--------+------------+----------------+ | return | 1087 | 122 | +--------+------------+----------------+ 1 row in set (0.00 sec) MariaDB [koha_kohadev]> SELECT `type`, `itemnumber`, `itemtype` FROM `statistics` WHERE ( ( `branch` = 'iObbbKovf' AND `itemnumber` = 1087 AND `type` = 'return' ) ) ORDER BY `datetime` ASC; +--------+------------+----------+ | type | itemnumber | itemtype | +--------+------------+----------+ | return | 1087 | SgqzzzD | +--------+------------+----------+ 1 row in set (0.00 sec) MariaDB [koha_kohadev]> SELECT `type`, `itemnumber`, `other` FROM `statistics` WHERE ( ( `branch` = 'iObbbKovf' AND `itemnumber` = 1087 AND `type` = 'return' ) ) ORDER BY `itemnumber` ASC; +--------+------------+-------+ | type | itemnumber | other | +--------+------------+-------+ | return | 1087 | | +--------+------------+-------+ 1 row in set (0.00 sec) MariaDB [koha_kohadev]> SELECT `type`, `itemnumber`, `other` FROM `statistics` WHERE ( ( `branch` = 'iObbbKovf' AND `itemnumber` = 1087 AND `type` = 'return' ) ) ORDER BY `borrowernumber` ASC; Empty set (0.00 sec) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24148 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24148 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|black magic in |black magic in |Circulation/Returns.t |Circulation/Returns.t | |(mariadb:latest - 10.4.11) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24148 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- This has been fixed in our CI between run 7 (Dec 10) and 8 (Dec 11) I do no longer recreate in a docker container with stretch and MariaDB 10.4.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24148 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|black magic in |black magic in |Circulation/Returns.t |Circulation/Returns.t |(mariadb:latest - 10.4.11) |(mariadb:latest - < | |10.4.11) --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #4)
This has been fixed in our CI between run 7 (Dec 10) and 8 (Dec 11)
I do no longer recreate in a docker container with stretch and MariaDB 10.4.11
Note that 10.4.11 has been released on Dec 11! https://mariadb.com/kb/en/library/mariadb-10411-release-notes/ -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org