Skip to content

Commit

Permalink
Fix using postgres adapter with postgres-pr after last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyevans committed Dec 2, 2008
1 parent 2a58c45 commit f29cfff
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/sequel_core/adapters/postgres.rb
Expand Up @@ -62,6 +62,9 @@ def self.unescape_bytea(obj)
def block(timeout=nil)
end
end
unless defined?(CONNECTION_OK)
CONNECTION_OK = -1
end
end
class PGresult
alias_method :nfields, :num_fields unless method_defined?(:nfields)
Expand Down Expand Up @@ -138,9 +141,10 @@ def execute(sql, args=nil)
rescue PGError
raise(Sequel::DatabaseDisconnectError)
end
(s == Adapter::CONNECTION_OK) ? raise : raise(Sequel::DatabaseDisconnectError)
status_ok = (s == Adapter::CONNECTION_OK)
status_ok ? raise : raise(Sequel::DatabaseDisconnectError)
ensure
block if s == Adapter::CONNECTION_OK
block if status_ok
end
begin
block_given? ? yield(q) : q.cmd_tuples
Expand Down

0 comments on commit f29cfff

Please sign in to comment.