X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=index%2Fzebraapi.c;h=efbb91921a517eb8d3cd2099f1d8b1a75061910c;hb=4e27fea1f9fafa8fa80caeb77ae0da62be0def9a;hp=61268c26d6ad588dee25bebe2418e8809172e5a2;hpb=deb0cef3d4d19dc6508b2fed71711b3fb1be26a2;p=idzebra-moved-to-github.git diff --git a/index/zebraapi.c b/index/zebraapi.c index 61268c2..efbb919 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.225 2006-08-16 13:16:36 adam Exp $ +/* $Id: zebraapi.c,v 1.230 2006-10-12 13:06:00 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -772,8 +772,10 @@ static void zebra_select_register (ZebraHandle zh, const char *new_reg) { if (res_get_int(zh->res, "segment", &zh->m_segment_indexing) == ZEBRA_OK) - yaz_log(YLOG_LOG, "segment indexing set and is %d", + { + yaz_log(YLOG_DEBUG, "segment indexing set and is %d", zh->m_segment_indexing); + } } } @@ -1175,10 +1177,10 @@ ZEBRA_RES zebra_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, return ZEBRA_FAIL; } } - res = rpn_scan (zh, stream, zapt, attributeset, - zh->num_basenames, zh->basenames, position, - num_entries, entries, is_partial, limit_rset, 0); - zebra_end_read (zh); + res = rpn_scan(zh, stream, zapt, attributeset, + zh->num_basenames, zh->basenames, position, + num_entries, entries, is_partial, limit_rset); + zebra_end_read(zh); return res; } @@ -1483,12 +1485,20 @@ ZEBRA_RES zebra_drop_database(ZebraHandle zh, const char *db) if (zh->reg->isamb) { int db_ord; - zebraExplain_curDatabase (zh->reg->zei, db); - db_ord = zebraExplain_get_database_ord(zh->reg->zei); - dict_delete_subtree_ord(zh->reg->matchDict, db_ord, - 0 /* handle */, 0 /* func */); - zebraExplain_trav_ord(zh->reg->zei, zh, delete_SU_handle); - zebraExplain_removeDatabase(zh->reg->zei, zh); + if (zebraExplain_curDatabase (zh->reg->zei, db)) + { + zebra_setError(zh, YAZ_BIB1_DATABASE_DOES_NOT_EXIST, db); + ret = ZEBRA_FAIL; + } + else + { + db_ord = zebraExplain_get_database_ord(zh->reg->zei); + dict_delete_subtree_ord(zh->reg->matchDict, db_ord, + 0 /* handle */, 0 /* func */); + zebraExplain_trav_ord(zh->reg->zei, zh, delete_SU_handle); + zebraExplain_removeDatabase(zh->reg->zei, zh); + zebra_remove_file_match(zh); + } } else { @@ -2005,6 +2015,12 @@ static ZEBRA_RES zebra_commit_ex(ZebraHandle zh, int clean_only) } zebra_get_state (zh, &val, &seqno); + if (val == 'd') + { + yaz_log(YLOG_WARN, "previous transaction didn't reach commit"); + clean_only = 1; + } + if (rval && *rval) bf_cache (bfs, rval); if (bf_commitExists (bfs)) @@ -2017,9 +2033,6 @@ static ZEBRA_RES zebra_commit_ex(ZebraHandle zh, int clean_only) yaz_log (YLOG_DEBUG, "commit start"); bf_commitExec (bfs); -#ifndef WIN32 - sync (); -#endif } seqno++; zebra_set_state (zh, 'o', seqno);