+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.
-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).
;; 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)))
: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."))
;;; 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.
;;;
+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
(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)))
(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)))
(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)))
(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)))
))
(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)))))