use md5sum-string instead of md5sum-sequence to adjust to upstream changes
[clsql.git] / db-postgresql-socket / postgresql-socket-sql.lisp
index 4f8457bfbdfd5a06d62ac8500f0cff857f5a4fb9..352198aade2d73059e09c45ab16d6f9b16f5f57b 100644 (file)
@@ -7,9 +7,7 @@
 ;;;; Authors:  Kevin M. Rosenberg based on original code by Pierre R. Mai
 ;;;; Created:  Feb 2002
 ;;;;
-;;;; $Id$
-;;;;
-;;;; This file, part of CLSQL, is Copyright (c) 2002-2007 by Kevin M. Rosenberg
+;;;; This file, part of CLSQL, is Copyright (c) 2002-2010 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
 ;;;;
 ;;;; CLSQL users are granted the rights to distribute and use this software
            nil)))))
 
 (defun canonicalize-type-list (types auto-list)
-  "Ensure a field type list meets expectations.
-Duplicated from clsql-uffi package so that this interface
-doesn't depend on UFFI."
-  (let ((length-types (length types))
-        (new-types '()))
+  "Ensure a field type list meets expectations.  Essentially if we get a
+   generic term for a type that our auto typer pulls a better type for,
+   use it instead"
+  (let ((length-types (length types)))
     (loop for i from 0 below (length auto-list)
-          do
-          (if (>= i length-types)
-              (push t new-types) ;; types is shorted than num-fields
-              (push
-               (case (nth i types)
-                 (:int
-                  (case (nth i auto-list)
-                    (:int32
-                     :int32)
-                    (:int64
-                     :int64)
-                    (t
-                     t)))
-                 (:double
-                  (case (nth i auto-list)
-                    (:double
-                     :double)
-                    (t
-                     t)))
-                 (t
-                  t))
-               new-types)))
-    (nreverse new-types)))
+          for auto = (nth i auto-list)
+          collect
+       (if (or (>= i length-types)
+               (member (nth i types) (list T :int :double)))
+           auto
+           (nth i types)))))
 
 
 (defun convert-to-clsql-warning (database condition)