Summary: | (38408 follow-up) Additional fixes in rebuild_zebra.pl and koha-rebuild-zebra | ||
---|---|---|---|
Product: | Koha | Reporter: | Marcel de Rooy <m.de.rooy> |
Component: | Command-line Utilities | Assignee: | Marcel de Rooy <m.de.rooy> |
Status: | NEW --- | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | dcook, robin |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 38408 | ||
Bug Blocks: |
Description
Marcel de Rooy
2024-11-12 14:46:16 UTC
TODO Remove obsoleted variable during dev process: +my $chunk_size = 100000; For the purists: + $offset ||= 0; + $length ||= ( $record_type eq 'biblio' ? Koha::Biblios->count : Koha::Authorities->count ); We should probably better do //= here. This will make -length 0 do nothing (which is useless, but anyway..). Check on a negative offset too? TODO + export_marc_records_from_sth( $record_type, $sth, "$directory", $nosanitize, $seq ); + $pm->finish; # exit for child only + } + $offset += $chunk_size; + $num_records_exported += $chunk_size; Do not assume chunk_size to be equal to exported record count. Here we need to pass back info from the child process to the parent. Since this complicates the base report, we should do it later. In daily life this wont hurt. TODO Resolve inconsistency in current code when using length/offset sub select_all_authorities { $strsth.=qq{ LIMIT $length } if ($length && !$offset); $strsth.=qq{ LIMIT $offset,$length } if ($length && $offset); sub select_all_biblios { $strsth.=qq{ LIMIT $length } if ($length && !$offset); $strsth.=qq{ LIMIT $offset,$length } if ($offset); (In reply to Marcel de Rooy from comment #3) > TODO Resolve inconsistency in current code when using length/offset > > sub select_all_authorities { > $strsth.=qq{ LIMIT $length } if ($length && !$offset); > $strsth.=qq{ LIMIT $offset,$length } if ($length && $offset); > > > sub select_all_biblios { > $strsth.=qq{ LIMIT $length } if ($length && !$offset); > $strsth.=qq{ LIMIT $offset,$length } if ($offset); Awful but passing an offset without a limit requires something like 2^64-1: SELECT * FROM somewhere LIMIT 18446744073709551615 OFFSET 5 Surely we can pass the total number of records here like: + $length ||= ( $record_type eq 'biblio' ? Koha::Biblios->count : Koha::Authorities->count ); |