|
@@ -97,6 +97,11 @@ module Blazer
|
|
|
connection_model.connection.select_all(statement)
|
|
|
end
|
|
|
|
|
|
+ # seperate from select_all to prevent mysql error
|
|
|
+ def execute(statement)
|
|
|
+ connection_model.connection.execute(statement)
|
|
|
+ end
|
|
|
+
|
|
|
def postgresql?
|
|
|
["PostgreSQL", "PostGIS"].include?(adapter_name)
|
|
|
end
|
|
@@ -120,9 +125,9 @@ module Blazer
|
|
|
|
|
|
def set_timeout(timeout)
|
|
|
if postgresql? || redshift?
|
|
|
- select_all("SET #{use_transaction? ? "LOCAL " : ""}statement_timeout = #{timeout.to_i * 1000}")
|
|
|
+ execute("SET #{use_transaction? ? "LOCAL " : ""}statement_timeout = #{timeout.to_i * 1000}")
|
|
|
elsif mysql?
|
|
|
- select_all("SET max_execution_time = #{timeout.to_i * 1000}")
|
|
|
+ execute("SET max_execution_time = #{timeout.to_i * 1000}")
|
|
|
else
|
|
|
raise Blazer::TimeoutNotSupported, "Timeout not supported for #{adapter_name} adapter"
|
|
|
end
|