X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=db-oracle%2Foracle-sql.lisp;h=3c6c226592edbd3d26c27ca7a69ba626320aef63;hb=99df5f6ad5b46a65d5698ebb85f95fa71f861da5;hp=aedff1bab29dc4cb5889f0f75cdb634f0f3e4dca;hpb=d0b59237966d6fbc27adcbbae11fa85087ea122d;p=clsql.git diff --git a/db-oracle/oracle-sql.lisp b/db-oracle/oracle-sql.lisp index aedff1b..3c6c226 100644 --- a/db-oracle/oracle-sql.lisp +++ b/db-oracle/oracle-sql.lisp @@ -146,9 +146,12 @@ the length of that format.") (uffi:ensure-char-storable (code-char 0))) (setf (uffi:deref-pointer errcode :long) 0) - (oci-error-get (deref-vp errhp) 1 - (uffi:make-null-pointer :unsigned-char) - errcode errbuf +errbuf-len+ +oci-htype-error+) + (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 @@ -208,10 +211,10 @@ the length of that format.") ;; In order to map the "same string" property above onto Lisp equality, ;; we drop trailing spaces in all cases: -(uffi:def-type string-array (:array :unsigned-char)) +(uffi:def-type string-pointer (* :unsigned-char)) (defun deref-oci-string (arrayptr string-index size) -;; (declare (type string-array arrayptr)) + (declare (type string-pointer arrayptr)) (declare (type (mod #.+n-buf-rows+) string-index)) (declare (type (and unsigned-byte fixnum) size)) (let* ((raw (uffi:convert-from-foreign-string