diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-10-29 09:37:01 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-10-29 09:43:56 +0100 |
commit | 82ce157844f38ac144e2185786f8875df07a7a37 (patch) | |
tree | 17787a102cfde0c257811704c84b07f85ef29309 /activerecord/test | |
parent | e595d91ac2c07371b441f8b04781e7c03ac44135 (diff) | |
download | rails-82ce157844f38ac144e2185786f8875df07a7a37.tar.gz rails-82ce157844f38ac144e2185786f8875df07a7a37.tar.bz2 rails-82ce157844f38ac144e2185786f8875df07a7a37.zip |
fix MySQL enum type lookup with values matching another type. Closes #17402.
The MySQLAdapter type map used the lowest priority for enum types.
This was the result of a recent refactoring and lead to some broken lookups
for enums with values that match other types. Like `8bit`.
This patch restores the priority to what we had before the refactoring.
/cc @sgrif
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/connection_adapters/mysql_type_lookup_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/connection_adapters/mysql_type_lookup_test.rb b/activerecord/test/cases/connection_adapters/mysql_type_lookup_test.rb index d4d67487db..80244d1439 100644 --- a/activerecord/test/cases/connection_adapters/mysql_type_lookup_test.rb +++ b/activerecord/test/cases/connection_adapters/mysql_type_lookup_test.rb @@ -22,6 +22,10 @@ module ActiveRecord assert_lookup_type :string, "SET('one', 'two', 'three')" end + def test_enum_type_with_value_matching_other_type + assert_lookup_type :string, "ENUM('unicode', '8bit', 'none')" + end + def test_binary_types assert_lookup_type :binary, 'bit' assert_lookup_type :binary, 'BIT' |