From 81d2ebcdd182dd674191b29e00274c82660fd3f3 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Mon, 23 Jun 2003 19:25:30 +0000 Subject: [PATCH] r5175: Auto commit for Debian build --- db-mysql/mysql-sql.lisp | 43 ++++++++++++++++++++++++++++++- db-postgresql/postgresql-sql.lisp | 11 ++++---- debian/changelog | 6 +++++ uffi/clsql-uffi.lisp | 18 +++---------- 4 files changed, 57 insertions(+), 21 deletions(-) diff --git a/db-mysql/mysql-sql.lisp b/db-mysql/mysql-sql.lisp index fee81b5..eaea5d2 100644 --- a/db-mysql/mysql-sql.lisp +++ b/db-mysql/mysql-sql.lisp @@ -8,7 +8,7 @@ ;;;; Original code by Pierre R. Mai ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: mysql-sql.lisp,v 1.5 2003/06/08 12:48:55 kevin Exp $ +;;;; $Id: mysql-sql.lisp,v 1.6 2003/06/23 19:25:30 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai @@ -143,6 +143,47 @@ t) +(defmethod database-query (query-expression (database mysql-database) + types) + (declare (optimize (speed 3) (safety 0) (debug 0) (space 0))) + (let ((mysql-ptr (database-mysql-ptr database))) + (uffi:with-cstring (query-native query-expression) + (if (zerop (mysql-query mysql-ptr query-native)) + (let ((res-ptr (mysql-use-result mysql-ptr))) + (if res-ptr + (unwind-protect + (let ((num-fields (mysql-num-fields res-ptr))) + (declare (fixnum num-fields)) + (setq types (canonicalize-types + types num-fields + res-ptr)) + (loop for row = (mysql-fetch-row res-ptr) + until (uffi:null-pointer-p row) + collect + (do* ((rlist (make-list num-fields)) + (i 0 (1+ i)) + (pos rlist (cdr pos))) + ((= i num-fields) rlist) + (declare (fixnum i)) + (setf (car pos) + (convert-raw-field + (uffi:deref-array row '(:array + (* :unsigned-char)) + i) + types i))))) + (mysql-free-result res-ptr)) + (error 'clsql-sql-error + :database database + :expression query-expression + :errno (mysql-errno mysql-ptr) + :error (mysql-error-string mysql-ptr)))) + (error 'clsql-sql-error + :database database + :expression query-expression + :errno (mysql-errno mysql-ptr) + :error (mysql-error-string mysql-ptr)))))) + +#+ignore (defmethod database-query (query-expression (database mysql-database) types) (declare (optimize (speed 3) (safety 0) (debug 0) (space 0))) diff --git a/db-postgresql/postgresql-sql.lisp b/db-postgresql/postgresql-sql.lisp index 3bfac6b..ce95c33 100644 --- a/db-postgresql/postgresql-sql.lisp +++ b/db-postgresql/postgresql-sql.lisp @@ -8,7 +8,7 @@ ;;;; Original code by Pierre R. Mai ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: postgresql-sql.lisp,v 1.1 2002/09/30 10:19:23 kevin Exp $ +;;;; $Id: postgresql-sql.lisp,v 1.2 2003/06/23 19:25:30 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai @@ -18,15 +18,14 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) -(in-package :cl-user) +(in-package #:cl-user) -(defpackage :clsql-postgresql - (:use :common-lisp :clsql-base-sys :postgresql :clsql-uffi) +(defpackage #:clsql-postgresql + (:use #:common-lisp #:clsql-base-sys #:postgresql #:clsql-uffi) (:export #:postgresql-database) (:documentation "This is the CLSQL interface to PostgreSQL.")) -(in-package :clsql-postgresql) +(in-package #:clsql-postgresql) ;;; Field conversion functions diff --git a/debian/changelog b/debian/changelog index ee45b44..0e66b89 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-sql (1.6.6-1) unstable; urgency=low + + * New upstream + + -- Kevin M. Rosenberg Mon, 23 Jun 2003 13:25:01 -0600 + cl-sql (1.6.5-1) unstable; urgency=low * New upstream diff --git a/uffi/clsql-uffi.lisp b/uffi/clsql-uffi.lisp index 4093cfc..1d072ed 100644 --- a/uffi/clsql-uffi.lisp +++ b/uffi/clsql-uffi.lisp @@ -7,7 +7,7 @@ ;;;; Programmers: Kevin M. Rosenberg ;;;; Date Started: Mar 2002 ;;;; -;;;; $Id: clsql-uffi.lisp,v 1.31 2003/06/15 13:50:24 kevin Exp $ +;;;; $Id: clsql-uffi.lisp,v 1.32 2003/06/23 19:25:30 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -87,24 +87,14 @@ (uffi:def-type char-ptr-def (* :unsigned-char)) -(defun char-ptr-points-to-null (char-ptr) - "Returns T if foreign character pointer refers to 'NULL' string. Only called for numeric entries" - ;; Uses short cut and returns T if first character is #\N. It should - ;; never be non-numeric - (declare (type char-ptr-def char-ptr)) - (or (uffi:null-pointer-p char-ptr) - (char-equal #\N (uffi:ensure-char-character - (uffi:deref-pointer char-ptr :char))))) - (defun convert-raw-field (char-ptr types index) - (declare (optimize (speed 3) (safety 0) (space 0))) + (declare (optimize (speed 3) (safety 0) (space 0)) + (type char-ptr-def char-ptr)) (let ((type (if (listp types) (nth index types) types))) (cond - ((and (or (eq type :double) (eq type :int32) (eq type :int) - (eq type :int64)) - (char-ptr-points-to-null char-ptr)) + ((uffi:null-pointer-p char-ptr) nil) (t (case type -- 2.34.1