New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Include running mariadb on travis #24522

Merged
merged 1 commit into from Apr 14, 2016

Conversation

Projects
None yet
7 participants
@vipulnsward
Member

vipulnsward commented Apr 12, 2016

No description provided.

@vipulnsward vipulnsward force-pushed the vipulnsward:run-mariadb-on-travis branch Apr 12, 2016

@arthurnn

This comment has been minimized.

Member

arthurnn commented Apr 12, 2016

do we wanna add another extra build?
I would say no, but will leave to the core team to decide.

@vipulnsward

This comment has been minimized.

Member

vipulnsward commented Apr 12, 2016

This is based on
#24454 (comment)

On Tuesday 12 April 2016, Arthur Nogueira Neves notifications@github.com
wrote:

do we wanna add another extra build?
I would say no, but will leave to the core team to decide.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#24522 (comment)

Vipul A.M.
+91-8149-204995

@vipulnsward vipulnsward force-pushed the vipulnsward:run-mariadb-on-travis branch Apr 12, 2016

@vipulnsward

This comment has been minimized.

Member

vipulnsward commented Apr 12, 2016

r? @jeremy
So we have one failing test related to microseconds support.

@guilleiguaran

This comment has been minimized.

Member

guilleiguaran commented Apr 12, 2016

@vipulnsward that test is expected to fail in mariadb?

@vipulnsward

This comment has been minimized.

Member

vipulnsward commented Apr 12, 2016

No. I am investigating.

@vipulnsward

This comment has been minimized.

Member

vipulnsward commented Apr 12, 2016

I am confused over this failure- https://travis-ci.org/rails/rails/jobs/122573447
Ideally it should be passing. @kamipo thoughts? I have added logging over there.

@vipulnsward vipulnsward force-pushed the vipulnsward:run-mariadb-on-travis branch Apr 13, 2016

@vipulnsward

View changes

activerecord/test/cases/time_precision_test.rb Outdated
@@ -44,6 +44,8 @@ def test_invalid_time_precision_raises_error
end
def test_formatting_time_according_to_precision
#FIXME: This time precision mismatch for query is specifically on travis for MariaDB.
skip("Fails for MariaDB 10.0.24, specifically on travis") if current_adapter?(:Mysql2Adapter) && ActiveRecord::Base.connection.version > "10.0"

This comment has been minimized.

@vipulnsward

vipulnsward Apr 13, 2016

Member

I had to skip this for now. I have MariaDB 10.0.4 running on my machine(where it passes), all queries look good here as well as on travis, but Travis seems to not return the object on query on precision field in this test.

Will need more 👀 on this.

This comment has been minimized.

@jeremy

jeremy Apr 13, 2016

Member

can check ActiveRecord::Base.connection.mariadb?

@kamipo

This comment has been minimized.

Member

kamipo commented Apr 13, 2016

MySQL 5.7.9:

root@localhost [test] > CREATE TABLE `foos` (`id` int AUTO_INCREMENT PRIMARY KEY, `start` time(0), `finish` time(4)) ENGINE=InnoDB;
Query OK, 0 rows affected (0.04 sec)

root@localhost [test] > INSERT INTO `foos` (`start`, `finish`) VALUES ('2000-01-01 12:30:00', '2000-01-01 12:30:00.999900');
Query OK, 1 row affected, 2 warnings (0.02 sec)

Note (Code 1292): Incorrect time value: '2000-01-01 12:30:00' for column 'start' at row 1
Note (Code 1292): Incorrect time value: '2000-01-01 12:30:00.999900' for column 'finish' at row 1
root@localhost [test] > SELECT `foos`.* FROM `foos`;
+----+----------+---------------+
| id | start    | finish        |
+----+----------+---------------+
|  1 | 12:30:00 | 12:30:00.9999 |
+----+----------+---------------+
1 row in set (0.00 sec)

root@localhost [test] > SELECT  `foos`.* FROM `foos` WHERE `foos`.`start` = '2000-01-01 12:30:00' LIMIT 1;
+----+----------+---------------+
| id | start    | finish        |
+----+----------+---------------+
|  1 | 12:30:00 | 12:30:00.9999 |
+----+----------+---------------+
1 row in set, 1 warning (0.01 sec)

Note (Code 1292): Incorrect time value: '2000-01-01 12:30:00' for column 'start' at row 1

MariaDB 10.0.24:

