ldb: relatively efficient functions for finding duplicate values
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 14 Jun 2017 23:30:33 +0000 (11:30 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 15 Jun 2017 15:33:10 +0000 (17:33 +0200)
commit7d6f36aae387a394b912501e9a4e329c2f11a8a1
treef39dd04e87c33f273eed23b4480c6479e29a32d7
parentf3703c1727864c7aa487e96af772359d64bea513
ldb: relatively efficient functions for finding duplicate values

ldb backends need to make sure they are not adding duplicate values to
multi-valued attributes in ADD and MODIFY operations. Until now they
have done this inefficiently using nested loops. Here we add common
functions that deal with large numbers of values in O(n log n) time,
but continue to use the simple methods for small numbers of values.

These functions take a struct ldb_context pointer and an options flag
arguments, although the ldb is not used, and only one bit of the
options has meaning. This is to allow further patches to switch on
schema-aware comparisons.

This entails an ABI jump to add the two new functions.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/common/ldb_msg.c
lib/ldb/include/ldb_private.h
lib/ldb/ldb_sqlite3/ldb_sqlite3.c
lib/ldb/ldb_tdb/ldb_tdb.c
lib/ldb/tests/ldb_msg.c [new file with mode: 0644]
lib/ldb/wscript