From: Adam Dickmeiss Date: Mon, 15 Apr 2002 13:48:10 +0000 (+0000) Subject: Option -n works again X-Git-Tag: ZEBRA.1.3.0~89 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=7d9280e88954e1abd67db88bfed1096ce30814d1;p=idzebra-moved-to-github.git Option -n works again --- diff --git a/index/index.h b/index/index.h index c70f783..d00d58d 100644 --- a/index/index.h +++ b/index/index.h @@ -2,7 +2,7 @@ * Copyright (C) 1995-2002, Index Data * All rights reserved. * Sebastian Hammer, Adam Dickmeiss, Heikki Levanto - * $Id: index.h,v 1.79 2002-04-12 14:55:22 adam Exp $ + * $Id: index.h,v 1.80 2002-04-15 13:48:10 adam Exp $ */ #ifndef INDEX_H @@ -273,6 +273,7 @@ struct zebra_session { struct tms tms2; #endif struct recordGroup rGroup; + int shadow_enable; }; struct rank_control { diff --git a/index/main.c b/index/main.c index 712a2fa..05c5a43 100644 --- a/index/main.c +++ b/index/main.c @@ -2,7 +2,7 @@ * Copyright (C) 1994-2002, Index Data * All rights reserved. * - * $Id: main.c,v 1.85 2002-04-05 08:46:26 adam Exp $ + * $Id: main.c,v 1.86 2002-04-15 13:48:10 adam Exp $ */ #include #include @@ -99,6 +99,8 @@ int main (int argc, char **argv) if (!zs) exit (1); zh = zebra_open (zs); + if (disableCommit) + zebra_shadow_enable (zh, 0); } if (rGroupDef.databaseName) { diff --git a/index/zebraapi.c b/index/zebraapi.c index 47f8882..7d1eac2 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2002, Index Data * All rights reserved. * - * $Id: zebraapi.c,v 1.54 2002-04-05 12:49:51 adam Exp $ + * $Id: zebraapi.c,v 1.55 2002-04-15 13:48:11 adam Exp $ */ #include @@ -83,6 +83,8 @@ ZebraHandle zebra_open (ZebraService zs) zh->admin_databaseName = 0; + zh->shadow_enable = 1; + zebra_mutex_cond_lock (&zs->session_lock); zh->next = zs->sessions; @@ -985,7 +987,7 @@ void zebra_begin_trans (ZebraHandle zh) int pass; int seqno = 0; char val = '?'; - const char *rval; + const char *rval = 0; assert (zh->res); @@ -1001,7 +1003,8 @@ void zebra_begin_trans (ZebraHandle zh) #endif /* lock */ - rval = res_get (zh->res, "shadow"); + if (zh->shadow_enable) + rval = res_get (zh->res, "shadow"); for (pass = 0; pass < 2; pass++) { @@ -1240,3 +1243,8 @@ void zebra_result (ZebraHandle zh, int *code, char **addinfo) *addinfo = zh->errString; } +void zebra_shadow_enable (ZebraHandle zh, int value) +{ + zh->shadow_enable = value; +} + diff --git a/index/zebraapi.h b/index/zebraapi.h index 0bc5099..8b45ec8 100644 --- a/index/zebraapi.h +++ b/index/zebraapi.h @@ -3,7 +3,7 @@ * All rights reserved. * Sebastian Hammer, Adam Dickmeiss * - * $Id: zebraapi.h,v 1.14 2002-04-04 14:14:13 adam Exp $ + * $Id: zebraapi.h,v 1.15 2002-04-15 13:48:11 adam Exp $ */ #ifndef ZEBRAAPI_H @@ -149,7 +149,8 @@ int zebra_select_databases (ZebraHandle zh, int num_bases, YAZ_EXPORT int zebra_select_database (ZebraHandle zh, const char *basename); - +YAZ_EXPORT +void zebra_shadow_enable (ZebraHandle zh, int value); YAZ_END_CDECL #endif