r9360: Strings as table identifiers in SELECT.
authorMarcus Pearce <m.t.pearce@city.ac.uk>
Sat, 15 May 2004 12:22:31 +0000 (12:22 +0000)
committerMarcus Pearce <m.t.pearce@city.ac.uk>
Sat, 15 May 2004 12:22:31 +0000 (12:22 +0000)
ChangeLog
TODO
sql/classes.lisp
sql/operations.lisp
tests/test-fdml.lisp

index f877f918542842447ca763a181e0c77133379aaa..6fe98ecbcacda12332dfa92b70bc9f39d4de5aa9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+15 May 2004 Marcus Pearce (m.t.pearce@city.ac.uk) 
+       * sql/classes.lisp: SELECT now accepts table identifiers as strings 
+       for CommonSQL compliance. 
+       * tests/test-fdml.lisp: added test for table identifiers as strings 
+       in SELECT. 
+
 15 May 2004 Marcus Pearce (m.t.pearce@city.ac.uk) 
        * sql/sql.lisp: PRINT-QUERY now calls QUERY with result-types and 
        field-names set to nil. 
diff --git a/TODO b/TODO
index 29e242cc601ae4802ed239c75656bfdf946c75d4..8f59a616bc99d3ccd16fd63dd861cad6c5bbb15c 100644 (file)
--- a/TODO
+++ b/TODO
@@ -38,6 +38,10 @@ UPDATE-OBJECT-JOINS:
  object, to meet CommonSQL spec need to generate a single
  query to read values for all objects, up to max-len count.
 
+COMMIT,ROLLBACK,START-TRANSACTION: 
+ When COMMIT or ROLLBACK are called outside of WITH-TRANSACTION, an sql 
+ transaction must be explicitly started first with START-TRANSACTION. 
+
 OPTIMIZATIONS
  
 * Revisit result-type list creation,perhaps caching
index a829d3894cbe4aa8e0e4767d247a05071a087a6e..4e697caf0cfb7a51cfd402682d8d35dba733da1e 100644 (file)
@@ -579,9 +579,10 @@ uninclusive, and the args from that keyword to the end."
     (output-sql (apply #'vector selections) database)
     (when from
       (write-string " FROM " *sql-stream*)
-      (if (listp from)
-         (output-sql (apply #'vector from) database)
-       (output-sql from database)))
+      (typecase from 
+        (list (output-sql (apply #'vector from) database))
+        (string (write-string from *sql-stream*))
+        (t (output-sql from database))))
     (when inner-join
       (write-string " INNER JOIN " *sql-stream*)
       (output-sql inner-join database))
index d45325479fa303df265a86442e5d2f97934249c4..bdbb9294ca33500e8583c2904cc84d1aea8c3bcf 100644 (file)
   (make-instance 'sql-relational-exp
                 :operator 'in :sub-expressions rest))
 
-;; (defsql sql-concat (:symbol "||") (&rest rest)
-;;   (make-instance 'sql-relational-exp
-;;              :operator '\|\| :sub-expressions rest))
-
 (defsql sql-concat (:symbol "concat") (&rest rest)
   (make-instance 'sql-relational-exp
                 :operator '\|\| :sub-expressions rest))
index ca491ac957ca9560887809fdbfe28315e4acd1eb..8f9fd3f63980c88fcd0e7b35a80ddb8b70125636 100644 (file)
  ("Boris" "Josef" "Konstantin" "Leon" "Leonid" "Mikhail" "Nikita" "Vladamir"
   "Yuri"))
 
+(deftest :fdml/select/25
+ (clsql:select [first-name] :from "employee" :flatp t :distinct t
+                            :field-names nil 
+                            :result-types nil 
+                            :order-by [first-name])
+ ("Boris" "Josef" "Konstantin" "Leon" "Leonid" "Mikhail" "Nikita" "Vladamir"
+  "Yuri"))
+
 ;(deftest :fdml/select/11
 ;    (clsql:select [emplid] :from [employee]
 ;                :where [= [emplid] [any [select [companyid] :from [company]]]]