summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-10-06 05:24:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:39:26 -0500
commit5fd031c97daaa1bf09a7ad80550753acd434075f (patch)
tree8221ef256c17f138b11d22d9da26ae95db5618c4 /source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
parent92da5aa6b8d5141b22d781442583c9f3ad94d3af (diff)
downloadsamba-5fd031c97daaa1bf09a7ad80550753acd434075f.tar.gz
samba-5fd031c97daaa1bf09a7ad80550753acd434075f.tar.bz2
samba-5fd031c97daaa1bf09a7ad80550753acd434075f.zip
r10753: don't require every ldb module to implement both a search_bytree() and
a search() function, instead each module now only implements the bytree method, and the expression based search is handled generically by the modules code. This makes for more consistency and less code duplication. fixed the tdb backend to handle BASE searches much more efficiently. They now always only lookup one record, regardless of the search expression (This used to be commit 7e44f9153c5578624e2fca04cdc0a00af0fd9eb4)
Diffstat (limited to 'source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c')
-rw-r--r--source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c40
1 files changed, 1 insertions, 39 deletions
diff --git a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
index 052b10f245..1054722178 100644
--- a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
+++ b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
@@ -822,7 +822,7 @@ static int lsqlite3_search_bytree(struct ldb_module * module, const struct ldb_d
int ret, i;
/* create a local ctx */
- local_ctx = talloc_named(lsqlite3, 0, "lsqlite3_search_by_tree local context");
+ local_ctx = talloc_named(lsqlite3, 0, "lsqlite3_search_bytree local context");
if (local_ctx == NULL) {
return -1;
}
@@ -990,43 +990,6 @@ failed:
return -1;
}
-/* search for matching records, by expression */
-static int lsqlite3_search(struct ldb_module * module, const struct ldb_dn *basedn,
- enum ldb_scope scope, const char * expression,
- const char * const *attrs, struct ldb_message *** res)
-{
- struct ldb_parse_tree * tree;
- int ret;
-
- /* Handle tdb specials */
- if (ldb_dn_is_special(basedn)) {
-#warning "handle tdb specials"
- return 0;
- }
-
-#if 0
-/* (|(objectclass=*)(dn=*)) is passed by the command line tool now instead */
- /* Handle the special case of requesting all */
- if (pExpression != NULL && *pExpression == '\0') {
- pExpression = "dn=*";
- }
-#endif
-
- /* Parse the filter expression into a tree we can work with */
- if ((tree = ldb_parse_tree(module->ldb, expression)) == NULL) {
- return -1;
- }
-
- /* Now use the bytree function for the remainder of processing */
- ret = lsqlite3_search_bytree(module, basedn, scope, tree, attrs, res);
-
- /* Free the parse tree */
- talloc_free(tree);
-
- /* All done. */
- return ret;
-}
-
/* add a record */
static int lsqlite3_add(struct ldb_module *module, const struct ldb_message *msg)
@@ -1820,7 +1783,6 @@ destructor(void *p)
*/
static const struct ldb_module_ops lsqlite3_ops = {
.name = "sqlite",
- .search = lsqlite3_search,
.search_bytree = lsqlite3_search_bytree,
.add_record = lsqlite3_add,
.modify_record = lsqlite3_modify,