ldb: <= and >= indexed searching
authorAaron Haslett <aaronhaslett@catalyst.net.nz>
Mon, 4 Mar 2019 06:06:31 +0000 (19:06 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 8 Apr 2019 02:07:22 +0000 (02:07 +0000)
commit9b3021b8d6b963c5023cc16b9f764707fdbcafbc
tree8d9ba28a7884e157115b384909eefd75bf9184d0
parent1b5df44331434256228070df35217c837a8cd838
ldb: <= and >= indexed searching

Full implementation of <= and >= indexed searching using iterate_range
backend operation.  Adds index_format_fn to ldb_schema_syntax so
requires an ABI version bump.  The function must be provided for any
type for which <= and >= indexing is required, and must return a
lexicographically ordered canonicalization of a value.  This causes
index entries to be written in correct order to the database, so
iterate_range on the index DNs can be used.

ldb_kv_index_key is modified to return an index DN with attribute name
but without value if an empty value is provided.  This is needed for
constructing keys that match the beginning or end of an index DN range.

Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/include/ldb.h
lib/ldb/ldb_key_value/ldb_kv_index.c