From 4b9cbcbce3b1fbff86e2afd59b6aed6fe34d125d Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Mon, 15 Apr 2019 23:06:57 +0200 Subject: [PATCH] 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. --- src/sources/mysql/mysql.lisp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/sources/mysql/mysql.lisp b/src/sources/mysql/mysql.lisp index 135a5fe..893427f 100644 --- a/src/sources/mysql/mysql.lisp +++ b/src/sources/mysql/mysql.lisp @@ -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