1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Include running mariadb on travis

- Specify we want to run on latest stable ruby for mariadb

- change in runs of builds

Make mariadb? method publicly available
This commit is contained in:
Vipul A M 2016-04-12 19:19:21 +05:30
parent db9bc80973
commit bbb8f518b5
3 changed files with 10 additions and 4 deletions

View file

@ -31,6 +31,11 @@ rvm:
matrix: matrix:
include: include:
# Latest compiled version in http://rubies.travis-ci.org # Latest compiled version in http://rubies.travis-ci.org
- rvm: 2.3.0
env:
- "GEM=ar:mysql2"
addons:
mariadb: 10.0
- rvm: jruby-9.0.5.0 - rvm: jruby-9.0.5.0
jdk: oraclejdk8 jdk: oraclejdk8
env: env:

View file

@ -81,6 +81,10 @@ module ActiveRecord
@version ||= Version.new(full_version.match(/^\d+\.\d+\.\d+/)[0]) @version ||= Version.new(full_version.match(/^\d+\.\d+\.\d+/)[0])
end end
def mariadb? # :nodoc:
full_version =~ /mariadb/i
end
# Returns true, since this connection adapter supports migrations. # Returns true, since this connection adapter supports migrations.
def supports_migrations? def supports_migrations?
true true
@ -782,10 +786,6 @@ module ActiveRecord
subselect.from subsubselect.as('__active_record_temp') subselect.from subsubselect.as('__active_record_temp')
end end
def mariadb?
full_version =~ /mariadb/i
end
def supports_rename_index? def supports_rename_index?
mariadb? ? false : version >= '5.7.6' mariadb? ? false : version >= '5.7.6'
end end

View file

@ -44,6 +44,7 @@ class TimePrecisionTest < ActiveRecord::TestCase
end end
def test_formatting_time_according_to_precision 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| @connection.create_table(:foos, force: true) do |t|
t.time :start, precision: 0 t.time :start, precision: 0
t.time :finish, precision: 4 t.time :finish, precision: 4