Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
0.4.0 bug fixes (#89)
Browse files Browse the repository at this point in the history
* allow semicolon at end of query
CORE-687

* retry bad connection once
CORE-687
  • Loading branch information
joycelau1 authored Sep 10, 2019
1 parent 5f44aaa commit f63c054
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/models/query_execution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def self.query_snowflake(connection, body, result, sample_callback)
# then read in the first 100 rows from the file as sample rows
# Note: snowflake unload currently has a max file size of 5 GB.
connection.reconnect_on_failure do
body = body.strip.gsub(/;$/, '')
location = File.join(connection.unload_target, result.current_result_filename)
sql = SNOWFLAKE_UNLOAD_SQL % {location: location, query: body, max_file_size: connection.max_file_size}
row = connection.connection.fetch(sql).first
Expand Down
2 changes: 1 addition & 1 deletion lib/redshift_pg/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def reconnect_on_failure(&block)
return yield
rescue PG::UnableToSend, PG::ConnectionBad
pg_connection.reset
retry
return yield # retry once
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/snowflake_db/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def reconnect_on_failure(&block)
rescue Sequel::DatabaseError => e
raise unless connection_expired_error?(e)
connection.reset
retry
return yield # retry once
end
end

Expand Down

0 comments on commit f63c054

Please sign in to comment.