代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/openldap 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 395e9b250a1a430e788487f73b292c08fc28540c Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Fri, 3 Jun 2022 00:48:50 +0100
Subject: [PATCH] ITS#9858 back-mdb: fix index reconfig
---
servers/slapd/back-mdb/attr.c | 6 +++++-
servers/slapd/back-mdb/config.c | 24 ++++++++++++------------
2 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/servers/slapd/back-mdb/attr.c b/servers/slapd/back-mdb/attr.c
index 9567fb522..7219705b2 100644
--- a/servers/slapd/back-mdb/attr.c
+++ b/servers/slapd/back-mdb/attr.c
@@ -446,7 +446,11 @@ fail:
/* If this is leftover from a previous add, commit it */
if ( b->ai_newmask )
b->ai_indexmask = b->ai_newmask;
- b->ai_newmask = a->ai_newmask;
+ /* If the mask changed, remember it */
+ if ( b->ai_indexmask != a->ai_newmask )
+ b->ai_newmask = a->ai_newmask;
+ else /* else ignore it */
+ b->ai_newmask = 0;
ch_free( a );
rc = 0;
continue;
diff --git a/servers/slapd/back-mdb/config.c b/servers/slapd/back-mdb/config.c
index 1b3cf98fe..48143ef4d 100644
--- a/servers/slapd/back-mdb/config.c
+++ b/servers/slapd/back-mdb/config.c
@@ -349,7 +349,7 @@ mdb_setup_indexer( struct mdb_info *mdb )
MDB_txn *txn;
MDB_cursor *curs;
MDB_val key, data;
- int i, rc;
+ int i, rc, changed = 0;
unsigned short s;
rc = mdb_txn_begin( mdb->mi_dbenv, NULL, 0, &txn );
@@ -364,17 +364,6 @@ mdb_setup_indexer( struct mdb_info *mdb )
key.mv_size = sizeof( s );
key.mv_data = &s;
- /* set indexer task to start at first entry */
- {
- ID id = 0;
- s = 0; /* key 0 records next entryID to index */
- data.mv_size = sizeof( ID );
- data.mv_data = &id;
- rc = mdb_cursor_put( curs, &key, &data, 0 );
- if ( rc )
- goto done;
- }
-
/* record current and new index masks for all new index definitions */
{
slap_mask_t mask[2];
@@ -389,8 +378,19 @@ mdb_setup_indexer( struct mdb_info *mdb )
rc = mdb_cursor_put( curs, &key, &data, 0 );
if ( rc )
goto done;
+ changed = 1;
}
}
+
+ /* set indexer task to start at first entry */
+ if ( changed ) {
+ ID id = 0;
+ s = 0; /* key 0 records next entryID to index */
+ data.mv_size = sizeof( ID );
+ data.mv_data = &id;
+ rc = mdb_cursor_put( curs, &key, &data, 0 );
+ }
+
done:
mdb_cursor_close( curs );
if ( !rc )
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。