Bugzilla – Attachment 34750 Details for
Bug 12368
Rebuild Zebra improvement: allow to specify a DB table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12368: Die if the --table value is not allowed.
Bug-12368-Die-if-the---table-value-is-not-allowed.patch (text/plain), 1.61 KB, created by
Chris Cormack
on 2014-12-28 07:06:28 UTC
(
hide
)
Description:
Bug 12368: Die if the --table value is not allowed.
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2014-12-28 07:06:28 UTC
Size:
1.61 KB
patch
obsolete
>From 862f32971075226dcf9ae19ed7cf558a246300ba Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 12 Jun 2014 09:31:35 +0200 >Subject: [PATCH] Bug 12368: Die if the --table value is not allowed. > >If the table given in parameter is not in the white list, the script >should die rathen than correct to a default value. > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > misc/migration_tools/rebuild_zebra.pl | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > >diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl >index 67b73c7..dd97170 100755 >--- a/misc/migration_tools/rebuild_zebra.pl >+++ b/misc/migration_tools/rebuild_zebra.pl >@@ -136,6 +136,13 @@ if (not $biblios and not $authorities) { > die $msg; > } > >+our @tables_allowed_for_select = ( 'biblioitems', 'items', 'biblio' ); >+unless ( grep { /^$table$/ } @tables_allowed_for_select ) { >+ die "Cannot specify -t|--table with value '$table'. Only " >+ . ( join ', ', @tables_allowed_for_select ) >+ . " are allowed."; >+} >+ > > # -v is for verbose, which seems backwards here because of how logging is set > # on the CLI of zebraidx. It works this way. The default is to not log much >@@ -445,8 +452,7 @@ sub select_all_authorities { > > sub select_all_biblios { > $table = 'biblioitems' >- if $table ne 'items' >- and $table ne 'biblio'; >+ if grep { /^$table$/ } @tables_allowed_for_select; > my $strsth = qq{ SELECT biblionumber FROM $table }; > $strsth.=qq{ WHERE $where } if ($where); > $strsth.=qq{ LIMIT $length } if ($length && !$offset); >-- >2.1.0
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 12368
:
28672
|
28793
|
34749
|
34750
|
34891
|
34892