projects
/
NoSQL-toys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1643715
)
use offset for key for tables with primary key
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 14 Nov 2010 13:29:57 +0000
(14:29 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 14 Nov 2010 13:29:57 +0000
(14:29 +0100)
koha/koha2riak-search.pl
patch
|
blob
|
history
diff --git
a/koha/koha2riak-search.pl
b/koha/koha2riak-search.pl
index
6ce1867
..
c6ac166
100755
(executable)
--- a/
koha/koha2riak-search.pl
+++ b/
koha/koha2riak-search.pl
@@
-48,6
+48,7
@@
while(1) {
while (my $row = $sth->fetchrow_hashref() ) {
my $key = join('_', map { $row->{$_} } @pk);
+ $key ||= "o.$offset";
my $biblionumber = $row->{biblionumber};
if ( my $marcxml = delete $row->{marcxml} ) {
@@
-69,9
+70,10
@@
while(1) {
}
$riak->request( 'PUT' => "/koha.$table/$key", $row, $headers );
+
+ $offset++;
}
- $offset += $sth->rows;
last if $sth->rows < $batch_size;
}