From: Kevin M. Rosenberg Date: Mon, 25 Mar 2002 23:30:49 +0000 (+0000) Subject: r1660: field types X-Git-Tag: v3.8.6~1216 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=9d53eaaae02609b0d7076be0853ff0f0ab06b644;hp=68a2a2bd6a380a61dce06a0510dab3441400d795 r1660: field types --- diff --git a/interfaces/postgresql-socket/postgresql-socket-api.cl b/interfaces/postgresql-socket/postgresql-socket-api.cl index 46024c1..e870680 100644 --- a/interfaces/postgresql-socket/postgresql-socket-api.cl +++ b/interfaces/postgresql-socket/postgresql-socket-api.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: postgresql-socket-api.cl,v 1.3 2002/03/25 23:22:07 kevin Exp $ +;;;; $Id: postgresql-socket-api.cl,v 1.4 2002/03/25 23:30:49 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai @@ -620,6 +620,12 @@ connection, if it is still open." (error 'postgresql-fatal-error :connection connection :message "Received garbled message from backend"))))))) +(defun map-into-indexed (result-seq func seq) + (dotimes (i (length seq)) + (declare (fixnum i)) + (setf (elt result-seq i) + (funcall func (elt seq i) i))) + result-seq) (defun copy-cursor-row (cursor sequence field-types) (let* ((connection (postgresql-cursor-connection cursor)) @@ -640,12 +646,12 @@ connection, if it is still open." (setf (elt sequence i) nil) (let ((value (read-field socket (nth i field-types)))) (setf (elt sequence i) value))))) - (map-into + (map-into-indexed sequence - #'(lambda (null-bit) + #'(lambda (null-bit i) (if (zerop null-bit) nil - (read-field socket t))) + (read-field socket (nth i field-types)))) (read-null-bit-vector socket (length sequence))))) (#.+binary-row-message+ (error "NYI"))