* sql/expressions.lisp: Bind *in-subselect* when outputting selections
[clsql.git] / sql / expressions.lisp
index 91a46d7fb2c6c30592056c6ea98c2c25e260aee7..6aaededd7c6b32aa1c58337c9257fc6e400d29a8 100644 (file)
@@ -571,7 +571,8 @@ uninclusive, and the args from that keyword to the end."
         (write-string "ON " *sql-stream*)
         (output-sql distinct database)
         (write-char #\Space *sql-stream*)))
-    (output-sql (apply #'vector selections) database)
+    (let ((*in-subselect* t))
+      (output-sql (apply #'vector selections) database))
     (when from
       (write-string " FROM " *sql-stream*)
       (flet ((ident-table-equal (a b)