diff options
Diffstat (limited to 'spec/support/database')
-rw-r--r-- | spec/support/database/prevent_cross_joins.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/spec/support/database/prevent_cross_joins.rb b/spec/support/database/prevent_cross_joins.rb index c44bf96a268..540c287bdad 100644 --- a/spec/support/database/prevent_cross_joins.rb +++ b/spec/support/database/prevent_cross_joins.rb @@ -23,7 +23,6 @@ module Database ALLOW_THREAD_KEY = :allow_cross_joins_across_databases ALLOW_ANNOTATE_KEY = ALLOW_THREAD_KEY.to_s.freeze - IGNORED_SCHEMAS = %i[gitlab_shared gitlab_internal].freeze def self.validate_cross_joins!(sql) return if Thread.current[ALLOW_THREAD_KEY] || sql.include?(ALLOW_ANNOTATE_KEY) @@ -41,9 +40,8 @@ module Database end schemas = ::Gitlab::Database::GitlabSchema.table_schemas!(tables) - schemas.subtract(IGNORED_SCHEMAS) - if schemas.many? + unless ::Gitlab::Database::GitlabSchema.cross_joins_allowed?(schemas) Thread.current[:has_cross_join_exception] = true raise CrossJoinAcrossUnsupportedTablesError, "Unsupported cross-join across '#{tables.join(", ")}' querying '#{schemas.to_a.join(", ")}' discovered " \ |