ソースを参照

Use SET LOCAL for timeouts in transactions

Andrew Kane 8 年 前
コミット
bcb1b7af67
1 ファイル変更1 行追加1 行削除
  1. 1 1
      lib/blazer/adapters/sql_adapter.rb

+ 1 - 1
lib/blazer/adapters/sql_adapter.rb

@@ -116,7 +116,7 @@ module Blazer
 
       def set_timeout(timeout)
         if postgresql? || redshift?
-          select_all("SET statement_timeout = #{timeout.to_i * 1000}")
+          select_all("SET #{use_transaction? ? "LOCAL " : ""}statement_timeout = #{timeout.to_i * 1000}")
         elsif mysql?
           select_all("SET max_execution_time = #{timeout.to_i * 1000}")
         else