# first deleted records ($deleted == 1), then normal records ($deleted == 0)
STAGELOOP:
for ( ; $deleted >= 0; $deleted-- ) {
- my $table = $deleted ? 'deletedbiblioitems' : 'biblioitems';
+ my $table = $deleted ? 'deletedbiblio_metadata' : 'biblio_metadata';
my $sql = "
SELECT biblionumber
FROM $table
$sql = "
SELECT MAX(timestamp)
FROM (
- SELECT timestamp FROM deletedbiblioitems WHERE biblionumber = ?
+ SELECT timestamp FROM deletedbiblio_metadata WHERE biblionumber = ?
UNION
SELECT timestamp FROM deleteditems WHERE biblionumber = ?
) bis
$sql = "
SELECT MAX(timestamp)
FROM (
- SELECT timestamp FROM biblioitems WHERE biblionumber = ?
+ SELECT timestamp FROM biblio_metadata WHERE biblionumber = ?
UNION
SELECT timestamp FROM deleteditems WHERE biblionumber = ?
UNION
$sth->execute($biblionumber);
my $timestamp = $sth->fetchrow_array . 'Z';
$timestamp =~ s/ /T/;
- $timestamp = manipulate_timestamp( $index, $biblionumber, $timestamp );
$record = GetMarcBiblio({ biblionumber => $biblionumber });
$record = XMLin($record->as_xml_record);
push @header, { datestamp => $timestamp, identifier => "TEST:$biblionumber" };
my $record = GetMarcBiblio({biblionumber => $biblionumber});
$record->append_fields(MARC::Field->new(999, '', '', z => '_'));
ModBiblio($record, $biblionumber);
+ $oaidc[0]->{header}->{datestamp} = $from;
test_query(
'ListRecords oai_dc with parameter from',
};
$schema->storage->txn_rollback;
-
-sub manipulate_timestamp {
-# This eliminates waiting a few seconds in order to get a higher timestamp
-# Works only for 60 records..
- my ( $index, $bibno, $timestamp ) = @_;
- return $timestamp if $timestamp !~ /\d{2}Z/;
- my $secs = sprintf( "%02d", $index );
- $timestamp =~ s/\d{2}Z/${secs}Z/;
- $dbh->do("UPDATE biblioitems SET timestamp=? WHERE biblionumber=?", undef,
- ( $timestamp, $bibno ));
- return $timestamp;
-}