r9188: make result-types :auto the default
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sat, 1 May 2004 11:41:32 +0000 (11:41 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sat, 1 May 2004 11:41:32 +0000 (11:41 +0000)
ChangeLog
TODO
base/basic-sql.lisp
debian/changelog
tests/test-fdml.lisp

index a3593e8c4abe292d757df1e16788e02a093bf3f7..25a2fd0aa35f663baf1d185323f3627e4537a6d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 30 Apr 2004 Kevin Rosenberg (kevin@rosenberg.net)
-       * Version 2.10.0: New API function: CACHE-TABLE-QUERIES.
+       * Version 2.10.2
+       * base/basic-sql.lisp: Set default value of :result-types 
+       to :auto for more CommonSQL conformance. 
+       * test/test-fdml.lisp: Add tests for numeric value of fields
+       
+
+30 Apr 2004 Kevin Rosenberg (kevin@rosenberg.net)
+       * Version 2.10.1: New API function: CACHE-TABLE-QUERIES.
        * base/basic-sql.lisp, db-*/*-sql.lisp: More CommonSQL conformance.
        Return field names as second value for QUERY. This can be overridden
        for efficiency with the new keyword :FIELD-NAMES set to NIL
diff --git a/TODO b/TODO
index 9d5e76d6e7b9800d7f32d665247bc9999e2fac27..4b160e54bac909fcb539d339ec16d178521db033 100644 (file)
--- a/TODO
+++ b/TODO
@@ -26,8 +26,7 @@ COMMONSQL SPEC
 
     QUERY 
       o should coerce values returned as strings to appropriate lisp type
-       (except for SQLite interface, this works when :result-types is :auto).
-       Perhaps that should be the default?
+       for SQLite backend
 
  >> The object-oriented sql interface
 
index 055e33a20dda2b351c09b0869049e5170afadac3..bf8ef80f4934d8f692c48fd863d2cf8d24dd6b2d 100644 (file)
@@ -30,7 +30,7 @@ one result per row. Returns a list of lists of values of the result of
 that expression and a list of field names selected in sql-exp."))
 
 (defmethod query ((query-expression string) &key (database *default-database*)
-                  (result-types nil) (flatp nil) (field-names t))
+                  (result-types :auto) (flatp nil) (field-names t))
   (record-sql-action query-expression :query database)
   (multiple-value-bind (rows names) (database-query query-expression database result-types
                                                     field-names)
index 57f9b332b7074d0b2820aa495677102425cb5eda..acbd8ac88aeeddaa2a91f7b44d936795f730eabd 100644 (file)
@@ -1,4 +1,4 @@
-cl-sql (2.10.1-1) unstable; urgency=low
+cl-sql (2.10.2-1) unstable; urgency=low
 
   * New upstream
 
index 8d87097e8db1b3de950c3c0197d870b1dcd60664..f3b9d13f718ff921f9bbafc966978d320a9fb0e2 100644 (file)
   (("Vladamir" "Lenin" "lenin@soviet.org")))
 
 
+;; Computed values are not always classified as numeric by psqlodbc
 (deftest :fdml/query/1
-    (clsql:query "SELECT COUNT(*) FROM EMPLOYEE WHERE (EMAIL LIKE '%org')" :field-names nil)
-  (("10")))
+    (let ((count (caar (clsql:query "SELECT COUNT(*) FROM EMPLOYEE WHERE (EMAIL LIKE '%org')" :field-names nil))))
+      (if (stringp count)
+         (nth-value 0 (parse-integer count))
+       count))
+  10)
 
 (deftest :fdml/query/2
     (multiple-value-bind (rows field-names)
    ("Josef" "Stalin") ("Leon" "Trotsky"))
   ("FIRST_NAME" "LAST_NAME"))
 
+(deftest :fdml/query/3
+    (caar (clsql:query "SELECT EMPLID FROM EMPLOYEE WHERE LAST_NAME = 'Andropov'" :field-names nil))
+  6)
+  
+(deftest :fdml/query/4
+    (typep (caar (clsql:query "SELECT HEIGHT FROM EMPLOYEE WHERE LAST_NAME = 'Andropov'" :field-names nil))
+     'float)
+  t)
   
 (deftest :fdml/execute-command/1
     (values