diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-09 07:34:58 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-07-09 07:41:32 -0300 |
commit | d704c1cb9850bd563b7ad99762e75b9b3cb7aebf (patch) | |
tree | dc327990c6cd5751933de680437d97148fc6c17f /activerecord | |
parent | c4ad10e2547c9546d7ed49e4e82ba5cbb7bcf03f (diff) | |
download | rails-d704c1cb9850bd563b7ad99762e75b9b3cb7aebf.tar.gz rails-d704c1cb9850bd563b7ad99762e75b9b3cb7aebf.tar.bz2 rails-d704c1cb9850bd563b7ad99762e75b9b3cb7aebf.zip |
Do not shallow the original exception in exec_cache
when result_error_field is not defined on result raise the original
exception.
Fixes #11260
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/CHANGELOG.md | 6 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 3c38b47d2e..88f69a7308 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,5 +1,11 @@ ## unreleased ## +* Do not shallow the original exception in `exec_cache` on PostgreSQL adapter. + + Fixes #11260. + + *Rafael Mendonça França* + * Fix `ActiveRecord::Store` incorrectly tracking changes of its attributes. Fixes #10373. diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 04de08e876..e98337e7d5 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -1179,7 +1179,11 @@ module ActiveRecord # prepared statements whose return value may have changed is # FEATURE_NOT_SUPPORTED. Check here for more details: # http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/utils/cache/plancache.c#l573 - code = e.result.result_error_field(PGresult::PG_DIAG_SQLSTATE) + begin + code = e.result.result_error_field(PGresult::PG_DIAG_SQLSTATE) + rescue + raise e + end if FEATURE_NOT_SUPPORTED == code @statements.delete sql_key(sql) retry |