fixed a bug in parsing column types from sqlite3 databases by adding a trim
authorRuss Tyndall <russ@acceleration.net>
Tue, 26 Jan 2010 21:13:38 +0000 (16:13 -0500)
committerNathan Bird <nathan@acceleration.net>
Tue, 26 Jan 2010 21:26:11 +0000 (16:26 -0500)
db-sqlite3/sqlite3-sql.lisp

index 90f08120d2895898719235cc85b2e262fc824395..1ba6b0ba68649deee35d6a367d1b9bc826095f08 100644 (file)
                                     (database sqlite3-database)
                                     &key (owner nil))
   (declare (ignore owner))
+  
   (loop for field-info in (sqlite3-table-info table database)
       when (string= attribute (second field-info))
       return
         (let* ((raw-type (third field-info))
                (start-length (position #\( raw-type))
-               (type (if start-length
-                         (subseq raw-type 0 start-length)
-                       raw-type))
+               (type (string-trim '(#\space #\tab #\newline)
+                                 (if start-length
+                                     (subseq raw-type 0 start-length)
+                                     raw-type)))
                (length (if start-length
                            (parse-integer (subseq raw-type (1+ start-length))
                                           :junk-allowed t)