projects
/
clsql.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r9615: * sql/expressions.lisp: Avoid duplicate FROM names when selecting
[clsql.git]
/
sql
/
expressions.lisp
diff --git
a/sql/expressions.lisp
b/sql/expressions.lisp
index 10b1130aa11dd81f38a0dc5199bfa3788c9a5f74..f2d63c9c85c47e9dd810bce8dff46480291692d8 100644
(file)
--- a/
sql/expressions.lisp
+++ b/
sql/expressions.lisp
@@
-579,7
+579,12
@@
uninclusive, and the args from that keyword to the end."
(when from
(write-string " FROM " *sql-stream*)
(typecase from
(when from
(write-string " FROM " *sql-stream*)
(typecase from
- (list (output-sql (apply #'vector from) database))
+ (list (output-sql (apply #'vector (remove-duplicates
+ from
+ :test #'(lambda (a b)
+ (string-equal (symbol-name (slot-value a 'name))
+ (symbol-name (slot-value b 'name))))))
+ database))
(string (write-string from *sql-stream*))
(t (output-sql from database))))
(when inner-join
(string (write-string from *sql-stream*))
(t (output-sql from database))))
(when inner-join