-/* $Id: extract.c,v 1.138 2003-02-27 22:55:40 adam Exp $
+/* $Id: extract.c,v 1.139 2003-02-27 23:08:10 pop Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
extractCtrl.endf = zebra_record_int_end;
extractCtrl.fh = &fc;
+ zh->reg->keys.buf_used = 0;
+ zh->reg->keys.prevAttrUse = -1;
+ zh->reg->keys.prevAttrSet = -1;
+ zh->reg->keys.prevSeqNo = 0;
+ zh->reg->sortKeys.buf_used = 0;
+
/* announce database */
+
+ if (!(rGroup->databaseName)) {
+ logf (LOG_WARN, "Invalid record group, no database name given");
+ return 0;
+ }
+
if (zebraExplain_curDatabase (zh->reg->zei, rGroup->databaseName))
{
if (zebraExplain_newDatabase (zh->reg->zei, rGroup->databaseName, 0))
return 0;
}
- zh->reg->keys.buf_used = 0;
- zh->reg->keys.prevAttrUse = -1;
- zh->reg->keys.prevAttrSet = -1;
- zh->reg->keys.prevSeqNo = 0;
- zh->reg->sortKeys.buf_used = 0;
-
if (*recordType) {
logf (LOG_DEBUG, "Record type explicitly specified: %s", recordType);
recType = recType_byName (zh->reg->recTypes, recordType, subType,
-/* $Id: zebraapi.c,v 1.85 2003-02-27 22:55:40 adam Exp $
+/* $Id: zebraapi.c,v 1.86 2003-02-27 23:08:10 pop Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
xfree (reg->key_buf);
xfree (reg->name);
xfree (reg);
- yaz_log(LOG_DEBUG, "zebra_register_close 2");
}
void zebra_stop(ZebraService zs)
zh->reg->seqno = seqno;
}
-void zebra_end_trans (ZebraHandle zh)
+void zebra_end_trans (ZebraHandle zh) {
+ ZebraTransactionStatus dummy;
+ zebra_end_transaction(zh, &dummy);
+}
+
+void zebra_end_transaction (ZebraHandle zh, ZebraTransactionStatus *status)
{
char val;
int seqno;
const char *rval;
+
ASSERTZH;
+ status->processed = 0;
+ status->inserted = 0;
+ status->updated = 0;
+ status->deleted = 0;
+ status->utime = 0;
+ status->stime = 0;
+
zh->trans_no--;
if (zh->trans_no != 0)
return;
zh->records_processed, zh->records_inserted,
zh->records_updated, zh->records_deleted);
+ status->processed = zh->records_processed;
+ status->inserted = zh->records_inserted;
+ status->updated = zh->records_updated;
+ status->deleted = zh->records_deleted;
+
zebra_get_state (zh, &val, &seqno);
if (val != 'd')
{
(long) (zh->tms2.tms_utime - zh->tms1.tms_utime),
(long) (zh->tms2.tms_stime - zh->tms1.tms_stime));
+ status->utime = (long) (zh->tms2.tms_utime - zh->tms1.tms_utime);
+ status->stime = (long) (zh->tms2.tms_stime - zh->tms1.tms_stime);
#endif
+
+ return;
}
void zebra_repository_update (ZebraHandle zh)
-/* $Id: zebraapi.h,v 1.25 2003-02-11 17:28:10 heikki Exp $
+/* $Id: zebraapi.h,v 1.26 2003-02-27 23:08:10 pop Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
int followLinks;
};
+typedef struct {
+ int processed;
+ int inserted;
+ int updated;
+ int deleted;
+ long utime;
+ long stime;
+} ZebraTransactionStatus;
+
/* Retrieval Record Descriptor */
typedef struct {
int errCode; /* non-zero if error when fetching this */
void zebra_begin_trans (ZebraHandle zh);
void zebra_end_trans (ZebraHandle zh);
+void zebra_end_transaction (ZebraHandle zh, ZebraTransactionStatus *stat);
int zebra_commit (ZebraHandle zh);