projects
/
Biblio-Z3950.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2adc200
)
deduplicate
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 14 Dec 2016 18:10:10 +0000
(19:10 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 14 Dec 2016 18:10:10 +0000
(19:10 +0100)
CROSBI.pm
patch
|
blob
|
history
diff --git
a/CROSBI.pm
b/CROSBI.pm
index
764430b
..
6164e52
100644
(file)
--- a/
CROSBI.pm
+++ b/
CROSBI.pm
@@
-63,7
+63,7
@@
sub search {
my $sql = qq{
-select *
+select
distinct
*
from $table
inner join rad_ustanova using (id)
left outer join rad_napomena using (id)
@@
-175,6
+175,13
@@
sub next_marc {
my $row = $sth->fetchrow_hashref;
+ while ( $self->{_deduplicate}->{ $row->{id} } ) {
+ warn "DUPLICATE $row->{id}, skipping\n";
+ $row = $sth->fetchrow_hashref;
+ return unless $row;
+ }
+ $self->{_deduplicate}->{ $row->{id} }++;
+
die "no row" unless $row;
my $id = $row->{id} || die "no id";