Business intelligence made simple
Fixed mysql error
Andrew Kane34dfb6349a34
diff --git a/lib/blazer/adapters/sql_adapter.rb b/lib/blazer/adapters/sql_adapter.rbindex f2e84ae7..cb72cebf 100644--- a/lib/blazer/adapters/sql_adapter.rb+++ b/lib/blazer/adapters/sql_adapter.rb@@ -97,6 +97,11 @@ module Blazerconnection_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 Blazerdef 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}")elseraise Blazer::TimeoutNotSupported, "Timeout not supported for #{adapter_name} adapter"end