From: Garming Sam Date: Thu, 4 Apr 2019 02:02:15 +0000 (+1300) Subject: ldb_kv_index: Add a giant comment in regards to index_format_fn X-Git-Tag: tdb-1.4.1~499 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f775606516015715379dd76fa545da7c02c65e45;p=thirdparty%2Fsamba.git ldb_kv_index: Add a giant comment in regards to index_format_fn The reason we needed it in the first place was that the original canonicalize is being used for non-index functions and it never produced the right order originally (at least for integers). Signed-off-by: Garming Sam Reviewed-by: Andrew Bartlett --- diff --git a/lib/ldb/ldb_key_value/ldb_kv_index.c b/lib/ldb/ldb_key_value/ldb_kv_index.c index 8580db1c778..2627d79d5fd 100644 --- a/lib/ldb/ldb_key_value/ldb_kv_index.c +++ b/lib/ldb/ldb_key_value/ldb_kv_index.c @@ -1770,6 +1770,20 @@ static int traverse_range_index(struct ldb_kv_private *ldb_kv, return LDB_SUCCESS; } +/* + * >= and <= indexing implemented using lexicographically sorted keys + * + * We only run this in GUID indexing mode and when there is no write + * transaction (only implicit read locks are being held). Otherwise, we would + * have to deal with the in-memory index cache. + * + * We rely on the implementation of index_format_fn on a schema syntax which + * will can help us to construct keys which can be ordered correctly, and we + * terminate using schema agnostic start and end keys. + * + * index_format_fn must output values which can be memcmp-able to produce the + * correct ordering as defined by the schema syntax class. + */ static int ldb_kv_index_dn_ordered(struct ldb_module *module, struct ldb_kv_private *ldb_kv, const struct ldb_parse_tree *tree,