diff options
author | Jeremy Daer <jeremydaer@gmail.com> | 2016-04-08 17:49:59 -0700 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2016-04-08 18:41:25 -0700 |
commit | 2224d06cfade0e0142e834ef1aa7a93881ccf3e4 (patch) | |
tree | 380c23022da47d364f942a285eeeab31cae96890 /activerecord/lib | |
parent | 2080ff2872e9604155a276a830b38844dc45c3b4 (diff) | |
download | rails-2224d06cfade0e0142e834ef1aa7a93881ccf3e4.tar.gz rails-2224d06cfade0e0142e834ef1aa7a93881ccf3e4.tar.bz2 rails-2224d06cfade0e0142e834ef1aa7a93881ccf3e4.zip |
Support microsecond datetime precision on MariaDB 5.3+.
We support microsecond datetime precision for MySQL 5.6.4+. MariaDB has
supported it since 5.3.0, but even 10.x versions return a compatible
version string like `5.5.5-10.1.8-MariaDB-log` which we parse as 5.5.5,
before MySQL supported microsecond precision.
Specialize our version check to account for MariaDB to fix.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 6 |
1 files changed, 5 insertions, 1 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 42d3c68970..1797af4e97 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -121,7 +121,11 @@ module ActiveRecord end def supports_datetime_with_precision? - version >= '5.6.4' + if mariadb? + version >= '5.3.0' + else + version >= '5.6.4' + end end def supports_advisory_locks? |