Bug 16935 - launch export_records.pl with deleted_barcodes param fails
Summary: launch export_records.pl with deleted_barcodes param fails
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on: 14722
Blocks: 26175
  Show dependency treegraph
 
Reported: 2016-07-18 13:24 UTC by Stéphane Delaune
Modified: 2020-08-07 09:11 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16935 - launch export_records.pl with deleted_barcodes param fails (1.89 KB, patch)
2016-08-24 10:27 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 16935 - launch export_records.pl with deleted_barcodes param fails (1.95 KB, patch)
2016-10-14 08:31 UTC, Nicolas Legrand
Details | Diff | Splinter Review
Bug 16935 - launch export_records.pl with deleted_barcodes param fails (2.01 KB, patch)
2016-10-25 08:00 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Delaune 2016-07-18 13:24:29 UTC
when I launch /home/koha/src/misc/export_records.pl with this command line :

~/src/misc/export_records.pl --date=`date +%d/%m/%Y` --deleted_barcodes --filename=/home/koha/test

I've got this error message :

DBD::mysql::db selectall_arrayref failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 4 [for Statement " (
            SELECT DISTINCT barcode
            FROM deleteditems
            WHERE deleteditems.biblionumber = ?
        "] at /home/koha/src/misc/export_records.pl line 189.
Comment 1 Fridolin Somers 2016-08-24 10:27:01 UTC
Created attachment 54810 [details] [review]
Bug 16935 - launch export_records.pl with deleted_barcodes param fails

When launching misc/export_records.pl with this command line :

 misc/export_records.pl --date=`date +%d/%m/%Y` --deleted_barcodes --filename=/tmp/koha.mrc

You get this error message :

DBD::mysql::db selectall_arrayref failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 4 [for Statement " (
            SELECT DISTINCT barcode
            FROM deleteditems
            WHERE deleteditems.biblionumber = ?
        "] at misc/export_records.pl line 189.

This is because of a '(' after 'q|', looks like a typo.
Also, this patch removes useless var $q.

Test plan :
- Delete an item with barcode
- Without patch, run : misc/export_records.pl --date=`date +%d/%m/%Y` --deleted_barcodes --filename=/tmp/koha.mrc
=> You get dirty MySQL
- Without patch, run the same command
=> No error and the file is generated
Comment 2 Nicolas Legrand 2016-10-14 08:31:38 UTC
Created attachment 56478 [details] [review]
Bug 16935 - launch export_records.pl with deleted_barcodes param fails

When launching misc/export_records.pl with this command line :

 misc/export_records.pl --date=`date +%d/%m/%Y` --deleted_barcodes --filename=/tmp/koha.mrc

You get this error message :

DBD::mysql::db selectall_arrayref failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 4 [for Statement " (
            SELECT DISTINCT barcode
            FROM deleteditems
            WHERE deleteditems.biblionumber = ?
        "] at misc/export_records.pl line 189.

This is because of a '(' after 'q|', looks like a typo.
Also, this patch removes useless var $q.

Test plan :
- Delete an item with barcode
- Without patch, run : misc/export_records.pl --date=`date +%d/%m/%Y` --deleted_barcodes --filename=/tmp/koha.mrc
=> You get dirty MySQL
- Without patch, run the same command
=> No error and the file is generated

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Comment 3 Jonathan Druart 2016-10-25 08:00:43 UTC
Created attachment 56831 [details] [review]
Bug 16935 - launch export_records.pl with deleted_barcodes param fails

When launching misc/export_records.pl with this command line :

 misc/export_records.pl --date=`date +%d/%m/%Y` --deleted_barcodes --filename=/tmp/koha.mrc

You get this error message :

DBD::mysql::db selectall_arrayref failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 4 [for Statement " (
            SELECT DISTINCT barcode
            FROM deleteditems
            WHERE deleteditems.biblionumber = ?
        "] at misc/export_records.pl line 189.

This is because of a '(' after 'q|', looks like a typo.
Also, this patch removes useless var $q.

Test plan :
- Delete an item with barcode
- Without patch, run : misc/export_records.pl --date=`date +%d/%m/%Y` --deleted_barcodes --filename=/tmp/koha.mrc
=> You get dirty MySQL
- Without patch, run the same command
=> No error and the file is generated

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 4 Kyle M Hall 2016-10-28 11:45:13 UTC
Pushed to master for 16.11, thanks Frido!
Comment 5 Frédéric Demians 2016-11-02 18:16:50 UTC
Pushed in 16.05. Will be in 16.05.06.
Comment 6 Julian Maurice 2016-11-08 09:26:14 UTC
Pushed to 3.22.x, will be in 3.22.13