Fix compilation
[umlisp.git] / parse-common.lisp
index b1395665b68eb612ef4de7fcfccaa16436ce2981..f7fab1e8eb6e9dcc02bca4cfc7ae0cfc23fe81ad 100644 (file)
@@ -378,3 +378,17 @@ append a unique number (starting at 2) onto a column name that is repeated in th
 
 (defun escape-column-name (name)
   (substitute #\_ #\/ name))
+
+;; SQLNAME is required for collision of SQL reserved words (MYSQL 8: RANK)
+;; and column names in UMLS (RANK in MRRANK)
+(defvar *sql-reserved-names* '("RANK"))
+(defmethod sqlname ((c ucol))
+  (sqlname (col c)))
+(defmethod sqlname ((name string))
+  (if (find name *sql-reserved-names* :test #'string-equal)
+      (concatenate 'string "_" name)
+    name))
+(defmethod sqlname ((l list))
+  (mapcar #'sqlname l))
+(defmethod sqlname ((s symbol))
+  (sqlname (symbol-name s)))