From a9b601290b51cd8e4f16c66e60ba76ef1dc36ea4 Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Sat, 4 Nov 2000 12:52:06 +0000 Subject: [PATCH] Add 'distinct' to sql search query to prevent duplicate entries in results (suggested by Mathieu Guillaume) --- servers/slapd/back-sql/search.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/slapd/back-sql/search.c b/servers/slapd/back-sql/search.c index 087d623142..9cd5332589 100644 --- a/servers/slapd/back-sql/search.c +++ b/servers/slapd/back-sql/search.c @@ -284,7 +284,7 @@ char* backsql_srch_query(backsql_srch_info *bsi) bsi->sel_len=bsi->from_len=bsi->jwhere_len=bsi->fwhere_len=0; bsi->sel=backsql_strcat(bsi->sel,&bsi->sel_len, - "SELECT ldap_entries.id,",bsi->oc->keytbl,".",bsi->oc->keycol, + "SELECT DISTINCT ldap_entries.id,",bsi->oc->keytbl,".",bsi->oc->keycol, ", '",bsi->oc->name,"' AS objectClass", ", ldap_entries.dn AS dn", NULL); -- 2.39.5