Bugzilla – Attachment 85573 Details for
Bug 20485
Don't account for items timestamps when combining "dont_export_items=1" and "date" in misc/export_records.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20485: Don't account for items timestamps when items not included
Bug-20485-Dont-account-for-items-timestamps-when-i.patch (text/plain), 3.12 KB, created by
Maryse Simard
on 2019-02-22 19:20:43 UTC
(
hide
)
Description:
Bug 20485: Don't account for items timestamps when items not included
Filename:
MIME Type:
Creator:
Maryse Simard
Created:
2019-02-22 19:20:43 UTC
Size:
3.12 KB
patch
obsolete
>From 4971d15cc321424a61554a984b1fad0a946a523b Mon Sep 17 00:00:00 2001 >From: David Gustafsson <david.gustafsson@ub.gu.se> >Date: Fri, 23 Mar 2018 17:32:30 +0100 >Subject: [PATCH] Bug 20485: Don't account for items timestamps when items not > included > >If combining "--dont_export_items" and "--date" options >in export_records.pl, don't include items modification/deletion >timestamp in biblio query conditions. > >How to test: >1) Delete or modify a biblio item. >2) Run export_records.pl with "--dont_export_items" and "--date" > options with a date value before item was deleted or modified, > but after the biblio was modified. >3) The biblio for which an item was changed should not be included in > the export. > >Sponsored-by: Gothenburg University Library >Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> >--- > misc/export_records.pl | 40 +++++++++++++++++++++++++--------------- > 1 file changed, 25 insertions(+), 15 deletions(-) > >diff --git a/misc/export_records.pl b/misc/export_records.pl >index a1eecc8..857b27c 100755 >--- a/misc/export_records.pl >+++ b/misc/export_records.pl >@@ -142,21 +142,31 @@ $timestamp = ($timestamp) ? output_pref({ dt => dt_from_string($timestamp), date > > if ( $record_type eq 'bibs' ) { > if ( $timestamp ) { >- push @record_ids, $_->{biblionumber} for @{ >- $dbh->selectall_arrayref(q| ( >- SELECT biblio_metadata.biblionumber >- FROM biblio_metadata >- LEFT JOIN items USING(biblionumber) >- WHERE biblio_metadata.timestamp >= ? >- OR items.timestamp >= ? >- ) UNION ( >- SELECT biblio_metadata.biblionumber >- FROM biblio_metadata >- LEFT JOIN deleteditems USING(biblionumber) >- WHERE biblio_metadata.timestamp >= ? >- OR deleteditems.timestamp >= ? >- ) |, { Slice => {} }, ( $timestamp ) x 4 ); >- }; >+ if (!$dont_export_items) { >+ push @record_ids, $_->{biblionumber} for @{ >+ $dbh->selectall_arrayref(q| ( >+ SELECT biblio_metadata.biblionumber >+ FROM biblio_metadata >+ LEFT JOIN items USING(biblionumber) >+ WHERE biblio_metadata.timestamp >= ? >+ OR items.timestamp >= ? >+ ) UNION ( >+ SELECT biblio_metadata.biblionumber >+ FROM biblio_metadata >+ LEFT JOIN deleteditems USING(biblionumber) >+ WHERE biblio_metadata.timestamp >= ? >+ OR deleteditems.timestamp >= ? >+ ) |, { Slice => {} }, ( $timestamp ) x 4 ); >+ }; >+ } else { >+ push @record_ids, $_->{biblionumber} for @{ >+ $dbh->selectall_arrayref(q| ( >+ SELECT biblio_metadata.biblionumber >+ FROM biblio_metadata >+ WHERE biblio_metadata.timestamp >= ? >+ ) |, { Slice => {} }, $timestamp ); >+ }; >+ } > } else { > my $conditions = { > ( $starting_biblionumber or $ending_biblionumber ) >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20485
:
73378
|
73380
|
75112
|
85239
|
85573
|
89306