* Updated test-clsql.cl to use automated testing with a config
file
+
+ * Changed return types of field accessors from cstring to (* :unsigned-char).
+ This prepares for being able to use specified type conversions when taking
+ field data into lisp.
23 Mar 2002 Kevin Rosenberg (kevin@rosenberg.net)
;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: mysql-sql.cl,v 1.5 2002/03/24 18:39:32 kevin Exp $
+;;;; $Id: mysql-sql.cl,v 1.6 2002/03/24 22:25:51 kevin Exp $
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
(defstruct mysql-result-set
(res-ptr (uffi:make-null-pointer 'mysql-mysql-res)
:type mysql-mysql-res-ptr-def)
- (field-types nil :type cons)
+ (field-types nil)
(full-set nil :type boolean))
(defmethod database-dump-result-set (result-set (database mysql-database))
collect
(loop for i from 0 below (mysql-num-fields res-ptr)
collect
- (uffi:convert-from-cstring
+ (uffi:convert-from-foreign-string
(uffi:deref-array row 'mysql-row i))))
(mysql-free-result res-ptr))
(error 'clsql-sql-error
;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: postgresql-socket-sql.cl,v 1.3 2002/03/24 18:39:32 kevin Exp $
+;;;; $Id: postgresql-socket-sql.cl,v 1.4 2002/03/24 22:25:51 kevin Exp $
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
(defstruct postgresql-socket-result-set
(done nil)
(cursor nil)
- (field-types nil :type cons))
+ (field-types nil))
(defmethod database-query-result-set (expression (database postgresql-socket-database)
&key full-set field-types
;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: postgresql-api.cl,v 1.1 2002/03/23 17:10:48 kevin Exp $
+;;;; $Id: postgresql-api.cl,v 1.2 2002/03/24 22:25:51 kevin Exp $
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
(tup-num :int)
(field-num :int))
:module "postgresql"
- :returning :cstring)
+ :returning (* :unsigned-char))
(declaim (inline PQgetlength))
(uffi:def-function ("PQgetlength" PQgetlength)
;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: postgresql-sql.cl,v 1.5 2002/03/24 18:39:32 kevin Exp $
+;;;; $Id: postgresql-sql.cl,v 1.6 2002/03/24 22:25:51 kevin Exp $
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
(loop for i from 0 below (PQnfields result)
collect
(if (zerop (PQgetisnull result tuple-index i))
- (uffi:convert-from-cstring
+ (uffi:convert-from-foreign-string
(PQgetvalue result tuple-index i))
nil))))
(t
(defstruct postgresql-result-set
(res-ptr (uffi:make-null-pointer 'pgsql-result)
:type pgsql-result-def)
- (field-types nil :type cons)
+ (field-types nil)
(num-tuples 0 :type integer)
(num-fields 0 :type integer)
(tuple-index 0 :type integer))
do
(setf (car rest)
(if (zerop (PQgetisnull result tuple-index i))
- (uffi:convert-from-cstring
+ (uffi:convert-from-foreign-string
(PQgetvalue result tuple-index i))
nil))
finally
;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: sql.cl,v 1.4 2002/03/24 18:08:27 kevin Exp $
+;;;; $Id: sql.cl,v 1.5 2002/03/24 22:25:51 kevin Exp $
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
(defun map-query-to-simple (output-type-spec function query-expression database field-types)
(multiple-value-bind (result-set columns rows)
- (database-query-result-set query-expression database :full-set t :
- field-types field-types)
+ (database-query-result-set query-expression database :full-set t
+ :field-types field-types)
(when result-set
(unwind-protect
(if rows
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Mar 2002
;;;;
-;;;; $Id: test-clsql.cl,v 1.3 2002/03/24 18:31:05 kevin Exp $
+;;;; $Id: test-clsql.cl,v 1.4 2002/03/24 22:25:51 kevin Exp $
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
(dolist (elem config)
(let ((type (car elem))
(spec (cadr elem)))
- (clsql-test-table spec type))))
-
+ #-allegro
+ (unless (eq type :aodbc)
+ (clsql-test-table spec type))
+ #+allegro
+ (clsql-test-table spec type)))
+ )