From: Kevin M. Rosenberg Date: Fri, 1 Oct 2004 17:02:20 +0000 (+0000) Subject: r10077: * multiple: Apply patch from Joerg Hoehle with multiple X-Git-Tag: v3.8.6~225 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=d9f41af62750c622945bb17b622a39689ee5b840 r10077: * multiple: Apply patch from Joerg Hoehle with multiple improvements. --- diff --git a/ChangeLog b/ChangeLog index a7f126c..aa3d6f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +01 Oct 2004 Kevin Rosenberg + * multiple: Apply patch from Joerg Hoehle with multiple + improvements. + 01 Oct 2004 Kevin Rosenberg * Version 3.0.7 released * sql/oodml.lisp, sql/package.lisp, db-mysql/mysql-objects.lisp: diff --git a/clsql-mysql.asd b/clsql-mysql.asd index cbcd914..3780827 100644 --- a/clsql-mysql.asd +++ b/clsql-mysql.asd @@ -72,7 +72,6 @@ ;;; System definition -#+(or allegro lispworks cmu sbcl openmcl mcl scl) (defsystem :clsql-mysql :name "cl-sql-mysql" :author "Kevin M. Rosenberg " diff --git a/clsql-odbc.asd b/clsql-odbc.asd index ca2ec19..5913bed 100644 --- a/clsql-odbc.asd +++ b/clsql-odbc.asd @@ -19,7 +19,6 @@ (defpackage #:clsql-odbc-system (:use #:asdf #:cl)) (in-package #:clsql-odbc-system) -#+(or allegro lispworks cmu sbcl openmcl mcl scl) (defsystem clsql-odbc :name "clsql-odbc" :author "Kevin M. Rosenberg " diff --git a/clsql-postgresql-socket.asd b/clsql-postgresql-socket.asd index 3862a3a..e5e1320 100644 --- a/clsql-postgresql-socket.asd +++ b/clsql-postgresql-socket.asd @@ -21,7 +21,6 @@ ;;; System definition -#+(or allegro lispworks cmu sbcl openmcl mcl scl) (defsystem clsql-postgresql-socket :name "cl-sql-postgresql-socket" :author "Kevin M. Rosenberg " diff --git a/clsql-postgresql.asd b/clsql-postgresql.asd index 81c1712..84e3606 100644 --- a/clsql-postgresql.asd +++ b/clsql-postgresql.asd @@ -21,7 +21,6 @@ #+(and allegro macosx) (push "so" excl::*load-foreign-types*) -#+(or allegro lispworks cmu sbcl openmcl mcl scl) (defsystem clsql-postgresql :name "cl-sql-postgresql" :author "Kevin M. Rosenberg " diff --git a/clsql-uffi.asd b/clsql-uffi.asd index e3aec75..ad9f93f 100644 --- a/clsql-uffi.asd +++ b/clsql-uffi.asd @@ -76,7 +76,6 @@ (and (probe-file lib) (> (file-write-date lib) (file-write-date (component-pathname c))))))) -#+(or allegro lispworks cmu sbcl openmcl mcl scl) (defsystem clsql-uffi :name "cl-sql-base" :author "Kevin M. Rosenberg " diff --git a/db-odbc/odbc-api.lisp b/db-odbc/odbc-api.lisp index 3b1beb0..eb68f20 100644 --- a/db-odbc/odbc-api.lisp +++ b/db-odbc/odbc-api.lisp @@ -648,7 +648,6 @@ as possible second argument) to the desired representation of date/time/timestam (#.$SQL_INTEGER (get-cast-int data-ptr)) (#.$SQL_BIGINT (read-from-string (get-cast-foreign-string data-ptr))) - (#.$SQL_TINYINT (get-cast-byte data-ptr)) (#.$SQL_DECIMAL (let ((*read-base* 10)) (read-from-string (get-cast-foreign-string data-ptr)))) diff --git a/db-odbc/odbc-ff-interface.lisp b/db-odbc/odbc-ff-interface.lisp index 00e7cd6..a7153c8 100644 --- a/db-odbc/odbc-ff-interface.lisp +++ b/db-odbc/odbc-ff-interface.lisp @@ -384,7 +384,10 @@ (table-name :pointer-void) (table-name-length :short) (table-type-name :pointer-void) - (table-type-name-length :short)) + (table-type-name-length :short) + (unique :short) + (reserved :short)) + :module "odbc" :returning :short) @@ -398,6 +401,7 @@ (table-name-length :short) (unique :short) (reserved :short)) + :module "odbc" :returning :short) diff --git a/db-odbc/odbc-package.lisp b/db-odbc/odbc-package.lisp index 71cd96d..baedbed 100644 --- a/db-odbc/odbc-package.lisp +++ b/db-odbc/odbc-package.lisp @@ -59,7 +59,6 @@ #:query-database #:%new-statement-handle #:%sql-exec-direct - #:%put-str #:result-columns-count #:result-rows-count #:sql-to-c-type diff --git a/db-oracle/oracle-api.lisp b/db-oracle/oracle-api.lisp index eab4c6b..1e21b81 100644 --- a/db-oracle/oracle-api.lisp +++ b/db-oracle/oracle-api.lisp @@ -60,8 +60,6 @@ (error 'sql-database-error :message "OCI No Data Found")) (#.+oci-success-with-info+ (error 'sql-database-error :message "internal error: unexpected +oci-success-with-info")) - (#.+oci-no-data+ - (error 'sql-database-error :message "OCI No Data")) (#.+oci-invalid-handle+ (error 'sql-database-error :message "OCI Invalid Handle")) (#.+oci-need-data+ diff --git a/db-postgresql/postgresql-api.lisp b/db-postgresql/postgresql-api.lisp index 43b3f20..6f4908f 100644 --- a/db-postgresql/postgresql-api.lisp +++ b/db-postgresql/postgresql-api.lisp @@ -71,6 +71,7 @@ (dbName :cstring) (login :cstring) (pwd :cstring)) + :module "postgresql" :returning pgsql-conn) (declaim (inline PQfinish)) diff --git a/db-postgresql/postgresql-sql.lisp b/db-postgresql/postgresql-sql.lisp index 2d307c2..6a8c7c8 100644 --- a/db-postgresql/postgresql-sql.lisp +++ b/db-postgresql/postgresql-sql.lisp @@ -428,7 +428,8 @@ (coerce-string user) (let ((connection (PQsetdbLogin host port options tty db user password))) (declare (type postgresql::pgsql-conn-ptr connection)) - (unless (eq (PQstatus connection) :connection-ok) + (unless (eq (PQstatus connection) + pgsql-conn-status-type#connection-ok) ;; Connect failed (error 'sql-connection-error :database-type :postgresql diff --git a/sql/conditions.lisp b/sql/conditions.lisp index bd36b8c..5e805e1 100644 --- a/sql/conditions.lisp +++ b/sql/conditions.lisp @@ -43,10 +43,8 @@ or :ignore/nil to silently ignore the warning.") :initform nil :reader sql-error-database)) (:report (lambda (c stream) - (format stream "A database error occurred~A: ~A / ~A~% ~A" - (if (sql-error-database c) - (format nil " on database ~A" (sql-error-database c)) - "") + (format stream "A database error occurred~@[ on database ~A~]: ~A / ~A~% ~A" + (sql-error-database c) (sql-error-error-id c) (sql-error-secondary-error-id c) (sql-error-database-message c)))) diff --git a/sql/oodml.lisp b/sql/oodml.lisp index 142e516..f3c4437 100644 --- a/sql/oodml.lisp +++ b/sql/oodml.lisp @@ -1148,7 +1148,8 @@ as elements of a list." (unless (record-caches database) (setf (record-caches database) (make-hash-table :test 'equal - #+allegro :values #+allegro :weak + #+allegro :values #+allegro :weak + #+clisp :weak #+clisp :value #+lispworks :weak-kind #+lispworks :value))) (setf (gethash (compute-records-cache-key targets qualifiers) (record-caches database)) results) diff --git a/sql/utils.lisp b/sql/utils.lisp index a23a820..362d16c 100644 --- a/sql/utils.lisp +++ b/sql/utils.lisp @@ -56,7 +56,9 @@ (symbol (symbol-name identifier)) (string identifier))) (escaped (make-string (length unescaped)))) - (dotimes (i (length unescaped)) + (substitute #\_ #\- unescaped))) + +(dotimes (i (length unescaped)) (setf (char escaped i) (cond ((equal (char unescaped i) #\-) #\_) @@ -66,11 +68,12 @@ escaped)) (defmacro without-interrupts (&body body) - #+lispworks `(mp:without-preemption ,@body) #+allegro `(mp:without-scheduling ,@body) + #+clisp `(progn ,@body) #+cmu `(system:without-interrupts ,@body) - #+sbcl `(sb-sys::without-interrupts ,@body) - #+openmcl `(ccl:without-interrupts ,@body)) + #+lispworks `(mp:without-preemption ,@body) + #+openmcl `(ccl:without-interrupts ,@body) + #+sbcl `(sb-sys::without-interrupts ,@body)) (defun make-process-lock (name) #+allegro (mp:make-process-lock :name name) diff --git a/tests/utils.lisp b/tests/utils.lisp index 8e274d9..eb10ec3 100644 --- a/tests/utils.lisp +++ b/tests/utils.lisp @@ -24,9 +24,8 @@ :type "config")) (defvar +all-db-types+ - #-clisp '(:postgresql :postgresql-socket :mysql :sqlite :odbc :oracle - #+allegro :aodbc) - #+clisp '(:sqlite)) + '(:postgresql :postgresql-socket :mysql :sqlite :odbc :oracle + #+allegro :aodbc)) (defclass conn-specs () ((aodbc :accessor aodbc-spec :initform nil) diff --git a/uffi/clsql-uffi.lisp b/uffi/clsql-uffi.lisp index 1bb9a1a..c12f693 100644 --- a/uffi/clsql-uffi.lisp +++ b/uffi/clsql-uffi.lisp @@ -30,7 +30,7 @@ (nreverse new-types)) (declare (fixnum length-types length-auto-list i)) (if (>= i length-types) - (push t new-types) ;; types is shorted than num-fields + (push t new-types) ;; types is shorter than num-fields (push (case (nth i types) (:int @@ -74,6 +74,7 @@ (uffi:def-function "atol64" ((str (* :unsigned-char)) (high32 (* :int))) + :module "clsql-uffi" :returning :unsigned-int) (uffi:def-constant +2^32+ 4294967296) @@ -97,7 +98,7 @@ (defun convert-raw-field (char-ptr types index &optional length) (declare (optimize (speed 3) (safety 0) (space 0)) (type char-ptr-def char-ptr)) - (let ((type (if (listp types) + (let ((type (if (consp types) (nth index types) types))) (cond @@ -107,7 +108,7 @@ (case type (:double (atof char-ptr)) - ((or :int32 :int) + ((:int32 :int) (atoi char-ptr)) (:int64 (uffi:with-foreign-object (high32-ptr :int)