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

--- Comment #17 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 200728
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200728&action=edit
Bug 37564: Fix double increment of record_number in bulkmarcimport.pl

$record_number was incremented twice for every record processed: once
unconditionally at the top of the RECORD loop and again inside the
"if ($record)" block that handles a successfully fetched record. The
duplicate increment was introduced by the refactoring in bug 29440.

This threw off everything keyed on the counter: the progress output, the
per-commitnum transaction batching and the --number limit (which could
be overshot when an odd limit never matched the doubled count).

Drop the unconditional increment so each record is counted exactly once,
inside the block that confirms a record was actually read.

Test plan:
1. Run a bulkmarcimport with --number set to an odd value, e.g.
     misc/migration_tools/bulkmarcimport.pl -b -m=MARCXML --number=3 \
       --file my_records.marcxml
2. Without this patch, note the reported count and that --number is not
   respected as expected.
3. Apply the patch.
4. Repeat the import and confirm exactly --number records are processed
   and the final "N MARC records done" count is correct.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to