Commit 328e1a6d authored by Dylan Griffith's avatar Dylan Griffith

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
......@@ -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)
......
......@@ -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?
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment