bug 10559: remove spurious "statement handle still active" warnings
authorGalen Charlton <gmc@esilibrary.com>
Tue, 9 Jul 2013 17:53:16 +0000 (17:53 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 18 Jul 2013 15:29:07 +0000 (15:29 +0000)
commit2bab95cac5f43b034adec36ec62a8c8f7f520627
tree8fbd0b68a8f1d857ea1718944200d470119ec333
parentb77af9326232d8512527040c4984b7bdc167c388
bug 10559: remove spurious "statement handle still active" warnings

Generating (e.g.) overdue notices can result in spurious warnings in
the cronjob logs:

$ ./misc/cronjobs/overdue_notices.pl -t -library CPL
prepare_cached(SELECT * FROM issues WHERE     itemnumber = ?) statement handle DBI::st=HASH(0x54a7828) still Active at C4/Letters.pm line 589

This patch removes the warning by making sure that the relevant statement
handle is finished after fetching its first row of results.

To test:

[1] Set up an overdue loan such that running overdue_notices.pl will
    trigger the generation of a notice.
[2] Run overdue_notices.pl -t and note the warning message.
[3] Apply the patch.
[4] Run overdue_notices.pl -t again and note that the warning message
    is no longer displayed.
[5] Check the message_queue table and verify that the overdue
    notices generated in steps 2 and 4 have the same text.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/Letters.pm