root@localhost [test] > CREATE TABLE `foos` (`id` int AUTO_INCREMENT PRIMARY KEY, `start` time(0), `finish` time(4)) ENGINE=InnoDB;
Query OK, 0 rows affected (0.02 sec)

root@localhost [test] > INSERT INTO `foos` (`start`, `finish`) VALUES ('2000-01-01 12:30:00', '2000-01-01 12:30:00.999900');
Query OK, 1 row affected, 2 warnings (0.00 sec)

Note (Code 1265): Data truncated for column 'start' at row 1
Note (Code 1265): Data truncated for column 'finish' at row 1
root@localhost [test] > SELECT `foos`.* FROM `foos`;
+----+----------+---------------+
| id | start    | finish        |
+----+----------+---------------+
|  1 | 12:30:00 | 12:30:00.9999 |
+----+----------+---------------+
1 row in set (0.00 sec)

root@localhost [test] > SELECT  `foos`.* FROM `foos` WHERE `foos`.`start` = '2000-01-01 12:30:00' LIMIT 1;
Empty set (0.00 sec)

root@localhost [test] > SELECT  `foos`.* FROM `foos` WHERE `foos`.`start` = '12:30:00' LIMIT 1;
+----+----------+---------------+
| id | start    | finish        |
+----+----------+---------------+
|  1 | 12:30:00 | 12:30:00.9999 |
+----+----------+---------------+
1 row in set (0.00 sec)
@vipulnsward

This comment has been minimized.

Member

vipulnsward commented Apr 13, 2016

Yup, forgot to post this behaviour discrepancy here. Need to find solution for this.

env:
- "GEM=ar:mysql2"
addons:
mariadb: 10.0

This comment has been minimized.

@jeremy

jeremy Apr 13, 2016

Member

We should probably test with mariadb: 10.1 if Travis has it available.

This comment has been minimized.

@vipulnsward vipulnsward force-pushed the vipulnsward:run-mariadb-on-travis branch Apr 13, 2016

@@ -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

This comment has been minimized.

@vipulnsward

vipulnsward Apr 13, 2016

Member

Note: Moved this. This is similar to what is done for version: vipulnsward@d9e74ac

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

@vipulnsward vipulnsward force-pushed the vipulnsward:run-mariadb-on-travis branch to bbb8f51 Apr 13, 2016

@jeremy jeremy merged commit 128923c into rails:master Apr 14, 2016

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details

kamipo added a commit to kamipo/rails that referenced this pull request Apr 14, 2016

Add `quoted_time` for truncating the date part of a time column value
Context rails#24522.

TIME column on MariaDB doesn't ignore the date part of the string when
it coerces to time.

```
root@localhost [test] > CREATE TABLE `foos` (`id` int AUTO_INCREMENT PRIMARY KEY, `start` time(0), `finish` time(4)) ENGINE=InnoDB;
Query OK, 0 rows affected (0.02 sec)

root@localhost [test] > INSERT INTO `foos` (`start`, `finish`) VALUES ('2000-01-01 12:30:00', '2000-01-01 12:30:00.999900');
Query OK, 1 row affected, 2 warnings (0.00 sec)

Note (Code 1265): Data truncated for column 'start' at row 1
Note (Code 1265): Data truncated for column 'finish' at row 1
root@localhost [test] > SELECT `foos`.* FROM `foos`;
+----+----------+---------------+
| id | start    | finish        |
+----+----------+---------------+
|  1 | 12:30:00 | 12:30:00.9999 |
+----+----------+---------------+
1 row in set (0.00 sec)

root@localhost [test] > SELECT  `foos`.* FROM `foos` WHERE `foos`.`start` = '2000-01-01 12:30:00' LIMIT 1;
Empty set (0.00 sec)

root@localhost [test] > SELECT  `foos`.* FROM `foos` WHERE `foos`.`start` = '12:30:00' LIMIT 1;
+----+----------+---------------+
| id | start    | finish        |
+----+----------+---------------+
|  1 | 12:30:00 | 12:30:00.9999 |
+----+----------+---------------+
1 row in set (0.00 sec)
```
@bronson

This comment has been minimized.

Contributor

bronson commented Apr 20, 2016

Back in Feb I reported this as a Maria bug: #23578

They acknowledged it's not great behavior and started fixing it: https://jira.mariadb.org/browse/MDEV-9541

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment