ldb_tdb: Do not add an index for GUID_index_attribute
authorAndrew Bartlett <abartlet@samba.org>
Thu, 17 Aug 2017 00:44:34 +0000 (12:44 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 22 Sep 2017 19:20:22 +0000 (21:20 +0200)
This would be pointless and we no longer query for it.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
lib/ldb/ldb_tdb/ldb_index.c

index fc5d9678e4d866060a0e1937a822cb43a97ad79c..73667e53b946ed1a19171a0caa44c1d6e9e9da38 100644 (file)
@@ -629,6 +629,12 @@ static bool ltdb_is_indexed(struct ldb_module *module,
        unsigned int i;
        struct ldb_message_element *el;
 
+       if ((ltdb->cache->GUID_index_attribute != NULL) &&
+           (ldb_attr_cmp(attr,
+                         ltdb->cache->GUID_index_attribute) == 0)) {
+               /* Implicity covered, this is the index key */
+               return false;
+       }
        if (ldb->schema.index_handler_override) {
                const struct ldb_schema_attribute *a
                        = ldb_schema_attribute_by_name(ldb, attr);