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
328e1a6d
Commit
328e1a6d
authored
Oct 16, 2021
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sh-update-pg-query' into 'master'
Update pg_query to v2.1.1 See merge request gitlab-org/gitlab!72426
parents
6180a6af
0720763d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
18 deletions
+4
-18
Gemfile.lock
Gemfile.lock
+1
-1
spec/support/database/prevent_cross_database_modification.rb
spec/support/database/prevent_cross_database_modification.rb
+2
-9
spec/support/database/prevent_cross_joins.rb
spec/support/database/prevent_cross_joins.rb
+1
-8
No files found.
Gemfile.lock
View file @
328e1a6d
...
...
@@ -907,7 +907,7 @@ GEM
peek (1.1.0)
railties (>= 4.0.0)
pg (1.2.3)
pg_query (2.1.
0
)
pg_query (2.1.
1
)
google-protobuf (>= 3.17.1)
plist (3.6.0)
png_quantizator (0.2.1)
...
...
spec/support/database/prevent_cross_database_modification.rb
View file @
328e1a6d
...
...
@@ -81,15 +81,8 @@ module Database
# PgQuery might fail in some cases due to limited nesting:
# https://github.com/pganalyze/pg_query/issues/209
#
# Also, we disable GC while parsing because of https://github.com/pganalyze/pg_query/issues/226
begin
GC
.
disable
parsed_query
=
PgQuery
.
parse
(
sql
)
tables
=
sql
.
downcase
.
include?
(
' for update'
)
?
parsed_query
.
tables
:
parsed_query
.
dml_tables
ensure
GC
.
enable
end
parsed_query
=
PgQuery
.
parse
(
sql
)
tables
=
sql
.
downcase
.
include?
(
' for update'
)
?
parsed_query
.
tables
:
parsed_query
.
dml_tables
return
if
tables
.
empty?
...
...
spec/support/database/prevent_cross_joins.rb
View file @
328e1a6d
...
...
@@ -33,14 +33,7 @@ module Database
# PgQuery might fail in some cases due to limited nesting:
# https://github.com/pganalyze/pg_query/issues/209
#
# Also, we disable GC while parsing because of https://github.com/pganalyze/pg_query/issues/226
begin
GC
.
disable
tables
=
PgQuery
.
parse
(
sql
).
tables
ensure
GC
.
enable
end
tables
=
PgQuery
.
parse
(
sql
).
tables
schemas
=
Database
::
GitlabSchema
.
table_schemas
(
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