diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-05-21 10:20:03 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-05-21 10:20:03 +0100 |
commit | 6f8038813c460b4f0572d5ef595cdfa94af3a94d (patch) | |
tree | 3509e94070265053394b7f2e30a779d7e60c2064 /dev-ruby/database_cleaner/files/database_cleaner-1.6.2-table-quote.patch | |
parent | eccb70a7f91b2d22582587f26d1a28bb31408b45 (diff) |
gentoo resync : 21.05.2019
Diffstat (limited to 'dev-ruby/database_cleaner/files/database_cleaner-1.6.2-table-quote.patch')
-rw-r--r-- | dev-ruby/database_cleaner/files/database_cleaner-1.6.2-table-quote.patch | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/dev-ruby/database_cleaner/files/database_cleaner-1.6.2-table-quote.patch b/dev-ruby/database_cleaner/files/database_cleaner-1.6.2-table-quote.patch deleted file mode 100644 index 2ca8c9781247..000000000000 --- a/dev-ruby/database_cleaner/files/database_cleaner-1.6.2-table-quote.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 94f3c412b154100e53b0800622a503ee56e39a6d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20B=C3=BChmann?= <dev@uuml.de> -Date: Sun, 27 Aug 2017 09:24:41 +0200 -Subject: [PATCH] Properly quote table names in table_stats_query - ---- - lib/database_cleaner/active_record/deletion.rb | 16 +++++++++------- - 1 file changed, 9 insertions(+), 7 deletions(-) - -diff --git a/lib/database_cleaner/active_record/deletion.rb b/lib/database_cleaner/active_record/deletion.rb -index 59a41c4..d172355 100644 ---- a/lib/database_cleaner/active_record/deletion.rb -+++ b/lib/database_cleaner/active_record/deletion.rb -@@ -66,14 +66,16 @@ def table_stats_query(connection, db_name) - if @cache_tables && !@table_stats_query.nil? - return @table_stats_query - else -- @table_stats_query = connection.select_values(<<-SQL).join(' UNION ') -- SELECT CONCAT('SELECT \"', table_name, '\" AS table_name, COUNT(*) AS exact_row_count FROM ', table_name) -- FROM -- INFORMATION_SCHEMA.TABLES -- WHERE -- table_schema = '#{db_name}' -- AND #{::DatabaseCleaner::ActiveRecord::Base.exclusion_condition('table_name')}; -+ tables = connection.select_values(<<-SQL) -+ SELECT table_name -+ FROM information_schema.tables -+ WHERE table_schema = '#{db_name}' -+ AND #{::DatabaseCleaner::ActiveRecord::Base.exclusion_condition('table_name')}; - SQL -+ queries = tables.map do |table| -+ "SELECT #{connection.quote(table)} AS table_name, COUNT(*) AS exact_row_count FROM #{connection.quote_table_name(table)}" -+ end -+ @table_stats_query = queries.join(' UNION ') - end - end - |