Ensure reasonable lisp type for slot in compute-lisp-type-from-specified-type
[clsql.git] / db-sqlite3 / sqlite3-sql.lisp
index 90f08120d2895898719235cc85b2e262fc824395..c51a5431890be950648ba442c0dd3c14072b9516 100644 (file)
@@ -7,8 +7,6 @@
 ;;;; Authors:  Aurelio Bignoli
 ;;;; Created:  Oct 2004
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2004 by Aurelio Bignoli
 ;;;;
 ;;;; CLSQL users are granted the rights to distribute and use this software
                                     (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 clsql-sys::+whitespace-chars+
+                                 (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)