From 7fe3e4bab874695133ad98dda95d0a47f757acc0 Mon Sep 17 00:00:00 2001 From: Andrei Prigorshnev Date: Tue, 13 Jul 2021 17:21:15 +0400 Subject: [PATCH] DEV: fix joining in the script for moving timestamps (#13721) Without checking if t.table_schema = '#{@schema}' the SELECT with JOIN in the script were returning every column twice in case there is a 'backup' scheme with exactly the same tables as in the 'public scheme' --- script/db_timestamps_mover.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/script/db_timestamps_mover.rb b/script/db_timestamps_mover.rb index 62c91de6f90..44eac5ad9ac 100644 --- a/script/db_timestamps_mover.rb +++ b/script/db_timestamps_mover.rb @@ -53,6 +53,7 @@ class TimestampsUpdater JOIN information_schema.tables AS t ON c.table_name = t.table_name WHERE c.table_schema = '#{@schema}' + AND t.table_schema = '#{@schema}' AND c.data_type = '#{data_type}' AND t.table_type = 'BASE TABLE' SQL