From 0a3ba23814f05d98354c8667870077d64cafae37 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Mon, 19 Apr 2004 17:02:04 +0000 Subject: [PATCH] r9106: store using varchar to retain length of string --- parse-2002.lisp | 4 ++-- parse-common.lisp | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/parse-2002.lisp b/parse-2002.lisp index aa9c46a..9c2a286 100644 --- a/parse-2002.lisp +++ b/parse-2002.lisp @@ -213,8 +213,8 @@ (lambda (x) (write-to-string (make-cuisui (parse-ui (nth 2 x)) (parse-ui (nth 4 x)))))) ("MRXNS.ENG" "KCUISUI" "BIGINT" 0 (lambda (x) (write-to-string (make-cuisui (parse-ui (nth 2 x)) (parse-ui (nth 4 x)))))) - ("MRXW.NONENG" "LAT" "CHAR" 3 (lambda (x) (nth 0 x))) - ("MRXW.NONENG" "WD" "CHAR" 200 (lambda (x) (nth 1 x))) + ("MRXW.NONENG" "LAT" "VARCHAR" 3 (lambda (x) (nth 0 x))) + ("MRXW.NONENG" "WD" "VARCHAR" 200 (lambda (x) (nth 1 x))) ("MRXW.NONENG" "CUI" "INTEGER" 0 (lambda (x) (write-to-string (parse-ui (nth 2 x))))) ("MRXW.NONENG" "LUI" "INTEGER" 0 (lambda (x) (write-to-string (parse-ui (nth 3 x))))) ("MRXW.NONENG" "SUI" "INTEGER" 0 (lambda (x) (write-to-string (parse-ui (nth 4 x))))) diff --git a/parse-common.lisp b/parse-common.lisp index b8439fa..98d0c01 100644 --- a/parse-common.lisp +++ b/parse-common.lisp @@ -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)) -- 2.34.1