From 3662d79fe8dd2f688caa51386b87a27ce0e23d23 Mon Sep 17 00:00:00 2001 From: luozihao <1165977584@qq.com> Date: Thu, 24 Jun 2021 16:55:02 +0800 Subject: [PATCH] Fixed a bug where partitioned table migration could not be matched with include and exclude parameters --- src/sources/mysql/mysql-schema.lisp | 6 +++++- src/sources/mysql/sql/list-all-partitions.sql | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sources/mysql/mysql-schema.lisp b/src/sources/mysql/mysql-schema.lisp index c457934..805ab06 100644 --- a/src/sources/mysql/mysql-schema.lisp +++ b/src/sources/mysql/mysql-schema.lisp @@ -121,7 +121,11 @@ (loop :for (table-name submethod name method expression description) :in (mysql-query (sql "/mysql/list-all-partitions.sql" - (db-name *connection*))) + (db-name *connection*) + including ; do we print the clause? + including + excluding ; do we print the clause? + excluding)) :do (let* ((table (find-table schema table-name)) (partition (make-partition :name name ; further processing is needed diff --git a/src/sources/mysql/sql/list-all-partitions.sql b/src/sources/mysql/sql/list-all-partitions.sql index 2a64768..4a32919 100644 --- a/src/sources/mysql/sql/list-all-partitions.sql +++ b/src/sources/mysql/sql/list-all-partitions.sql @@ -4,5 +4,7 @@ partition_description FROM information_schema.partitions WHERE table_schema='~a' + ~:[~*~;and (~{table_name ~a~^ or ~})~] + ~:[~*~;and (~{table_name ~a~^ and ~})~] GROUP BY table_name ORDER BY partition_ordinal_position; \ No newline at end of file -- Gitee