r9831: * db-aodbc/aodbc-sql.lisp: Fix storage location
[clsql.git] / sql / expressions.lisp
index 2f40e33a6e67f640b107a0a2dc9d444941c9287d..bfb33c1550768270a87533a60350e66d58fc5d65 100644 (file)
@@ -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))