Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-27 06:11:24 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-27 06:11:24 +0300
commit729e66ee8e5790eefb3771040839155c499faab3 (patch)
tree19cd1fd73c2373c20d2888e857de022129a79eaa /spec/support/database
parent431b84710e87a649de02d398568804f820e3b0fe (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/database')
-rw-r--r--spec/support/database/prevent_cross_joins.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/support/database/prevent_cross_joins.rb b/spec/support/database/prevent_cross_joins.rb
index 42c69a26788..8e08824c464 100644
--- a/spec/support/database/prevent_cross_joins.rb
+++ b/spec/support/database/prevent_cross_joins.rb
@@ -23,6 +23,7 @@ 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)
@@ -40,8 +41,9 @@ module Database
end
schemas = ::Gitlab::Database::GitlabSchema.table_schemas(tables)
+ schemas.subtract(IGNORED_SCHEMAS)
- if schemas.include?(:gitlab_ci) && schemas.include?(:gitlab_main)
+ if schemas.many?
Thread.current[:has_cross_join_exception] = true
raise CrossJoinAcrossUnsupportedTablesError,
"Unsupported cross-join across '#{tables.join(", ")}' querying '#{schemas.to_a.join(", ")}' discovered " \