Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workaround for Ruby garbage collection bug #227

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/pg_query/parse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ def load_objects! # rubocop:disable Metrics/CyclomaticComplexity
# The following statement types do not modify tables and are added to from_clause_items
# (and subsequently @tables)
when :select_stmt
subselect_items.concat(statement.select_stmt.target_list)
subselect_items.concat(statement.select_stmt.target_list.to_ary)
subselect_items << statement.select_stmt.where_clause if statement.select_stmt.where_clause
subselect_items.concat(statement.select_stmt.sort_clause.collect { |h| h.sort_by.node })
subselect_items.concat(statement.select_stmt.group_clause)
subselect_items.concat(statement.select_stmt.group_clause.to_ary)
subselect_items << statement.select_stmt.having_clause if statement.select_stmt.having_clause

case statement.select_stmt.op
Expand Down Expand Up @@ -143,7 +143,7 @@ def load_objects! # rubocop:disable Metrics/CyclomaticComplexity
value.from_clause.each do |item|
from_clause_items << { item: item, type: :select }
end
subselect_items.concat(statement.update_stmt.target_list)
subselect_items.concat(statement.update_stmt.target_list.to_ary)
end

subselect_items << statement.update_stmt.where_clause if statement.node == :update_stmt && statement.update_stmt.where_clause
Expand Down Expand Up @@ -247,11 +247,11 @@ def load_objects! # rubocop:disable Metrics/CyclomaticComplexity
end
end
when :bool_expr
subselect_items.concat(next_item.bool_expr.args)
subselect_items.concat(next_item.bool_expr.args.to_ary)
when :coalesce_expr
subselect_items.concat(next_item.coalesce_expr.args)
subselect_items.concat(next_item.coalesce_expr.args.to_ary)
when :min_max_expr
subselect_items.concat(next_item.min_max_expr.args)
subselect_items.concat(next_item.min_max_expr.args.to_ary)
when :res_target
subselect_items << next_item.res_target.val
when :sub_link
Expand Down