X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Fexpressions.lisp;h=cc2e53b20fcab7f189b85ebd14fdd9a937607a99;hb=31507a81fff1da3460625fbc07107de931907a8e;hp=fb9f3f7ea555c18480729a0e7d678f674f725813;hpb=e622ee6f4bf2b9fe81af59d566e651c983a4833b;p=clsql.git diff --git a/sql/expressions.lisp b/sql/expressions.lisp index fb9f3f7..cc2e53b 100644 --- a/sql/expressions.lisp +++ b/sql/expressions.lisp @@ -1,7 +1,7 @@ ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- ;;;; ************************************************************************* ;;;; -;;;; $Id: +;;;; $Id$ ;;;; ;;;; Classes defining SQL expressions and methods for formatting the ;;;; appropriate SQL commands. @@ -374,12 +374,14 @@ :test (lambda (tab1 tab2) (equal (slot-value tab1 'name) (slot-value tab2 'name)))))) +(defvar *in-subselect* nil) (defmethod output-sql ((expr sql-function-exp) database) (with-slots (name args) expr (output-sql name database) - (when args (output-sql args database))) + (let ((*in-subselect* nil)) ;; aboid double parens + (when args (output-sql args database)))) t) @@ -563,8 +565,6 @@ uninclusive, and the args from that keyword to the end." :group-by group-by :having having :order-by order-by :inner-join inner-join :on on)))))) -(defvar *in-subselect* nil) - (defmethod output-sql ((query sql-query) database) (with-slots (distinct selections from where group-by having order-by limit offset inner-join on all set-operation)