X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Fexpressions.lisp;h=bcf1383189ff83a8c3ef47ce4a83ef4a674b6462;hp=2f40e33a6e67f640b107a0a2dc9d444941c9287d;hb=33a8b2208de67e24b346804400b2ed003770e620;hpb=b5890c31a60303397efedb2110f46c6388426170 diff --git a/sql/expressions.lisp b/sql/expressions.lisp index 2f40e33..bcf1383 100644 --- a/sql/expressions.lisp +++ b/sql/expressions.lisp @@ -830,7 +830,7 @@ uninclusive, and the args from that keyword to the end." (defmethod database-output-sql ((str string) database) (declare (ignore database) (optimize (speed 3) (safety 1) #+cmu (extensions:inhibit-warnings 3)) - (type (simple-array * (*)) str)) + (simple-string str)) (let ((len (length str))) (declare (type fixnum len)) (cond ((zerop len) @@ -850,7 +850,11 @@ uninclusive, and the args from that keyword to the end." (setf (aref buf j) #\') (incf j) (setf (aref buf j) #\')) - ((char= char #\\) + ((and (char= char #\\) + ;; MTP: only escape backslash with pgsql/mysql + (member (database-underlying-type database) + '(:postgresql :mysql) + :test #'eq)) (setf (aref buf j) #\\) (incf j) (setf (aref buf j) #\\)) @@ -859,11 +863,13 @@ uninclusive, and the args from that keyword to the end." (let ((keyword-package (symbol-package :foo))) (defmethod database-output-sql ((sym symbol) database) - (convert-to-db-default-case - (if (equal (symbol-package sym) keyword-package) - (concatenate 'string "'" (string sym) "'") - (symbol-name sym)) - database))) + (if (null sym) + +null-string+ + (convert-to-db-default-case + (if (equal (symbol-package sym) keyword-package) + (concatenate 'string "'" (string sym) "'") + (symbol-name sym)) + database)))) (defmethod database-output-sql ((tee (eql t)) database) (declare (ignore database))