Koha-clms/misc/migration_tools
Thomas Klausner 01d36c5e8b
Bug 37020: (follow-up) Fix txn handling, loop label and record_number counter
So, I reviewed the code, which has a bunch of issues:

* there's a call to `next RECORD`, but no `RECORD` loop label.
* $record_number is incremented twice
* and the calls to txn_begin is moved from the outside the loop into each record, starting one transaction per record. Not sure how mysql handles this, but postgres would not like it.

This patch fixes those issues:

After I fixed the first two issues, I ran the patched script on a file containing 75 authorities (from GND), and not one was added to the DB, presuambly because nested transactions don't work in mysql?

So I also moved the BEGIN transaction outside of the main loop and started a new one after each commit, and added a final commit after to loop.

Signed-off-by: Jan Kissig <bibliothek@th-wildau.de>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-12 18:31:11 +02:00
..
22_to_30 Bug 39325: Manual fixes 2025-04-28 18:51:23 +02:00
ifla Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
buildCOUNTRY.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
buildEDITORS.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
buildLANG.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
build_oai_sets.pl Bug 39325: Manual fixes 2025-04-28 18:51:23 +02:00
bulkmarcimport.pl Bug 37020: (follow-up) Fix txn handling, loop label and record_number counter 2025-05-12 18:31:11 +02:00
checkNonIndexedBiblios.pl Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
create_analytical_rel.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
import_lexile.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
koha-svc.pl Bug 39319: Fix POD for misc/migration_tools/koha-svc.pl 2025-04-14 08:51:20 +02:00
rebuild_zebra.pl Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
rebuild_zebra_sliced.sh Bug 13660: Exclude export phase and use existing exported MARCXML - rebuild_zebra_sliced.sh 2018-01-09 17:23:50 -03:00
remove_unused_authorities.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
switch_marc21_series_info.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
upgradeitems.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00