X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Fexpressions.lisp;h=cb8046fb09b6fb9e38bfbac3a14d8f38a8c4bf13;hb=7df5c123266275ba2666cc2637d9a30d4b65d6df;hp=9335ae0e0a5e0995357da7cabaa331de00778950;hpb=2c69ef4d171d214a7d54b598184dadb864704852;p=clsql.git diff --git a/sql/expressions.lisp b/sql/expressions.lisp index 9335ae0..cb8046f 100644 --- a/sql/expressions.lisp +++ b/sql/expressions.lisp @@ -128,10 +128,8 @@ "Top-level call for generating SQL strings. Returns an SQL string appropriate for DATABASE which corresponds to the supplied lisp expression SQL-EXPR." - (progv '(*sql-stream*) - `(,(make-string-output-stream)) - (output-sql sql-expr database) - (get-output-stream-string *sql-stream*))) + (with-output-to-string (*sql-stream*) + (output-sql sql-expr database))) (defmethod output-sql (expr database) (write-string (database-output-sql expr database) *sql-stream*) @@ -813,7 +811,8 @@ uninclusive, and the args from that keyword to the end." (output-sql attributes database)) (when values (write-string " VALUES " *sql-stream*) - (output-sql values database)) + (let ((clsql-sys::*in-subselect* t)) + (output-sql values database))) (when query (write-char #\Space *sql-stream*) (output-sql query database))) @@ -870,7 +869,8 @@ uninclusive, and the args from that keyword to the end." (write-string "UPDATE " *sql-stream*) (output-sql table database) (write-string " SET " *sql-stream*) - (output-sql (apply #'vector (update-assignments)) database) + (let ((clsql-sys::*in-subselect* t)) + (output-sql (apply #'vector (update-assignments)) database)) (output-sql-where-clause where database))) t) @@ -939,7 +939,7 @@ uninclusive, and the args from that keyword to the end." (when (and (eq :mysql (database-underlying-type database)) transactions (db-type-transaction-capable? :mysql database)) - (write-string " Type=InnoDB" *sql-stream*)))) + (write-string " ENGINE=innodb" *sql-stream*)))) t)