r9741: 8 Jul 2004 Kevin Rosenberg <kevin@rosenberg.net>
authorKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 8 Jul 2004 16:32:52 +0000 (16:32 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 8 Jul 2004 16:32:52 +0000 (16:32 +0000)
        * sql/fdml.lisp: Apply patch from  Kim Minh Kaplan
        to change escaping of single quotes. Mild optimizations
        for escaped string output.
        * TODO: Add need to test single quote escaping

ChangeLog
TODO
sql/fdml.lisp

index fc2e0b728ea6d33fb40a502ee45dca9bf4979f1d..e6db1dd1568a2e4f7674f46b696aa76162bbb708 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+8 Jul 2004 Kevin Rosenberg <kevin@rosenberg.net>
+       * sql/fdml.lisp: Apply patch from  Kim Minh Kaplan 
+       to change escaping of single quotes. Mild optimizations
+       for escaped string output.
+       * TODO: Add need to test single quote escaping
+       
 7 Jul 2004 Kevin Rosenberg <kevin@rosenberg.net>
        * doc/ref-ooddl.xml, doc-ref-oodml.xml: documentation additions
        * sql/ooddl.lisp: Added SMALLINT type
diff --git a/TODO b/TODO
index 7c9ebebcee84a27264b4e929b41f9c69b8ad61ed..a3c5a6c3f76215806290f062cf43fc4c73fecc22 100644 (file)
--- a/TODO
+++ b/TODO
@@ -12,6 +12,7 @@ TESTS TO ADD
 * symbol slot
 * generalized-boolean slot
 * column and table constraints in CREATE-TABLE and DEF-VIEW-CLASS. 
+* escaping of single quotes
 
 OPTIMIZATIONS
  
index ee9a37db3ea0a343eb0b1ba33e8fbe49b8a4a955..470ad37d195b7f2df46feea74ca724b2ee54f3a4 100644 (file)
@@ -200,7 +200,7 @@ are nil and AV-PAIRS is an alist of (attribute value) pairs."
            (type (simple-array * (*)) str))
   (let ((len (length str)))
     (declare (type fixnum len))
-    (cond ((= len 0)
+    (cond ((zerop len)
            +empty-string+)
           ((and (null (position #\' str))
                 (null (position #\\ str)))
@@ -210,13 +210,14 @@ are nil and AV-PAIRS is an alist of (attribute value) pairs."
              (do* ((i 0 (incf i))
                    (j 1 (incf j)))
                   ((= i len) (subseq buf 0 (1+ j)))
-               (declare (type integer i j))
+               (declare (type fixnum i j))
                (let ((char (aref str i)))
-                 (cond ((eql char #\')
-                        (setf (aref buf j) #\\)
+                (declare (character char))
+                 (cond ((char= char #\')
+                        (setf (aref buf j) #\')
                         (incf j)
                         (setf (aref buf j) #\'))
-                       ((eql char #\\)
+                       ((char= char #\\)
                         (setf (aref buf j) #\\)
                         (incf j)
                         (setf (aref buf j) #\\))