From: Kevin M. Rosenberg Date: Sun, 24 Mar 2002 18:39:32 +0000 (+0000) Subject: r1652: Stored field-types in result-set structures X-Git-Tag: v3.8.6~1222 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=d9e609eddd22c1f837d9b030ebc15b0f40ddf5f0 r1652: Stored field-types in result-set structures --- diff --git a/interfaces/aodbc/aodbc-sql.cl b/interfaces/aodbc/aodbc-sql.cl index e3eedb5..780c196 100644 --- a/interfaces/aodbc/aodbc-sql.cl +++ b/interfaces/aodbc/aodbc-sql.cl @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: aodbc-sql.cl,v 1.3 2002/03/24 18:08:27 kevin Exp $ +;;;; $Id: aodbc-sql.cl,v 1.4 2002/03/24 18:39:32 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -97,7 +97,8 @@ :query t ) (values - (make-aodbc-result-set :query query :full-set full-set) + (make-aodbc-result-set :query query :full-set full-set + :field-types field-types) (length column-names) nil ;; not able to return number of rows with aodbc )) diff --git a/interfaces/mysql/mysql-sql.cl b/interfaces/mysql/mysql-sql.cl index 804c5dc..ad22f9d 100644 --- a/interfaces/mysql/mysql-sql.cl +++ b/interfaces/mysql/mysql-sql.cl @@ -8,7 +8,7 @@ ;;;; Original code by Pierre R. Mai ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: mysql-sql.cl,v 1.4 2002/03/24 18:08:27 kevin Exp $ +;;;; $Id: mysql-sql.cl,v 1.5 2002/03/24 18:39:32 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai @@ -28,6 +28,9 @@ ;;;; for MYSQL structure. This will make the code more robust in ;;;; the event that MySQL library changes the size of the mysql-mysql ;;;; structure. +;;;; +;;;; Mar 2002 +;;;; Added field types (defpackage :clsql-mysql (:use :common-lisp :clsql-sys :mysql) @@ -134,7 +137,8 @@ -(defmethod database-query (query-expression (database mysql-database) field-types) +(defmethod database-query (query-expression (database mysql-database) + field-types) (with-slots (mysql-ptr) database (uffi:with-cstring (query-native query-expression) (if (zerop (mysql-query mysql-ptr query-native)) @@ -173,7 +177,8 @@ (declare (type mysql-mysql-res-ptr-def res-ptr)) (if (not (uffi:null-pointer-p res-ptr)) (if full-set - (values (make-mysql-result-set :res-ptr res-ptr :full-set t) + (values (make-mysql-result-set :res-ptr res-ptr :full-set t + :field-types field-types) (mysql-num-fields res-ptr) (mysql-num-rows res-ptr)) (values (make-mysql-result-set :res-ptr res-ptr) diff --git a/interfaces/postgresql-socket/postgresql-socket-sql.cl b/interfaces/postgresql-socket/postgresql-socket-sql.cl index 1570a4e..2eb6e7c 100644 --- a/interfaces/postgresql-socket/postgresql-socket-sql.cl +++ b/interfaces/postgresql-socket/postgresql-socket-sql.cl @@ -8,7 +8,7 @@ ;;;; Original code by Pierre R. Mai ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: postgresql-socket-sql.cl,v 1.2 2002/03/24 18:08:27 kevin Exp $ +;;;; $Id: postgresql-socket-sql.cl,v 1.3 2002/03/24 18:39:32 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai @@ -192,7 +192,8 @@ :error "Didn't receive result cursor for query.")) (values (make-postgresql-socket-result-set :done nil - :cursor cursor) + :cursor cursor + :field-types field-types) (length (postgresql-cursor-fields cursor))))))) (defmethod database-dump-result-set (result-set diff --git a/interfaces/postgresql/postgresql-sql.cl b/interfaces/postgresql/postgresql-sql.cl index 805f2c3..4d473a0 100644 --- a/interfaces/postgresql/postgresql-sql.cl +++ b/interfaces/postgresql/postgresql-sql.cl @@ -8,7 +8,7 @@ ;;;; Original code by Pierre R. Mai ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: postgresql-sql.cl,v 1.4 2002/03/24 18:31:05 kevin Exp $ +;;;; $Id: postgresql-sql.cl,v 1.5 2002/03/24 18:39:32 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai @@ -188,13 +188,15 @@ (values (make-postgresql-result-set :res-ptr result :num-fields (PQnfields result) - :num-tuples (PQntuples result)) + :num-tuples (PQntuples result) + :field-types field-types) (PQnfields result) (PQntuples result)) (values (make-postgresql-result-set :res-ptr result :num-fields (PQnfields result) - :num-tuples (PQntuples result)) + :num-tuples (PQntuples result) + :field-types field-types) (PQnfields result)))) (t (unwind-protect