r9106: store using varchar to retain length of string
[umlisp.git] / parse-common.lisp
index b8439fab6fffe9eeeecf91dfb69a25cf5ab97aed..98d0c018be432e33f74db79a67a78eeede645fe3 100644 (file)
@@ -41,7 +41,7 @@
     (string
      (merge-pathnames 
       (make-pathname :name (concatenate 'string filename extension)) 
-      (case (char filename 0)
+      (case (schar filename 0)
        ((#\M #\m)
         *meta-path*)
        ((#\L #\l)
@@ -135,7 +135,7 @@ Currently, these are the LEX and NET files."
 (defun make-ucol-for-column (colname filename ucols)
   ;; try to find column name without a terminal digit
   (let* ((len (length colname))
-        (last-digit? (digit-char-p (char colname (1- len))))
+        (last-digit? (digit-char-p (schar colname (1- len))))
         (base-colname (if last-digit?
                           (subseq colname 0 (1- len))
                           colname))
@@ -250,9 +250,7 @@ append a unique number (starting at 2) onto a column name that is repeated in th
      (when (and (cmax col) (av col))
        (if (> (cmax col) 255)
           (setf (sqltype col) "TEXT")
-        (if (< (- (cmax col) (av col)) 4) 
-            (setf (sqltype col) "CHAR") ; if average bytes wasted < 4
-          (setf (sqltype col) "VARCHAR")))))))
+          (setf (sqltype col) "VARCHAR"))))))
 
 (defun escape-column-name (name)
   (substitute #\_ #\/ name))