r10512: 05 May 2005 Kevin Rosenberg <kevin@rosenberg.net>
authorKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 6 May 2005 04:18:38 +0000 (04:18 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 6 May 2005 04:18:38 +0000 (04:18 +0000)
        * Version 3.1.12
        * sql/time.lisp: Fix error in submitted patch which caused error
        in timestrings with 19 or less characters.

ChangeLog
sql/time.lisp

index 42f7907d23eb95ea2744f139021fa246103cec80..5bb2dcf78f8b09e6e655a3eb81048983e2c0bb24 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+05 May 2005 Kevin Rosenberg <kevin@rosenberg.net>
+       * Version 3.1.12
+       * sql/time.lisp: Fix error in submitted patch which caused error
+       in timestrings with 19 or less characters.
+       
 27 Apr 2005 Kevin Rosenberg <kevin@rosenberg.net>
        * db-postgresql-socket/postgresql-api.lisp: Commit patch from Tim Howe
        to fix read-socket-sequence on non-sb-unicode sbcl.
index 70ac8286d4d74f82a64b02af0fe516d9dcd918d6..d97673310eb341a2a6bcefca859cfe8a3f5e872e 100644 (file)
@@ -1129,7 +1129,7 @@ formatted date string."
 (defun syntax-parse-iso-8601 (string)
   ;; use strlen to determine if fractional seconds are present in timestamp
   (let ((strlen (length string))
-        year month day hour minute second usec gmt-sec-offset)
+        year month day hour minute second gmt-sec-offset)
     (handler-case
         (progn
           (setf year           (parse-integer string :start 0 :end 4)
@@ -1145,8 +1145,9 @@ formatted date string."
                                    (parse-integer string :start 17 :end 19)
                                    0))
           (cond
-            ((or (char= #\, (char string 19))
-                 (char= #\. (char string 19)))
+            ((and (> strlen 19)
+                 (or (char= #\, (char string 19))
+                     (char= #\. (char string 19))))
              (multiple-value-bind (parsed-usec usec-end)
                  (parse-integer string :start 20 :junk-allowed t)
                (setf usec          parsed-usec
@@ -1185,6 +1186,7 @@ formatted date string."
                :bad-component
                (car (find-if (lambda (pair) (null (cdr pair)))
                              `((year . ,year) (month . ,month)
-                               (day . ,day) (hour ,hour)
-                               (minute ,minute) (second ,second)
-                               (timezone ,gmt-sec-offset)))))))))
+                               (day . ,day) (hour . ,hour)
+                               (minute . ,minute) (second . ,second)
+                              (usec . ,usec)
+                               (timezone . ,gmt-sec-offset)))))))))