Skip to content

Commit

Permalink
Include running mariadb on travis
Browse files Browse the repository at this point in the history
- Specify we want to run on latest stable ruby for mariadb

- change in runs of builds

Make mariadb? method publicly available
  • Loading branch information
vipulnsward committed Apr 13, 2016
1 parent db9bc80 commit bbb8f51
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ rvm:
matrix:
include:
# 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
jdk: oraclejdk8
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ def version
@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
Expand Down Expand Up @@ -782,10 +786,6 @@ def subquery_for(key, select)
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
Expand Down
1 change: 1 addition & 0 deletions activerecord/test/cases/time_precision_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def test_invalid_time_precision_raises_error
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
Expand Down

0 comments on commit bbb8f51

Please sign in to comment.