From 2224d06cfade0e0142e834ef1aa7a93881ccf3e4 Mon Sep 17 00:00:00 2001 From: Jeremy Daer Date: Fri, 8 Apr 2016 17:49:59 -0700 Subject: 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. --- .../lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'activerecord/lib') 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? -- cgit v1.2.3