r9831: * db-aodbc/aodbc-sql.lisp: Fix storage location
authorKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 3 Aug 2004 06:27:00 +0000 (06:27 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 3 Aug 2004 06:27:00 +0000 (06:27 +0000)
        of odbc connection. Specialize database-query since
        dbi's :types keyword is different than generic-odbc's
        :result-types keyword
        * sql/db-interface.lisp: Add warnings for methods
        not specialized by a db backends
        * tests/test-fddl.lisp: Fix case of symbols to support
        case-sensitive Allegro
        * db-oracle/oracle-sql.lisp: Rework errbuf in handle-oci-error
        * tests/test-init.lisp: Note that odbc driver for postgresql
        doesn't properly handle table ownership

ChangeLog
LATEST-TEST-RESULTS
db-aodbc/aodbc-sql.lisp
db-oracle/oracle-sql.lisp
debian/changelog
sql/db-interface.lisp
tests/test-fddl.lisp
tests/test-init.lisp

index 801bd68b280e91fec8a1bc922152cf173c567e73..f9dd7381e62c58b782502a0f7c497307a924b0d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+3 Aug 2004 Kevin Rosenberg <kevin@rosenberg.net>
+       * Version 3.0.0 Release
+       * db-aodbc/aodbc-sql.lisp: Fix storage location
+       of odbc connection. Specialize database-query since
+       dbi's :types keyword is different than generic-odbc's
+       :result-types keyword
+       * sql/db-interface.lisp: Add warnings for methods
+       not specialized by a db backends
+       * tests/test-fddl.lisp: Fix case of symbols to support
+       case-sensitive Allegro 
+       * db-oracle/oracle-sql.lisp: Rework errbuf in handle-oci-error
+       * tests/test-init.lisp: Note that odbc driver for postgresql
+       doesn't properly handle table ownership
+       * LATEST-TEST-RESULTS: update with version 3.0.0
+       
 1 Aug 2004 Marcus Pearce <m.t.pearce@city.ac.uk> 
        * sql/expressions.lisp: conditionalise escaping of backslash in 
        generated SQL strings on backend. 
index cd03579d835964810e1f29964f3354129bec5f2b..acc91b46b34b932b78823e81c266c2d2abc39ca8 100644 (file)
@@ -1,52 +1,31 @@
-Version 2.10.17 run on May 13, 2004 on x86, x86_64, and PowerPC platforms
+Version 3.0.0 run on August 3, 2004 on x86, x86_64, and PowerPC platforms
 
-POSTGRESQL: All 174 tests passed (64-bit AMD64, Allegro CL Enterprise Edition).
-POSTGRESQL-SOCKET: All 174 tests passed (64-bit AMD64, Allegro CL Enterprise Edition).
-MYSQL: All 158 tests passed (64-bit AMD64, Allegro CL Enterprise Edition).
-SQLITE: All 168 tests passed (64-bit AMD64, Allegro CL Enterprise Edition).
-ODBC/POSTGRESQL: All 174 tests passed (64-bit AMD64, Allegro CL Enterprise Edition).
-ODBC/MYSQL: All 158 tests passed (64-bit AMD64, Allegro CL Enterprise Edition).
-
-POSTGRESQL: All 174 tests passed (X86, SBCL).
-POSTGRESQL-SOCKET: All 174 tests passed (X86, SBCL).
-MYSQL: All 158 tests passed (X86, SBCL).
-SQLITE: All 168 tests passed (X86, SBCL).
-ODBC/POSTGRESQL: All 174 tests passed (X86, SBCL).
-ODBC/MYSQL: All 158 tests passed (X86, SBCL).
-POSTGRESQL: All 174 tests passed (x86, Allegro CL Enterprise Edition).
-POSTGRESQL-SOCKET: All 174 tests passed (x86, Allegro CL Enterprise Edition).
-MYSQL: All 158 tests passed (x86, Allegro CL Enterprise Edition).
-SQLITE: All 168 tests passed (x86, Allegro CL Enterprise Edition).
-ODBC/POSTGRESQL: All 174 tests passed (x86, Allegro CL Enterprise Edition).
-ODBC/MYSQL: All 158 tests passed (x86, Allegro CL Enterprise Edition).
-POSTGRESQL: All 174 tests passed (X86, CMU Common Lisp).
-POSTGRESQL-SOCKET: All 174 tests passed (X86, CMU Common Lisp).
-MYSQL: All 158 tests passed (X86, CMU Common Lisp).
-SQLITE: All 168 tests passed (X86, CMU Common Lisp).
-ODBC/POSTGRESQL: All 174 tests passed (X86, CMU Common Lisp).
-ODBC/MYSQL: All 158 tests passed (X86, CMU Common Lisp).
-POSTGRESQL: All 174 tests passed (NIL, LispWorks).
-POSTGRESQL-SOCKET: All 174 tests passed (NIL, LispWorks).
-MYSQL: All 158 tests passed (NIL, LispWorks).
-SQLITE: All 168 tests passed (NIL, LispWorks).
-ODBC/POSTGRESQL: All 174 tests passed (NIL, LispWorks).
-ODBC/MYSQL: All 158 tests passed (NIL, LispWorks).
-
-POSTGRESQL: All 174 tests passed (PowerPC, Allegro CL Enterprise Edition).
-POSTGRESQL-SOCKET: All 174 tests passed (PowerPC, Allegro CL Enterprise Edition).
-MYSQL: All 158 tests passed (PowerPC, Allegro CL Enterprise Edition).
-SQLITE: All 168 tests passed (PowerPC, Allegro CL Enterprise Edition).
-ODBC/MYSQL: All 158 tests passed (PowerPC, Allegro CL Enterprise Edition).
-ODBC/POSTGRESQL: All 174 tests passed (PowerPC, Allegro CL Enterprise Edition).
-POSTGRESQL: All 174 tests passed (PowerPC, SBCL).
-POSTGRESQL-SOCKET: All 174 tests passed (PowerPC, SBCL).
-MYSQL: All 158 tests passed (PowerPC, SBCL).
-SQLITE: All 168 tests passed (PowerPC, SBCL).
-ODBC/MYSQL: All 158 tests passed (PowerPC, SBCL).
-ODBC/POSTGRESQL: All 174 tests passed (PowerPC, SBCL).
-POSTGRESQL: All 174 tests passed (ppc, OpenMCL).
-POSTGRESQL-SOCKET: All 174 tests passed (ppc, OpenMCL).
-MYSQL: All 158 tests passed (ppc, OpenMCL).
-SQLITE: All 168 tests passed (ppc, OpenMCL).
-ODBC/MYSQL: All 158 tests passed (ppc, OpenMCL).
-ODBC/POSTGRESQL: All 174 tests passed (ppc, OpenMCL).
+POSTGRESQL: All 233 tests passed (x86, International Allegro CL Enterprise Edition).
+POSTGRESQL-SOCKET/POSTGRESQL: All 233 tests passed (x86, International Allegro CL Enterprise Edition).
+MYSQL: All 213 tests passed (x86, International Allegro CL Enterprise Edition).
+SQLITE: All 224 tests passed (x86, International Allegro CL Enterprise Edition).
+ODBC/POSTGRESQL: All 232 tests passed (x86, International Allegro CL Enterprise Edition).
+ODBC/MYSQL: All 213 tests passed (x86, International Allegro CL Enterprise Edition).
+ORACLE: All 227 tests passed (x86, International Allegro CL Enterprise Edition).
+AODBC/UNKNOWN: 23 of 231 tests failed (x86, International Allegro CL Enterprise Edition).
+POSTGRESQL: All 233 tests passed (X86, CMU Common Lisp).
+POSTGRESQL-SOCKET/POSTGRESQL: All 233 tests passed (X86, CMU Common Lisp).
+MYSQL: All 213 tests passed (X86, CMU Common Lisp).
+SQLITE: All 224 tests passed (X86, CMU Common Lisp).
+ODBC/POSTGRESQL: All 232 tests passed (X86, CMU Common Lisp).
+ODBC/MYSQL: All 213 tests passed (X86, CMU Common Lisp).
+ORACLE: All 227 tests passed (X86, CMU Common Lisp).
+POSTGRESQL: All 233 tests passed (NIL, LispWorks).
+POSTGRESQL-SOCKET/POSTGRESQL: All 233 tests passed (NIL, LispWorks).
+MYSQL: All 213 tests passed (NIL, LispWorks).
+SQLITE: All 224 tests passed (NIL, LispWorks).
+ODBC/POSTGRESQL: All 232 tests passed (NIL, LispWorks).
+ODBC/MYSQL: All 213 tests passed (NIL, LispWorks).
+ORACLE: All 227 tests passed (NIL, LispWorks).
+POSTGRESQL: All 233 tests passed (X86, SBCL).
+POSTGRESQL-SOCKET/POSTGRESQL: All 233 tests passed (X86, SBCL).
+MYSQL: All 213 tests passed (X86, SBCL).
+SQLITE: All 224 tests passed (X86, SBCL).
+ODBC/POSTGRESQL: All 232 tests passed (X86, SBCL).
+ODBC/MYSQL: All 213 tests passed (X86, SBCL).
+ORACLE: All 227 tests passed (X86, SBCL).
index 7994892302efb0dd29b06f330e32c32fd1cafc11..8cd30769a8329db74f48d0ca5e3112664218209d 100644 (file)
@@ -34,8 +34,7 @@
 ;; AODBC interface
 
 (defclass aodbc-database (generic-odbc-database)
-  ((aodbc-conn :accessor database-aodbc-conn :initarg :aodbc-conn)
-   (aodbc-db-type :accessor database-aodbc-db-type :initform :unknown)))
+  ((aodbc-db-type :accessor database-aodbc-db-type :initform :unknown)))
 
 (defmethod database-name-from-spec (connection-spec
                                    (database-type (eql :aodbc)))
@@ -53,7 +52,7 @@
          :name (database-name-from-spec connection-spec :aodbc)
          :database-type :aodbc
          :dbi-package (find-package '#:dbi)
-         :aodbc-conn
+         :odbc-conn
          (dbi:connect :user user
                       :password password
                       :data-source-name dsn))
               :message "Connection failed")))))
 
 
