aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJeremy Daer <jeremydaer@gmail.com>2016-04-13 22:18:54 -0700
committerJeremy Daer <jeremydaer@gmail.com>2016-04-13 22:18:54 -0700
commit128923ca14eeae032c2ed72b043e2bbcda09ab9c (patch)
treed48c435be8261c2cb5e3a157ca551c2296204aa7 /activerecord
parentad87acf8b2eeeb2c2b54a436cff7924f9fb470a0 (diff)
parentbbb8f518b53f1e9ef90c490f741e2eea0d993a17 (diff)
downloadrails-128923ca14eeae032c2ed72b043e2bbcda09ab9c.tar.gz
rails-128923ca14eeae032c2ed72b043e2bbcda09ab9c.tar.bz2
rails-128923ca14eeae032c2ed72b043e2bbcda09ab9c.zip
Merge pull request #24522 from vipulnsward/run-mariadb-on-travis
Test against MariaDB 10.0
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb8
-rw-r--r--activerecord/test/cases/time_precision_test.rb1
2 files changed, 5 insertions, 4 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 330fb11895..8bd9da4fbc 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
@@ -81,6 +81,10 @@ module ActiveRecord
@version ||= Version.new(full_version.match(/^\d+\.\d+\.\d+/)[0])
end
+ def mariadb? # :nodoc:
+ full_version =~ /mariadb/i
+ end
+
# Returns true, since this connection adapter supports migrations.
def supports_migrations?
true
@@ -782,10 +786,6 @@ module ActiveRecord
subselect.from subsubselect.as('__active_record_temp')
end
- def mariadb?
- full_version =~ /mariadb/i
- end
-
def supports_rename_index?
mariadb? ? false : version >= '5.7.6'
end
diff --git a/activerecord/test/cases/time_precision_test.rb b/activerecord/test/cases/time_precision_test.rb
index 628a8eb771..c422daa859 100644
--- a/activerecord/test/cases/time_precision_test.rb
+++ b/activerecord/test/cases/time_precision_test.rb
@@ -44,6 +44,7 @@ class TimePrecisionTest < ActiveRecord::TestCase
end
def test_formatting_time_according_to_precision
+ skip("TIME column on MariaDB doesn't ignore the date part of the string when it coerces to time") if current_adapter?(:Mysql2Adapter) && ActiveRecord::Base.connection.mariadb?
@connection.create_table(:foos, force: true) do |t|
t.time :start, precision: 0
t.time :finish, precision: 4