Assorted fixes: catalogs SQLtypes and MySQL decoding as.

It turns out that when trying to debug "decoding as" the SQLtype listing
support in sqltype-list was found broken, so this patch fixes it. Then goes
on to fix the DECODING AS filters support, which we have switched to using
the better regexp-or-string filter struct but forgot to update the matching
code accordingly.

Fixes #665.
This commit is contained in:
Dimitri Fontaine 2018-08-31 22:51:41 -07:00
parent 4fbfd9e522
commit 0f58a3c84d
2 changed files with 5 additions and 9 deletions

View File

@ -235,13 +235,7 @@ Illegal ~a character starting at position ~a~@[: ~a~].~%"
(defun apply-decoding-as-filters (table-name filters)
"Return a generialized boolean which is non-nil only if TABLE-NAME matches
one of the FILTERS."
(flet ((apply-filter (filter)
;; we close over table-name here.
(typecase filter
(string (string-equal filter table-name))
(list (destructuring-bind (type val) filter
(ecase type
(:regex (cl-ppcre:scan val table-name))))))))
(flet ((apply-filter (filter) (matches filter table-name)))
(some #'apply-filter filters)))
(defmethod instanciate-table-copy-object ((copy copy-mysql) (table table))

View File

@ -204,7 +204,7 @@
(defmethod sqltype-list ((table table) &key)
"Return the list of sqltypes for SCHEMA."
(apply #'append (mapcar #'sqltype-list (table-column-list table))))
(mapcar #'sqltype-list (table-column-list table)))
(defmethod sqltype-list ((schema schema) &key)
"Return the list of sqltypes for SCHEMA."
@ -215,7 +215,9 @@
(defmethod sqltype-list ((catalog catalog) &key)
"Return the list of sqltypes for CATALOG."
(remove-duplicates
(apply #'append (mapcar #'sqltype-list (catalog-schema-list catalog)))
(remove-if #'null
(apply #'append
(mapcar #'sqltype-list (catalog-schema-list catalog))))
:test #'string-equal :key #'sqltype-name))
(defmethod table-list ((schema schema) &key)