aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-06-07 05:03:26 +0930
committerGitHub <noreply@github.com>2017-06-07 05:03:26 +0930
commitac8b79d553592b3c9515940b5fe5e9d3c7ec9a45 (patch)
tree1aa959541416b6ae3002fef98dc2bdb847dbffcf
parent42198c5591922dd1853a7b7f7cde803ede6a4198 (diff)
parenteeb83fe9702f861608deab9d6b038f8a510ccc8d (diff)
downloadrails-ac8b79d553592b3c9515940b5fe5e9d3c7ec9a45.tar.gz
rails-ac8b79d553592b3c9515940b5fe5e9d3c7ec9a45.tar.bz2
rails-ac8b79d553592b3c9515940b5fe5e9d3c7ec9a45.zip
Merge pull request #28868 from yahonda/pg10_oid_unknown_to_text
PostgreSQL 10 converts unknown type to text type
-rw-r--r--activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
index bfc763e1ef..76e0ad60fe 100644
--- a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
@@ -324,13 +324,13 @@ module ActiveRecord
reset_connection
end
- def test_only_reload_type_map_once_for_every_unknown_type
+ def test_only_reload_type_map_once_for_every_unrecognized_type
silence_warnings do
assert_queries 2, ignore_none: true do
- @connection.select_all "SELECT NULL::anyelement"
+ @connection.select_all "select 'pg_catalog.pg_class'::regclass"
end
assert_queries 1, ignore_none: true do
- @connection.select_all "SELECT NULL::anyelement"
+ @connection.select_all "select 'pg_catalog.pg_class'::regclass"
end
assert_queries 2, ignore_none: true do
@connection.select_all "SELECT NULL::anyarray"
@@ -340,13 +340,13 @@ module ActiveRecord
reset_connection
end
- def test_only_warn_on_first_encounter_of_unknown_oid
+ def test_only_warn_on_first_encounter_of_unrecognized_oid
warning = capture(:stderr) {
- @connection.select_all "SELECT NULL::anyelement"
- @connection.select_all "SELECT NULL::anyelement"
- @connection.select_all "SELECT NULL::anyelement"
+ @connection.select_all "select 'pg_catalog.pg_class'::regclass"
+ @connection.select_all "select 'pg_catalog.pg_class'::regclass"
+ @connection.select_all "select 'pg_catalog.pg_class'::regclass"
}
- assert_match(/\Aunknown OID \d+: failed to recognize type of 'anyelement'\. It will be treated as String\.\n\z/, warning)
+ assert_match(/\Aunknown OID \d+: failed to recognize type of 'regclass'\. It will be treated as String\.\n\z/, warning)
ensure
reset_connection
end