summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2005-06-04 23:19:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:36 -0500
commit06cc74a66cef3944573e4390af0ee101517835df (patch)
tree93a1342d5d1e7159ee5df3558010600e6b4afb2c
parent1b454c430f0ce2e86350052b5a4e23f899e9eee9 (diff)
downloadsamba-06cc74a66cef3944573e4390af0ee101517835df.tar.gz
samba-06cc74a66cef3944573e4390af0ee101517835df.tar.bz2
samba-06cc74a66cef3944573e4390af0ee101517835df.zip
r7287: work in progress. no more time to work on this right now. save latest changes.
(This used to be commit 94cbef9211597d8cdd6b5ab7bc9b655026be283a)
-rw-r--r--source4/lib/ldb/ldb_sqlite3/README3
-rw-r--r--source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c58
2 files changed, 55 insertions, 6 deletions
diff --git a/source4/lib/ldb/ldb_sqlite3/README b/source4/lib/ldb/ldb_sqlite3/README
index a0b3dcb16d..6cda0a7759 100644
--- a/source4/lib/ldb/ldb_sqlite3/README
+++ b/source4/lib/ldb/ldb_sqlite3/README
@@ -2,3 +2,6 @@ trees.ps contains an explanation of the Genealogical Representation of Trees
in Databases which is being used in ldb_sqlite3. Note that we use fgID
representation with 4 bytes per level, so we can represent 6.5E+08 subclasses
of any object class. This should be adequate for our purposes. :-)
+
+The following document is the primary basis for the schema currently being
+used here: http://www.research.ibm.com/journal/sj/392/shi.html
diff --git a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
index 6dfaa0627b..3fddbe85d4 100644
--- a/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
+++ b/source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
@@ -2,6 +2,7 @@
ldb database library
Copyright (C) Andrew Tridgell 2004
+ Copyright (C) Derrell Lipman 2005
** NOTE! The following LGPL license applies to the ldb
** library. This does NOT imply that all of Samba is released
@@ -32,6 +33,7 @@
* Author: Derrell Lipman (based on Andrew Tridgell's LDAP backend)
*/
+#include <stdarg.h>
#include "includes.h"
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_private.h"
@@ -67,19 +69,62 @@ lsqlite3_query(const struct lsqlite3_private *lsqlite3,
const char *pSql,
...)
{
+// int i;
+// int retval;
+ int numRows;
+// int numColumns;
+ int bFreeTable = False;
+// char errorBuf[4096];
+ char * p;
+// char * pError = NULL;
+ char ** ppValues;
+ va_list args;
+
+ /* Begin access to variable argument list */
+ va_start(args, pSql);
+
+ /*
+ * If they didn't give us a place to put returned values, use our own
+ */
+ if (pppValues == NULL)
+ {
+ pppValues = &ppValues;
+ bFreeTable = True;
+ }
+ /* Similarly for number of rows in result set */
+ if (pNumRows == NULL)
+ {
+ pNumRows = &numRows;
+ }
+
+ /* Format the query */
+ if ((p = sqlite3_vmprintf(pSql, args)) == NULL) {
+ return -1;
+ }
+
+
+#warning "*** FINISH QUERY FUNCTION. Catch timeouts, schema changed, etc. ***"
+
+
+ /* All done with variable argument list */
+ va_end(args);
+
+ /* Success! */
+ return 0;
}
static int
lsqlite3_create_attr_table(struct ldb_module *module,
char * pAttr)
{
-
+#warning "*** lsqlite3_create_attr_table() not yet written ***"
+ return -1;
}
#if 0
-p/*
+/*
* we don't need this right now, but will once we add some backend options
*
* find an option in an option list (a null terminated list of strings)
@@ -151,7 +196,7 @@ lsqlite3_delete(struct ldb_module *module,
return -1;
}
-#if 0 /* not currently used * /
+#if 0 /* not currently used */
/*
* free a search result
*/
@@ -342,7 +387,7 @@ failed:
if (*res) lsqlite3_search_free(module, *res);
return -1;
#else
- return 0;
+ return -1;
#endif
}
@@ -453,7 +498,8 @@ lsqlite3_insert_dn(struct lsqlite3_private * lsqlite3,
char * pDN,
long long * pEID)
{
-
+#warning "*** lsqlite3_insert_dn() not yet implemented ***"
+ return -1;
}
@@ -877,7 +923,7 @@ lsqlite3_connect(const char *url,
lsqlite3->options = NULL;
lsqlite3->lock_count = 0;
- ret = lsqlite3_initialize(&lsqlite3, url);
+ ret = lsqlite3_initialize(lsqlite3, url);
if (ret != SQLITE_OK) {
goto failed;
}