From 2cd08c14a014a9326c6f42b83b4f2187bd2165b2 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 11 Dec 2006 15:49:39 +0000 Subject: r20106: Optional ONE Level indexing for ldb_tdb To activate it you must modify the @INDEXLIST object adding the attribute @IDXONE: 1 Ldb test included Simo. (This used to be commit ea111795f4016916473ccc05d23c6655e6af1207) --- source4/lib/ldb/ldb_tdb/ldb_tdb.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source4/lib/ldb/ldb_tdb/ldb_tdb.c') diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c index bf90115f51..09ddca5034 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c +++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c @@ -276,6 +276,11 @@ static int ltdb_add_internal(struct ldb_module *module, const struct ldb_message } if (ret == LDB_SUCCESS) { + ret = ltdb_index_one(module, msg, 1); + if (ret != LDB_SUCCESS) { + return LDB_ERR_OPERATIONS_ERROR; + } + ret = ltdb_modified(module, msg->dn); if (ret != LDB_SUCCESS) { return LDB_ERR_OPERATIONS_ERROR; @@ -372,6 +377,13 @@ static int ltdb_delete_internal(struct ldb_module *module, struct ldb_dn *dn) return LDB_ERR_NO_SUCH_OBJECT; } + /* remove one level attribute */ + ret = ltdb_index_one(module, msg, 0); + if (ret != LDB_SUCCESS) { + talloc_free(msg); + return LDB_ERR_OPERATIONS_ERROR; + } + /* remove any indexed attributes */ ret = ltdb_index_del(module, msg); if (ret != LDB_SUCCESS) { -- cgit