Fix MySQL processing of Mat Views, again.

The previous fix left to be desired in that it didn't update the code
expectations about what a view-name looks like in fetch-metadata. In
particular we would use (cons NIL "table-name") in the only-table facility,
which expects non qualified names as strings.

Switch to using the :including filters facility instead, as we do in MS SQL.
Later, we might want to deprecate our internal :only-tables facility.

Fix #932. Again.
This commit is contained in:
Dimitri Fontaine 2019-04-15 23:06:57 +02:00
parent 1a4ce4fb46
commit 4b9cbcbce3

View File

@ -193,12 +193,20 @@ Illegal ~a character starting at position ~a~@[: ~a~].~%"
:excluding excluding)
;; fetch view (and their columns) metadata, covering comments too
(cond (view-names (list-all-columns schema
:only-tables view-names
:table-type :view))
(let* ((view-names (unless (eq :all materialize-views)
(mapcar #'car materialize-views)))
(including
(loop :for (schema-name . view-name) :in view-names
:collect (make-string-match-rule :target view-name))))
(cond (view-names
(list-all-columns schema
:only-tables only-tables
:including including
:excluding excluding
:table-type :view))
((eq :all materialize-views)
(list-all-columns schema :table-type :view)))
((eq :all materialize-views)
(list-all-columns schema :table-type :view))))
(when foreign-keys
(list-all-fkeys schema