https://bugs.openldap.org/show_bug.cgi?id=9272
--- Comment #4 from Konstantin Andreev grapvar@gmail.com --- When attending this issue, please, also respect "hidden" database flag, it will be easy to make at the same time, I suppose (filed separately as bug 9269).
Something like (incomplete)
--- a/servers/slapd/backglue.c Thu May 28 19:33:41 2020 +0300 +++ b/servers/slapd/backglue.c Fri May 29 00:17:33 2020 +0300 @@ -71,10 +71,13 @@ glue_back_select ( glueinfo *gi = (glueinfo *)on->on_bi.bi_private; int i;
for (i = gi->gi_nodes-1; i >= 0; i--) { assert( gi->gi_n[i].gn_be->be_nsuffix != NULL ); + + if (SLAP_DBHIDDEN( gi->gi_n[i].gn_be )) + continue;
if (dnIsSuffix(dn, &gi->gi_n[i].gn_be->be_nsuffix[0])) { return gi->gi_n[i].gn_be; } } @@ -472,10 +475,13 @@ glue_op_search ( Operation *op, SlapRepl btmp = gi->gi_n[i].gn_be; pdn = &gi->gi_n[i].gn_pdn; } if (!btmp || !btmp->be_search) continue; + /* assuming b0 is not hidden, otherwise we couldn't be here */ + if (SLAP_DBHIDDEN( btmp )) + continue; if (!dnIsSuffix(&btmp->be_nsuffix[0], &b1->be_nsuffix[0])) continue; if (get_no_subordinate_glue(op) && btmp != b1) continue; /* If we remembered which backend we were on before,