Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5e3d4ef8
Commit
5e3d4ef8
authored
Aug 25, 2021
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip sql queries generated by database_cleaner
parent
839a8400
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
spec/support/database/prevent_cross_joins.rb
spec/support/database/prevent_cross_joins.rb
+4
-0
No files found.
spec/support/database/prevent_cross_joins.rb
View file @
5e3d4ef8
...
@@ -24,6 +24,10 @@ module Database
...
@@ -24,6 +24,10 @@ module Database
def
self
.
validate_cross_joins!
(
sql
)
def
self
.
validate_cross_joins!
(
sql
)
return
if
Thread
.
current
[
:allow_cross_joins_across_databases
]
return
if
Thread
.
current
[
:allow_cross_joins_across_databases
]
# Allow spec/support/database_cleaner.rb queries to disable/enable triggers for many tables
# See https://gitlab.com/gitlab-org/gitlab/-/issues/339396
return
if
sql
.
include?
(
"DISABLE TRIGGER"
)
||
sql
.
include?
(
"ENABLE TRIGGER"
)
# PgQuery might fail in some cases due to limited nesting:
# PgQuery might fail in some cases due to limited nesting:
# https://github.com/pganalyze/pg_query/issues/209
# https://github.com/pganalyze/pg_query/issues/209
tables
=
PgQuery
.
parse
(
sql
).
tables
tables
=
PgQuery
.
parse
(
sql
).
tables
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment