From 2d7fb2dcce0f94745672b4f2aff6be39d610a063 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Thu, 7 Oct 2004 18:38:35 +0000 Subject: [PATCH] r10088: Add support for blob result type --- ChangeLog | 5 +++++ db-mysql/mysql-sql.lisp | 2 +- uffi/clsql-uffi.lisp | 10 ++++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a199e8f..56b1a47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +07 Oct 2004 Kevin Rosenberg + * 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 * db-mysql/mysql-sql.lisp, db-db2/db2-sql.lisp: Add missing quotes for types in code that is still in development diff --git a/db-mysql/mysql-sql.lisp b/db-mysql/mysql-sql.lisp index 33d84e7..c202a5e 100644 --- a/db-mysql/mysql-sql.lisp +++ b/db-mysql/mysql-sql.lisp @@ -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 diff --git a/uffi/clsql-uffi.lisp b/uffi/clsql-uffi.lisp index c12f693..d901481 100644 --- a/uffi/clsql-uffi.lisp +++ b/uffi/clsql-uffi.lisp @@ -54,7 +54,9 @@ (:int64 (if (eq :int64 (nth i auto-list)) :int64 - t)) + t)) + (:blob + :blob) (t t)) new-types)))) @@ -116,7 +118,11 @@ (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 -- 2.34.1