From 0e9cf380eaae413b904503bc9676f965ef71ef16 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 9 Aug 2011 16:54:36 +1000 Subject: s4-dsdb: added SAMDB_INDEXING_VERSION to @INDEXLIST this can be used to force re-indexing of samdb when we change something that affects index comparison, in this case the canonicalisation of booleans Pair-Programmed-With: Andrew Bartlett --- source4/dsdb/schema/schema_set.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c index 1c1e45ef78..c5ac6127d1 100644 --- a/source4/dsdb/schema/schema_set.c +++ b/source4/dsdb/schema/schema_set.c @@ -30,6 +30,11 @@ #include "librpc/gen_ndr/ndr_misc.h" #include "lib/util/tsort.h" +/* change this when we change something in our schema code that + * requires a re-index of the database + */ +#define SAMDB_INDEXING_VERSION "2" + /* override the name to attribute handler function */ @@ -95,6 +100,12 @@ static int dsdb_schema_set_attributes(struct ldb_context *ldb, struct dsdb_schem goto op_error; } + + ret = ldb_msg_add_string(msg_idx, "@IDXVERSION", SAMDB_INDEXING_VERSION); + if (ret != LDB_SUCCESS) { + goto op_error; + } + for (attr = schema->attributes; attr; attr = attr->next) { const char *syntax = attr->syntax->ldb_syntax; -- cgit