+(defmethod database-query (query-expression (database aodbc-database) 
+                          result-types field-names)
+  #+aodbc-v2
+  (handler-case
+      (dbi:sql query-expression
+              :db (clsql-sys::odbc-conn database)
+              :types result-types
+              :column-names field-names)
+    #+ignore
+    (error ()
+      (error 'sql-database-data-error
+            :database database
+            :expression query-expression
+            :message "Query failed"))))
 
 (defmethod database-create (connection-spec (type (eql :aodbc)))
   (warn "Not implemented."))
index d59665de16c8815b5fc572004b4c6827ac62e75c..03480682f823b91a691533ba217c9239eca6fb5c 100644 (file)
@@ -126,36 +126,37 @@ the length of that format.")
 ;;; NULLS-OK are as in the OERR function.
 
 (defun handle-oci-error (&key database nulls-ok)
-  (cond (database
-         (with-slots (errhp) database
-           (uffi:with-foreign-objects ((errbuf '(:array :unsigned-char
-                                                #.+errbuf-len+))
-                                      (errcode :long))
-            ;; ensure errbuf empty string
-             (setf (uffi:deref-array errbuf '(:array :unsigned-char) 0)
-              (uffi:ensure-char-storable (code-char 0)))
-             (setf (uffi:deref-pointer errcode :long) 0)
-            
-            (uffi:with-cstring (sqlstate nil)
-              (oci-error-get (deref-vp errhp) 1
-                             sqlstate
-                             errcode
-                             (uffi:char-array-to-pointer errbuf)
-                             +errbuf-len+ +oci-htype-error+))
-             (let ((subcode (uffi:deref-pointer errcode :long)))
-               (unless (and nulls-ok (= subcode +null-value-returned+))
-                 (error 'sql-database-error
-                        :database database
-                        :error-id subcode
-                        :message (uffi:convert-from-foreign-string errbuf)))))))
-       (nulls-ok
-        (error 'sql-database-error
-                :database database
-                :message "can't handle NULLS-OK without ERRHP"))
-       (t 
-        (error 'sql-database-error
-                :database database
-                :message "OCI Error (and no ERRHP available to find subcode)"))))
+  (cond
+    (database
+     (with-slots (errhp) database
+       (uffi:with-foreign-object (errcode :long)
+        (let ((errbuf (uffi:allocate-foreign-string #.+errbuf-len+)))
+          ;; ensure errbuf empty string
+          (setf (uffi:deref-array errbuf '(:array :unsigned-char) 0)
+                (uffi:ensure-char-storable (code-char 0)))
+          (setf (uffi:deref-pointer errcode :long) 0)
+          
+          (uffi:with-cstring (sqlstate nil)
+            (oci-error-get (deref-vp errhp) 1
+                           sqlstate
+                           errcode
+                           (uffi:char-array-to-pointer errbuf)
+                           +errbuf-len+ +oci-htype-error+))
+          (let ((subcode (uffi:deref-pointer errcode :long)))
+            (unless (and nulls-ok (= subcode +null-value-returned+))
+              (error 'sql-database-error
+                     :database database
+                     :error-id subcode
+                     :message (uffi:convert-from-foreign-string errbuf))))
+          (uffi:free-foreign-object errbuf)))))
+    (nulls-ok
+         (error 'sql-database-error
+                :database database
+                :message "can't handle NULLS-OK without ERRHP"))
+        (t 
+         (error 'sql-database-error
+                :database database
+                :message "OCI Error (and no ERRHP available to find subcode)"))))
 
 ;;; Require an OCI success code.
 ;;;
index 9b9f7c65140517afa5e21f4c97ed490b272385b3..c3d11b6ef688d8be8f4340a1dd0fde0970c9a740 100644 (file)
@@ -1,3 +1,9 @@
+cl-sql (3.0.0-1) unstable; urgency=low
+
+  * New upstream
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Mon,  2 Aug 2004 19:32:39 -0600
+
 cl-sql (2.11.16-1) unstable; urgency=low
 
   * New upstream
index d6b1abe9c61c50a26e274485d3a59e7cebffefb1..cc5328728b1b9da4d1f53961d0a07e0c08e72c3c 100644 (file)
@@ -172,6 +172,10 @@ the given lisp type and parameters."))
 
 (defgeneric database-list-tables (database &key owner)
   (:documentation "List all tables in the given database")
+  (:method ((database database) &key owner)
+          (declare (ignore owner))
+          (warn "database-list-tables not implemented for database type ~A."
+                (database-type database)))
   (:method ((database t) &key owner)
           (declare (ignore owner))
           (signal-no-database-error database)))
@@ -186,24 +190,40 @@ the given lisp type and parameters."))
  
 (defgeneric database-list-views (database &key owner)
   (:documentation "List all views in the DATABASE.")
+  (:method ((database database) &key owner)
+          (declare (ignore owner))
+          (warn "database-list-views not implemented for database type ~A."
+                (database-type database)))
   (:method ((database t) &key owner)
           (declare (ignore owner))
           (signal-no-database-error database)))
 
 (defgeneric database-list-indexes (database &key owner)
   (:documentation "List all indexes in the DATABASE.")
-  (:method ((database t) &key owner)
+  (:method ((database database) &key owner)
           (declare (ignore owner))
-          (signal-no-database-error database)))
+          (warn "database-list-indexes not implemented for database type ~A."
+                (database-type database)))
+  (:method ((database t) &key owner)
+    (declare (ignore owner))
+    (signal-no-database-error database)))
 
 (defgeneric database-list-table-indexes (table database &key owner)
   (:documentation "List all indexes for a table in the DATABASE.")
+  (:method (table (database database) &key owner)
+          (declare (ignore table owner))
+          (warn "database-list-table-indexes not implemented for database type ~A."
+                (database-type database)))
   (:method (table (database t) &key owner) 
           (declare (ignore table owner))
           (signal-no-database-error database)))
 
 (defgeneric database-list-attributes (table database &key owner)
   (:documentation "List all attributes in TABLE.")
+  (:method (table (database database) &key owner)
+          (declare (ignore table owner))
+          (warn "database-list-attributes not implemented for database type ~A."
+                (database-type database)))
   (:method (table (database t) &key owner)
           (declare (ignore table owner))
           (signal-no-database-error database)))
@@ -211,18 +231,30 @@ the given lisp type and parameters."))
 (defgeneric database-attribute-type (attribute table database &key owner)
   (:documentation "Return the type of ATTRIBUTE in TABLE. Returns multiple values
 of TYPE_NAME (keyword) PRECISION SCALE NULLABLE.")
+  (:method (attribute table (database database) &key owner)
+          (declare (ignore attribute table owner))
+          (warn "database-list-attribute-type not implemented for database type ~A."
+                (database-type database)))
   (:method (attribute table (database t) &key owner)
           (declare (ignore attribute table owner))
           (signal-no-database-error database)))
 
 (defgeneric database-add-attribute (table attribute database)
   (:documentation "Add the attribute to the table.")
+  (:method (table attribute (database database))
+          (declare (ignore table attribute))
+          (warn "database-add-attribute not implemented for database type ~A."
+                (database-type database)))
   (:method (table attribute (database t))
           (declare (ignore table attribute))
           (signal-no-database-error database)))
 
 (defgeneric database-rename-attribute (table oldatt newname database)
   (:documentation "Rename the attribute in the table to NEWNAME.")
+  (:method (table oldatt newname (database database))
+          (declare (ignore table oldatt newname))
+          (warn "database-rename-attribute not implemented for database type ~A."
+                (database-type database)))
   (:method (table oldatt newname (database t))
           (declare (ignore table oldatt newname))
           (signal-no-database-error database)))
index 8c54c3fb4319824227dcdcc73b75b20f48a13bc3..f5527c773f7cce25f3ff017cc3f6c40cddb7f28f 100644 (file)
   (progn 
     (clsql:cache-table-queries "EMPLOYEE" :action :flush)
     (gethash "EMPLOYEE" (clsql-sys::attribute-cache clsql:*default-database*))))
- (NIL (T NIL) T (T NIL)))
+ (nil (t nil) t (t nil)))
 
   ))
 
index e3a0a03098fbad4ae001f6cccd2dff56656f9e8f..5fc308d0b3128a4c1d51cd4fca11331e9df2c834 100644 (file)
                (clsql-sys:in test :fdml/query/8 :fdml/select/21 
                               :fddl/table/6))
           (push (cons test "syntax not supported") skip-tests))
-          ((and (not (member *test-database-underlying-type* 
+          ((and (eq *test-database-type* :odbc)
+               (eq *test-database-underlying-type* :postgresql)
+               (clsql-sys:in test :fddl/owner/1))
+           (push (cons test "table ownership not supported by postgresql odbc driver") skip-tests))
+         ((and (not (member *test-database-underlying-type* 
                              '(:postgresql :oracle)))
-                (clsql-sys:in test :fddl/owner/1))
+               (clsql-sys:in test :fddl/owner/1))
            (push (cons test "table ownership not supported") skip-tests))
          (t
           (push test-form test-forms)))))