r10088: Add support for blob result type
authorKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 7 Oct 2004 18:38:35 +0000 (18:38 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 7 Oct 2004 18:38:35 +0000 (18:38 +0000)
ChangeLog
db-mysql/mysql-sql.lisp
uffi/clsql-uffi.lisp

index a199e8f6bb42357301e23d164dbf2088920b87b3..56b1a4772e263f65ac9e6e6f48735ec352e9d870 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+07 Oct 2004 Kevin Rosenberg <kevin@rosenberg.net>
+       * uffi/clsql-uffi.lisp: Add support for :blob result-type
+       * db-mysql/mysql-sql.lisp: Add support for :blob
+       result-type
+       
 04 Oct 2004 Kevin Rosenberg <kevin@rosenberg.net>
        * db-mysql/mysql-sql.lisp, db-db2/db2-sql.lisp: Add
        missing quotes for types in code that is still in development
index 33d84e7ff3dbe9aa2ceccd229aa02edfb7f2b4bd..c202a5e29d80aa929c3cafcbfae4fec113655a40 100644 (file)
@@ -41,7 +41,7 @@
     (dotimes (i num-fields)
       (declare (fixnum i))
       (let* ((field (uffi:deref-array field-vec '(:array mysql-field) i))
-             (type (uffi:get-slot-value field 'mysql-field 'type)))
+            (type (uffi:get-slot-value field 'mysql-field 'type)))
        (push
         (case type
           ((#.mysql-field-types#tiny 
index c12f693368887598e3d41852d317cf446b81c288..d901481dce0dbbe853e997cad73717e911b228c4 100644 (file)
@@ -54,7 +54,9 @@
           (:int64
            (if (eq :int64 (nth i auto-list))
                :int64
-               t))
+             t))
+          (:blob
+           :blob)
           (t
            t))
         new-types))))
                  (high32 (uffi:deref-pointer high32-ptr :int)))
              (if (zerop high32)
                  low32
-                 (make-64-bit-integer high32 low32)))))
+               (make-64-bit-integer high32 low32)))))
+        (:blob
+         (if length
+             (uffi:convert-from-foreign-usb8 char-ptr length)
+           (error "Can't return blob since length is not specified.")))
         (t
           (if length
              (uffi:convert-from-foreign-string char-ptr :locale :none