+Changed record update API . It is now handled by function
+zebra_record_update which does insert/replace/delete/update of
+records . This function replaces zebra_record_{insert,delete} and
+zebra_admin_exchange_record.
+
--- 2.0.12 2007/03/07
Fixed bug with indexing of attributes for rec.grs-class of filters.
dh_fixperms
# dh_perl
# dh_python
- dh_makeshlibs -V 'libidzebra-2.0 (>= 2.0.2)' -X mod-
+ dh_makeshlibs -V 'libidzebra-2.0 (>= 2.0.13)' -X mod-
dh_installdeb
dh_shlibdeps -L libidzebra-2.0 -l debian/libidzebra-2.0/usr/lib
dh_gencontrol
-/* $Id: api.h,v 1.46 2007-01-17 15:35:47 adam Exp $
+/* $Id: api.h,v 1.47 2007-03-14 11:48:31 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
#include <yaz/proto.h>
#include <idzebra/res.h>
#include <idzebra/version.h>
+#include <idzebra/recctrl.h>
YAZ_BEGIN_CDECL
ZEBRA_RES zebra_admin_import_end(ZebraHandle zh);
YAZ_EXPORT
-ZEBRA_RES zebra_admin_exchange_record(ZebraHandle zh,
- const char *rec_buf,
- size_t rec_len,
- const char *recid_buf, size_t recid_len,
- int action);
-
-YAZ_EXPORT
ZEBRA_RES zebra_begin_trans(ZebraHandle zh, int rw
) ZEBRA_GCC_ATTR((warn_unused_result));
YAZ_EXPORT
ZEBRA_RES zebra_repository_show(ZebraHandle zh, const char *path);
+/** \brief Simple update record
+ \param zh session handle
+ \param buf record buffer
+ \param buf_size record buffer size
+
+ This function is a simple wrapper or zebra_update_record with
+ action=action_update (insert or replace) .
+*/
+YAZ_EXPORT
YAZ_EXPORT
ZEBRA_RES zebra_add_record(ZebraHandle zh, const char *buf, int buf_size);
-YAZ_EXPORT
-ZEBRA_RES zebra_insert_record(ZebraHandle zh,
- const char *recordType,
- zint *sysno, const char *match,
- const char *fname,
- const char *buf, int buf_size,
- int force_update);
+/** \brief Updates record
+ \param zh session handle
+ \param action (insert,replace,delete or update (replace/insert)
+ \param recordType filter type (0 indicates default)
+ \param sysno system id (0 may be passed for no known id)
+ \param match match criteria (0 may be passed for no known criteria)
+ \param fname filename to be printed for logging (0 may be passed)
+ \param buf record buffer
+ \param buf_size record buffer size
+*/
YAZ_EXPORT
ZEBRA_RES zebra_update_record(ZebraHandle zh,
- const char *recordType,
- zint *sysno, const char *match,
- const char *fname,
- const char *buf, int buf_size,
- int force_update);
-YAZ_EXPORT
-ZEBRA_RES zebra_delete_record(ZebraHandle zh,
- const char *recordType,
- zint *sysno, const char *match,
+ enum zebra_recctrl_action_t action,
+ const char *recordType,
+ zint *sysno, const char *match,
const char *fname,
- const char *buf, int buf_size,
- int force_update);
+ const char *buf, int buf_size);
YAZ_EXPORT
ZEBRA_RES zebra_sort(ZebraHandle zh, ODR stream,
-/* $Id: recctrl.h,v 1.31 2007-03-01 10:35:46 adam Exp $
+/* $Id: recctrl.h,v 1.32 2007-03-14 11:48:31 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
void (*destroy)(struct ZebraRecStream *s);
};
+enum zebra_recctrl_action_t {
+ action_insert = 1,
+ action_replace,
+ action_delete,
+ action_update /* insert or replace as needed */
+};
+
/** \brief record extract for indexing */
struct recExtractCtrl {
struct ZebraRecStream *stream;
-/* $Id: extract.c,v 1.251 2007-03-13 13:46:11 adam Exp $
+/* $Id: extract.c,v 1.252 2007-03-14 11:48:32 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
ZEBRA_RES zebra_extract_records_stream(ZebraHandle zh,
struct ZebraRecStream *stream,
- int delete_flag,
+ enum zebra_recctrl_action_t action,
int test_mode,
const char *recordType,
zint *sysno,
const char *match_criteria,
const char *fname,
- int force_update,
- int allow_update,
RecType recType,
void *recTypeClientData);
zebra_create_stream_fd(streamp, fd, 0);
}
r = zebra_extract_records_stream(zh, streamp,
- deleteFlag,
+ deleteFlag ?
+ action_delete : action_update,
0, /* tst_mode */
zh->m_record_type,
sysno,
0, /*match_criteria */
fname,
- 1, /* force_update */
- 1, /* allow_update */
recType, recTypeClientData);
if (streamp)
stream.destroy(streamp);
ZEBRA_RES zebra_buffer_extract_record(ZebraHandle zh,
const char *buf, size_t buf_size,
- int delete_flag,
+ enum zebra_recctrl_action_t action,
int test_mode,
const char *recordType,
zint *sysno,
const char *match_criteria,
- const char *fname,
- int force_update,
- int allow_update)
+ const char *fname)
{
struct ZebraRecStream stream;
ZEBRA_RES res;
zebra_create_stream_mem(&stream, buf, buf_size);
res = zebra_extract_records_stream(zh, &stream,
- delete_flag,
+ action,
test_mode,
recordType,
sysno,
match_criteria,
fname,
- force_update,
- allow_update,
recType, clientData);
stream.destroy(&stream);
return res;
ZEBRA_RES zebra_extract_records_stream(ZebraHandle zh,
struct ZebraRecStream *stream,
- int delete_flag,
+ enum zebra_recctrl_action_t action,
int test_mode,
const char *recordType,
zint *sysno,
const char *match_criteria,
const char *fname,
- int force_update,
- int allow_update,
RecType recType,
void *recTypeClientData)
{
{
int more = 0;
res = zebra_extract_record_stream(zh, stream,
- delete_flag,
+ action,
test_mode,
recordType,
sysno,
match_criteria,
fname,
- force_update,
- allow_update,
recType, recTypeClientData, &more);
if (!more)
{
ZEBRA_RES zebra_extract_record_stream(ZebraHandle zh,
struct ZebraRecStream *stream,
- int delete_flag,
+ enum zebra_recctrl_action_t action,
int test_mode,
const char *recordType,
zint *sysno,
const char *match_criteria,
const char *fname,
- int force_update,
- int allow_update,
RecType recType,
void *recTypeClientData,
int *more)
if (! *sysno)
{
/* new record */
- if (delete_flag)
+ if (action == action_delete)
{
yaz_log (YLOG_LOG, "delete %s %s " ZINT_FORMAT, recordType,
pr_fname, (zint) start_offset);
yaz_log (YLOG_WARN, "cannot delete record above (seems new)");
return ZEBRA_FAIL;
}
- else if (!force_update)
+ else if (action == action_replace)
{
yaz_log (YLOG_LOG, "update %s %s " ZINT_FORMAT, recordType,
pr_fname, (zint) start_offset);
/* record already exists */
zebra_rec_keys_t delkeys = zebra_rec_keys_open();
zebra_rec_keys_t sortKeys = zebra_rec_keys_open();
- if (!allow_update)
+ if (action == action_insert)
{
yaz_log (YLOG_LOG, "skipped %s %s " ZINT_FORMAT,
recordType, pr_fname, (zint) start_offset);
extract_flush_sort_keys(zh, *sysno, 0, sortKeys);
extract_flush_record_keys(zh, *sysno, 0, delkeys,
recordAttr->staticrank);
- if (delete_flag)
+ if (action == action_delete)
{
/* record going to be deleted */
if (zebra_rec_keys_empty(delkeys))
return ZEBRA_OK;
}
else
- {
+ { /* update or special_update */
if (show_progress)
yaz_log(YLOG_LOG, "update %s %s " ZINT_FORMAT, recordType,
pr_fname, (zint) start_offset);
-/* $Id: index.h,v 1.195 2007-02-06 09:34:56 adam Exp $
+/* $Id: index.h,v 1.196 2007-03-14 11:48:32 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
ZEBRA_RES zebra_buffer_extract_record(ZebraHandle zh,
const char *buf, size_t buf_size,
- int delete_flag,
+ enum zebra_recctrl_action_t action,
int test_mode,
const char *recordType,
zint *sysno,
const char *match_criteria,
- const char *fname,
- int force_update,
- int allow_update);
+ const char *fname);
ZEBRA_RES zebra_extract_record_stream(ZebraHandle zh,
struct ZebraRecStream *stream,
- int delete_flag,
+ enum zebra_recctrl_action_t action,
int test_mode,
const char *recordType,
zint *sysno,
const char *match_criteria,
const char *fname,
- int force_update,
- int allow_update,
RecType recType,
void *recTypeClientData,
int *more);
-/* $Id: zebraapi.c,v 1.250 2007-03-13 13:46:11 adam Exp $
+/* $Id: zebraapi.c,v 1.251 2007-03-14 11:48:32 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
Odr_oct *oct = fragment->u.notExternallyTagged;
sysno = 0;
- if (zebra_update_record(zh,
- 0, /* record Type */
- &sysno,
- 0, /* match */
- 0, /* fname */
- (const char *) oct->buf, oct->len,
- 0) == ZEBRA_FAIL)
+ if (zebra_update_record(
+ zh,
+ action_update,
+ 0, /* record Type */
+ &sysno,
+ 0, /* match */
+ 0, /* fname */
+ (const char *) oct->buf, oct->len) == ZEBRA_FAIL)
res = ZEBRA_FAIL;
}
}
return res;
}
-ZEBRA_RES zebra_admin_exchange_record(ZebraHandle zh,
- const char *rec_buf,
- size_t rec_len,
- const char *recid_buf, size_t recid_len,
- int action)
- /* 1 = insert. Fail it already exists */
- /* 2 = replace. Fail it does not exist */
- /* 3 = delete. Fail if does not exist */
- /* 4 = update. Insert/replace */
-{
- ZEBRA_RES res;
- zint sysno = 0;
- char *rinfo = 0;
- char recid_z[256];
- int db_ord;
- ZEBRA_CHECK_HANDLE(zh);
- assert(action>0 && action <=4);
- assert(rec_buf);
-
- yaz_log(log_level, "zebra_admin_exchange_record ac=%d", action);
-
- if (!recid_buf || recid_len <= 0 || recid_len >= sizeof(recid_z))
- {
- zebra_setError(zh, YAZ_BIB1_ES_IMMEDIATE_EXECUTION_FAILED,
- "no record ID or empty record ID");
- return ZEBRA_FAIL;
- }
-
- memcpy (recid_z, recid_buf, recid_len);
- recid_z[recid_len] = 0;
-
- if (zebra_begin_trans(zh, 1) == ZEBRA_FAIL)
- return ZEBRA_FAIL;
-
- db_ord = zebraExplain_get_database_ord(zh->reg->zei);
- rinfo = dict_lookup_ord(zh->reg->matchDict, db_ord, recid_z);
- if (rinfo)
- {
- if (action == 1) /* fail if insert */
- {
- if (zebra_end_trans(zh) != ZEBRA_OK)
- yaz_log(YLOG_WARN, "zebra_end_trans failed");
- zebra_setError(zh, YAZ_BIB1_ES_IMMEDIATE_EXECUTION_FAILED,
- "Cannot insert record: already exist");
- return ZEBRA_FAIL;
- }
-
- memcpy (&sysno, rinfo+1, sizeof(sysno));
- }
- else
- {
- if (action == 2 || action == 3) /* fail if delete or update */
- {
- if (zebra_end_trans(zh) != ZEBRA_OK)
- yaz_log(YLOG_WARN, "zebra_end_trans failed");
- zebra_setError(zh, YAZ_BIB1_ES_IMMEDIATE_EXECUTION_FAILED,
- "Cannot delete/update record: does not exist");
- return ZEBRA_FAIL;
- }
- action = 1; /* make it an insert (if it's an update).. */
- }
- res = zebra_buffer_extract_record(zh, rec_buf, rec_len,
- action == 3 ? 1 : 0 /* delete flag */,
- 0, /* test mode */
- 0, /* recordType */
- &sysno,
- 0, /* match */
- 0, /* fname */
- 1, /* force update */
- 1 /* allow update */
- );
- if (res == ZEBRA_FAIL)
- {
- zebra_setError(zh, YAZ_BIB1_ES_IMMEDIATE_EXECUTION_FAILED,
- "Unable to parse record");
- }
- if (action == 1)
- {
- dict_insert_ord(zh->reg->matchDict, db_ord, recid_z,
- sizeof(sysno), &sysno);
- }
- else if (action == 3)
- {
- dict_delete_ord(zh->reg->matchDict, db_ord, recid_z);
- }
- if (zebra_end_trans(zh) != ZEBRA_OK)
- {
- yaz_log(YLOG_WARN, "zebra_end_trans failed");
- res = ZEBRA_FAIL;
- }
- return res;
-}
-
int delete_w_handle(const char *info, void *handle)
{
ZebraHandle zh = (ZebraHandle) handle;
ZEBRA_RES zebra_add_record(ZebraHandle zh,
const char *buf, int buf_size)
{
- return zebra_update_record(zh, 0, 0 /* sysno */, 0, 0, buf, buf_size, 1);
-}
-
-ZEBRA_RES zebra_insert_record(ZebraHandle zh,
- const char *recordType,
- zint *sysno, const char *match,
- const char *fname,
- const char *buf, int buf_size, int force_update)
-{
- ZEBRA_RES res;
- ASSERTZH;
- assert(sysno);
- assert(buf);
- yaz_log(log_level, "zebra_insert_record sysno=" ZINT_FORMAT, *sysno);
-
- if (buf_size < 1)
- buf_size = strlen(buf);
-
- if (zebra_begin_trans(zh, 1) == ZEBRA_FAIL)
- return ZEBRA_FAIL;
- res = zebra_buffer_extract_record(zh, buf, buf_size,
- 0, /* delete_flag */
- 0, /* test_mode */
- recordType,
- sysno,
- match, fname,
- 1,
- 0); /* allow_update */
- if (zebra_end_trans(zh) != ZEBRA_OK)
- {
- yaz_log(YLOG_WARN, "zebra_end_trans failed");
- res = ZEBRA_FAIL;
- }
- return res;
+ return zebra_update_record(zh, action_update,
+ 0 /* record type */,
+ 0 /* sysno */ ,
+ 0 /* match */,
+ 0 /* fname */,
+ buf, buf_size);
}
ZEBRA_RES zebra_update_record(ZebraHandle zh,
+ enum zebra_recctrl_action_t action,
const char *recordType,
zint *sysno, const char *match,
const char *fname,
- const char *buf, int buf_size,
- int force_update)
+ const char *buf, int buf_size)
{
ZEBRA_RES res;
if (sysno)
yaz_log(log_level, " sysno=" ZINT_FORMAT, *sysno);
- if (buf_size < 1) buf_size = strlen(buf);
+ if (buf_size < 1)
+ buf_size = strlen(buf);
if (zebra_begin_trans(zh, 1) == ZEBRA_FAIL)
return ZEBRA_FAIL;
res = zebra_buffer_extract_record(zh, buf, buf_size,
- 0, /* delete_flag */
+ action,
0, /* test_mode */
recordType,
sysno,
- match, fname,
- force_update,
- 1); /* allow_update */
+ match,
+ fname);
if (zebra_end_trans(zh) != ZEBRA_OK)
{
yaz_log(YLOG_WARN, "zebra_end_trans failed");
return res;
}
-ZEBRA_RES zebra_delete_record(ZebraHandle zh,
- const char *recordType,
- zint *sysno, const char *match,
- const char *fname,
- const char *buf, int buf_size,
- int force_update)
-{
- ZEBRA_RES res;
-
- ZEBRA_CHECK_HANDLE(zh);
-
- assert(buf);
- yaz_log(log_level, "zebra_delete_record");
- if (sysno)
- yaz_log(log_level, " sysno=" ZINT_FORMAT, *sysno);
-
- if (buf_size < 1) buf_size = strlen(buf);
-
- if (zebra_begin_trans(zh, 1) == ZEBRA_FAIL)
- return ZEBRA_FAIL;
- res = zebra_buffer_extract_record(zh, buf, buf_size,
- 1, /* delete_flag */
- 0, /* test_mode */
- recordType,
- sysno,
- match,fname,
- force_update,
- 1); /* allow_update */
- if (zebra_end_trans(zh) != ZEBRA_OK)
- {
- yaz_log(YLOG_WARN, "zebra_end_trans failed");
- res = ZEBRA_FAIL;
- }
- return res;
-}
-
/* ---------------------------------------------------------------------------
Searching
*/
-/* $Id: zebrash.c,v 1.42 2007-01-15 15:10:17 adam Exp $
+/* $Id: zebrash.c,v 1.43 2007-03-14 11:48:32 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
int rc;
char *rec=restargs(args,1);
- rc = zebra_insert_record(zh,
+ rc = zebra_update_record(zh,
+ action_insert,
0, /* record type */
&sysno,
0, /* match */
0, /* fname */
rec,
- strlen(rec),
- 0);
+ strlen(rec));
if (0==rc)
{
wrbuf_printf(outbuff,"ok sysno=" ZINT_FORMAT "\n",sysno);
onecommand("help exchange_record", outbuff, "");
return -90;
}
- rc=zebra_admin_exchange_record(zh, rec, strlen(rec),
- id, strlen(id), atoi(action));
+
+ rc = zebra_update_record(zh, action_update, 0 /* record_type */,
+ 0 /* sysno */,
+ id /* match */,
+ 0 /* fname */,
+ rec, strlen(rec));
return rc;
}
-/* $Id: zebrasrv.c,v 1.11 2007-03-13 13:46:11 adam Exp $
+/* $Id: zebrasrv.c,v 1.12 2007-03-14 11:48:32 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
}
if (rec->which == Z_External_octet)
{
- int action = 0;
+ enum zebra_recctrl_action_t action = action_update;
+ char recid_str[256];
+ const char *match_criteria = 0;
+ ZEBRA_RES res;
if (*toKeep->action ==
Z_IUOriginPartToKeep_recordInsert)
- action = 1;
- if (*toKeep->action ==
+ action = action_insert;
+ else if (*toKeep->action ==
Z_IUOriginPartToKeep_recordReplace)
- action = 2;
- if (*toKeep->action ==
+ action = action_replace;
+ else if (*toKeep->action ==
Z_IUOriginPartToKeep_recordDelete)
- action = 3;
- if (*toKeep->action ==
+ action = action_delete;
+ else if (*toKeep->action ==
Z_IUOriginPartToKeep_specialUpdate)
- action = 4;
-
- if (!action)
+ action = action_update;
+ else
{
rr->errcode =
YAZ_BIB1_ES_IMMEDIATE_EXECUTION_FAILED;
rr->errstring = "unsupported ES Update action";
break;
}
- else if (opaque_recid)
+
+ if (opaque_recid)
{
- int r = zebra_admin_exchange_record (
- zh,
- (const char *) rec->u.octet_aligned->buf,
- rec->u.octet_aligned->len,
- (const char *) opaque_recid->buf,
- opaque_recid->len,
- action);
- if (r)
+ size_t l = opaque_recid->len;
+ if (l >= sizeof(recid_str))
{
- zebra_result(zh, &rr->errcode,
- &rr->errstring);
+ rr->errcode = YAZ_BIB1_ES_IMMEDIATE_EXECUTION_FAILED;
+ rr->errstring = "opaque record ID too large";
break;
}
- }
- else
- {
- ZEBRA_RES r = ZEBRA_FAIL;
- switch(action) {
- case 1:
- r = zebra_insert_record(
- zh,
- 0, /* recordType */
- sysno,
- 0, /* match */
- 0, /* fname */
- (const char *) rec->u.octet_aligned->buf,
- rec->u.octet_aligned->len,
- 0);
- if (r == ZEBRA_FAIL)
- {
- rr->errcode =
- YAZ_BIB1_ES_IMMEDIATE_EXECUTION_FAILED;
- rr->errstring = "insert_record failed";
- }
- break;
- case 2:
- r = zebra_update_record(
- zh,
- 0, /* recordType */
- sysno,
- 0, /* match */
- 0, /* fname */
- (const char *) rec->u.octet_aligned->buf,
- rec->u.octet_aligned->len,
- 0 /* force_update=0: action is a replace, so abort update if no corresponding record exists */
- );
- if (r == ZEBRA_FAIL)
- {
- rr->errcode =
- YAZ_BIB1_ES_IMMEDIATE_EXECUTION_FAILED;
- rr->errstring = "update_record failed";
- }
- break;
- case 3:
- r = zebra_delete_record(
- zh,
- 0, /* recordType */
- sysno,
- 0, /* match */
- 0, /* fname */
- (const char *) rec->u.octet_aligned->buf,
- rec->u.octet_aligned->len,
- 0);
- if (r == ZEBRA_FAIL)
- {
- rr->errcode =
- YAZ_BIB1_ES_IMMEDIATE_EXECUTION_FAILED;
- rr->errstring = "delete_record failed";
- }
- break;
- case 4:
- r = zebra_update_record(
- zh,
- 0, /* recordType */
- sysno,
- 0, /* match */
- 0, /* fname */
- (const char *) rec->u.octet_aligned->buf,
- rec->u.octet_aligned->len,
- 1 /* force_update=1: action is a specialUpdate, so allow replace or insert */
- );
- if (r == ZEBRA_FAIL)
- {
- rr->errcode =
- YAZ_BIB1_ES_IMMEDIATE_EXECUTION_FAILED;
- rr->errstring = "update_record failed";
- }
- break;
- }
- }
+ memcpy(recid_str, opaque_recid->buf, l);
+ recid_str[l] = '\0';
+ match_criteria = recid_str;
+ }
+ res = zebra_update_record(
+ zh, action,
+ 0, /* recordType */
+ sysno, match_criteria, 0, /* fname */
+ (const char *) rec->u.octet_aligned->buf,
+ rec->u.octet_aligned->len);
+ if (res == ZEBRA_FAIL)
+ {
+ rr->errcode =
+ YAZ_BIB1_ES_IMMEDIATE_EXECUTION_FAILED;
+ rr->errstring = "update_record failed";
+ }
}
}
if (zebra_end_trans (zh) != ZEBRA_OK)
-/* $Id: t13.c,v 1.13 2007-03-13 13:46:11 adam Exp $
+/* $Id: t13.c,v 1.14 2007-03-14 11:48:32 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
zebra_set_resource(zh, "profilePath", "${srcdir:-.}/../../tab");
- YAZ_CHECK_EQ(zebra_insert_record(zh /* handle */,
+ YAZ_CHECK_EQ(zebra_update_record(zh /* handle */,
+ action_insert,
"grs.sgml" /* record type */,
&sysno, 0 /* match */,
0 /* fname */,
- xml_buf, strlen(xml_buf),
- 1 /* force_update */),
+ xml_buf, strlen(xml_buf)),
ZEBRA_OK);
zebra_close(zh);
-/* $Id: t14.c,v 1.6 2007-01-15 15:10:20 adam Exp $
+/* $Id: t14.c,v 1.7 2007-03-14 11:48:32 adam Exp $
Copyright (C) 2004-2007
Index Data ApS
YAZ_CHECK(zebra_create_database (zh, "Default") == ZEBRA_OK);
/* bug #447 */
- YAZ_CHECK(zebra_admin_exchange_record (
- zh, rec, strlen(rec),
- opaque_id, strlen(opaque_id),
- 1) == ZEBRA_OK); /* insert */
-
- YAZ_CHECK(zebra_admin_exchange_record (
- zh, rec, strlen(rec),
- opaque_id, strlen(opaque_id),
- 4) == ZEBRA_OK); /* update/insert */
-
+ YAZ_CHECK(zebra_update_record(
+ zh, action_update,
+ 0 /* record type */,
+ 0 /* sysno */,
+ opaque_id,
+ 0 /* fname */,
+ rec, strlen(rec))
+ == ZEBRA_OK); /* insert really */
+
+ YAZ_CHECK(zebra_update_record(
+ zh, action_update,
+ 0 /* record type */,
+ 0 /* sysno */,
+ opaque_id,
+ 0 /* fname */,
+ rec, strlen(rec))
+ == ZEBRA_OK); /* replace really */
+
YAZ_CHECK(tl_query(zh, "@attr 1=4 some", 1));
zebra_drop_database(zh, "Default");