ldb-tdb: Add more information about full scan
authorMatthieu Patou <mat@matws.net>
Tue, 23 Nov 2010 21:14:10 +0000 (00:14 +0300)
committerMatthieu Patou <mat@matws.net>
Fri, 26 Nov 2010 20:46:06 +0000 (23:46 +0300)
source4/lib/ldb/ldb_tdb/ldb_search.c

index b58243c26c7cd35a206ed240b5db2a97c771c109..a49751de154574bc7c0b6f1f7fdc11e0404469c3 100644 (file)
@@ -582,7 +582,13 @@ int ltdb_search(struct ltdb_context *ctx)
                                /* useful for debugging when slow performance
                                 * is caused by unindexed searches */
                                char *expression = ldb_filter_from_tree(ctx, ctx->tree);
-                               ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb FULL SEARCH: %s\n", expression);
+                               ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb FULL SEARCH: %s SCOPE: %s DN: %s\n",
+                                                       expression,
+                                                       req->op.search.scope==LDB_SCOPE_BASE?"base":
+                                                       req->op.search.scope==LDB_SCOPE_ONELEVEL?"one":
+                                                       req->op.search.scope==LDB_SCOPE_SUBTREE?"sub":"UNKNOWN",
+                                                       ldb_dn_get_linearized(req->op.search.base));
+
                                talloc_free(expression);
                        }
                        if (match_count != 0) {