소스 검색

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