diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2016-02-03 19:12:20 -0700 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2016-02-03 19:12:20 -0700 |
commit | 9df30839267c327ee4cad9808bfb7c694c20abac (patch) | |
tree | c8e1b4fe5e1c293bf357d064ef3ed0b0839341be /activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | |
parent | 8ee91d4051e679d6d6bbb6252796bbedde7d782c (diff) | |
parent | c7f8019bff16554095ff5c2c4e539962922b7a55 (diff) | |
download | rails-9df30839267c327ee4cad9808bfb7c694c20abac.tar.gz rails-9df30839267c327ee4cad9808bfb7c694c20abac.tar.bz2 rails-9df30839267c327ee4cad9808bfb7c694c20abac.zip |
Merge pull request #23458 from kamipo/activerecord_supports_mysql_5.0_and_up
Active Record supports MySQL >= 5.0
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index 70d7956baa..8751b6da4b 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -52,7 +52,6 @@ module ActiveRecord INDEX_TYPES = [:fulltext, :spatial] INDEX_USINGS = [:btree, :hash] - # FIXME: Make the first parameter more similar for the two adapters def initialize(connection, logger, connection_options, config) super(connection, logger, config) @quoted_column_names, @quoted_table_names = {}, {} @@ -65,6 +64,10 @@ module ActiveRecord else @prepared_statements = false end + + if version < '5.0.0' + raise "Your version of MySQL (#{full_version.match(/^\d+\.\d+\.\d+/)[0]}) is too old. Active Record supports MySQL >= 5.0." + end end CHARSETS_OF_4BYTES_MAXLEN = ['utf8mb4', 'utf16', 'utf16le', 'utf32'] @@ -98,12 +101,8 @@ module ActiveRecord true end - # MySQL 4 technically support transaction isolation, but it is affected by a bug - # where the transaction level gets persisted for the whole session: - # - # http://bugs.mysql.com/bug.php?id=39170 def supports_transaction_isolation? - version >= '5.0.0' + true end def supports_explain? @@ -119,17 +118,15 @@ module ActiveRecord end def supports_views? - version >= '5.0.0' + true end def supports_datetime_with_precision? version >= '5.6.4' end - # 5.0.0 definitely supports it, possibly supported by earlier versions but - # not sure def supports_advisory_locks? - version >= '5.0.0' + true end def get_advisory_lock(lock_name, timeout = 0) # :nodoc: |