r5175: Auto commit for Debian build
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 23 Jun 2003 19:25:30 +0000 (19:25 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 23 Jun 2003 19:25:30 +0000 (19:25 +0000)
db-mysql/mysql-sql.lisp
db-postgresql/postgresql-sql.lisp
debian/changelog
uffi/clsql-uffi.lisp

index fee81b5c7822272ce81115ae8b147b13abb604df..eaea5d2aa8f004be9861ef6a714b404d0221ed78 100644 (file)
@@ -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
   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)))
index 3bfac6b95ea24c933aeab34c1caf3d79aa9dcca4..ce95c333e9bd4d3343728a197a0f7e0effdbb7c3 100644 (file)
@@ -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
 ;;;; (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
 
index ee45b4463ce06cb21597b61d9a8b996a7d11276b..0e66b8913d45aa7b3e43207349020a800d8ef2ab 100644 (file)
@@ -1,3 +1,9 @@
+cl-sql (1.6.6-1) unstable; urgency=low
+
+  * New upstream
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Mon, 23 Jun 2003 13:25:01 -0600
+
 cl-sql (1.6.5-1) unstable; urgency=low
 
   * New upstream
index 4093cfcb642285d0ff543fbb3cea400f6d23d854..1d072edcd2bc35f1a0e279a68f3f4db7dc12c48e 100644 (file)
@@ -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
 ;;;;
 
 (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