diff options
author | Jeremy Daer <jeremydaer@gmail.com> | 2017-07-06 16:36:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-06 16:36:14 -0700 |
commit | c9b514cd3e8fe7d74ae91ecd30db839132e7899c (patch) | |
tree | b863b9ee939579ef82fa3f32f0a535a3d592e166 | |
parent | c8ce3459648ce0f86646b564ce1c0bb16a4b48eb (diff) | |
parent | 3b1caef68f1780672f2e195d93209de40254bc11 (diff) | |
download | rails-c9b514cd3e8fe7d74ae91ecd30db839132e7899c.tar.gz rails-c9b514cd3e8fe7d74ae91ecd30db839132e7899c.tar.bz2 rails-c9b514cd3e8fe7d74ae91ecd30db839132e7899c.zip |
Merge pull request #29704 from kamipo/fix_mariadb_version
Fix extracting MariaDB version
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 8 |
1 files changed, 6 insertions, 2 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 c15b4a1a05..06976aa769 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -59,12 +59,12 @@ module ActiveRecord @statements = StatementPool.new(self.class.type_cast_config_to_integer(config[:statement_limit])) if version < "5.1.10" - raise "Your version of MySQL (#{full_version.match(/^\d+\.\d+\.\d+/)[0]}) is too old. Active Record supports MySQL >= 5.1.10." + raise "Your version of MySQL (#{version_string}) is too old. Active Record supports MySQL >= 5.1.10." end end def version #:nodoc: - @version ||= Version.new(full_version.match(/^\d+\.\d+\.\d+/)[0]) + @version ||= Version.new(version_string) end def mariadb? # :nodoc: @@ -854,6 +854,10 @@ module ActiveRecord end end + def version_string + full_version.match(/^(?:5\.5\.5-)?(\d+\.\d+\.\d+)/)[1] + end + class MysqlString < Type::String # :nodoc: def serialize(value) case value |