浏览代码

507460 Access log could mistakenly report notes=U for VLV searches

Summary: Access log reports 'notes=U' for VLV indexed searches if there are no records to be found
Fix Description: VLV creates an empty IDL if no matched entries are found.  To do so, VLV code was calling idl_alloc with argument 0, which generated ALLID.  It's changed to call idl_alloc with 1.  It creates a normal empty IDL.
Noriko Hosoi 16 年之前
父节点
当前提交
6d6630452f
共有 2 个文件被更改,包括 5 次插入3 次删除
  1. 1 1
      ldap/servers/slapd/back-ldbm/ldbm_search.c
  2. 4 2
      ldap/servers/slapd/back-ldbm/vlv.c

+ 1 - 1
ldap/servers/slapd/back-ldbm/ldbm_search.c

@@ -637,7 +637,7 @@ ldbm_back_search( Slapi_PBlock *pb )
          * this is not an internal operation.
          * this is not an internal operation.
          * We hope the plugins know what they are doing!
          * We hope the plugins know what they are doing!
          */
          */
-    if (!operation_is_flag_set(operation, OP_FLAG_INTERNAL)) {
+        if (!operation_is_flag_set(operation, OP_FLAG_INTERNAL)) {
 
 
             PR_Lock(inst->inst_config_mutex);
             PR_Lock(inst->inst_config_mutex);
             ri = inst->require_index;
             ri = inst->require_index;

+ 4 - 2
ldap/servers/slapd/back-ldbm/vlv.c

@@ -1185,7 +1185,8 @@ vlv_build_candidate_list( backend *be, struct vlvIndex* p, const struct vlv_requ
                                                      vlv_request_control);
                                                      vlv_request_control);
             if (si==length) {
             if (si==length) {
                 do_trim = 0;
                 do_trim = 0;
-                *candidates = idl_alloc(0);
+                /* minimum idl_alloc size should be 1; 0 is considered ALLID */
+                *candidates = idl_alloc(1);
             }
             }
             break;
             break;
         default:
         default:
@@ -1356,7 +1357,8 @@ vlv_trim_candidates(backend *be, const IDList *candidates, const sort_spec* sort
         if(si==candidates->b_nids)
         if(si==candidates->b_nids)
         {
         {
             do_trim= 0;
             do_trim= 0;
-            resultIdl= idl_alloc(0);
+            /* minimum idl_alloc size should be 1; 0 is considered ALLID */
+            resultIdl= idl_alloc(1);
         }
         }
         break;
         break;
     default:
     default: