提交 c9b514cd 编写于 作者: J Jeremy Daer 提交者: GitHub

Merge pull request #29704 from kamipo/fix_mariadb_version

Fix extracting MariaDB version
......@@ -59,12 +59,12 @@ def initialize(connection, logger, connection_options, config)
@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 @@ def binary_to_sql(limit) # :nodoc:
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册