svn commit: samba r7287 - in branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3: .

derrell at samba.org derrell at samba.org
Sat Jun 4 23:19:42 GMT 2005


Author: derrell
Date: 2005-06-04 23:19:41 +0000 (Sat, 04 Jun 2005)
New Revision: 7287

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7287

Log:
work in progress.  no more time to work on this right now.  save latest changes.
Modified:
   branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/README
   branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/README
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/README	2005-06-04 22:30:38 UTC (rev 7286)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/README	2005-06-04 23:19:41 UTC (rev 7287)
@@ -2,3 +2,6 @@
 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

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c	2005-06-04 22:30:38 UTC (rev 7286)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c	2005-06-04 23:19:41 UTC (rev 7287)
@@ -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 @@
                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 @@
         return -1;
 }
 
-#if 0 /* not currently used * /
+#if 0 /* not currently used */
 /*
  * free a search result
  */
@@ -342,7 +387,7 @@
 	if (*res) lsqlite3_search_free(module, *res);
 	return -1;
 #else
-        return 0;
+        return -1;
 #endif
 }
 
@@ -453,7 +498,8 @@
                    char * pDN,
                    long long * pEID)
 {
-
+#warning "*** lsqlite3_insert_dn() not yet implemented ***"
+        return -1;
 }
 
 
@@ -877,7 +923,7 @@
 	lsqlite3->options = NULL;
         lsqlite3->lock_count = 0;
 
-	ret = lsqlite3_initialize(&lsqlite3, url);
+	ret = lsqlite3_initialize(lsqlite3, url);
 	if (ret != SQLITE_OK) {
 		goto failed;
 	}



More information about the samba-cvs mailing list