aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-07-19 03:24:10 +0900
committerRyuta Kamizono <kamipo@gmail.com>2017-07-19 03:33:03 +0900
commit8a91fe0017d90063a6c8823ceee88413e2b75fe7 (patch)
tree60716a0802179b365e977bbf364b60e71a0ca03b
parente108a082df8bd815901b26525620f3d3d7ba0e10 (diff)
downloadrails-8a91fe0017d90063a6c8823ceee88413e2b75fe7.tar.gz
rails-8a91fe0017d90063a6c8823ceee88413e2b75fe7.tar.bz2
rails-8a91fe0017d90063a6c8823ceee88413e2b75fe7.zip
Fix type casting a time for MariaDB
Context #24542. Since 8ebe1f2, it has lost stripping date part for a time value. But I confirmed it is still needed even if MariaDB 10.2.6 GA. MariaDB 10.2.6, `prepared_statements: true`: ``` % ARCONN=mysql2 be ruby -w -Itest test/cases/time_precision_test.rb -n test_formatting_time_according_to_precision Using mysql2 Run options: -n test_formatting_time_according_to_precision --seed 37614 F Failure: TimePrecisionTest#test_formatting_time_according_to_precision [test/cases/time_precision_test.rb:53]: Failed assertion, no message given. bin/rails test test/cases/time_precision_test.rb:46 Finished in 0.040279s, 24.8268 runs/s, 24.8268 assertions/s. 1 runs, 1 assertions, 1 failures, 0 errors, 0 skips ```
-rw-r--r--activerecord/lib/active_record/connection_adapters/mysql/quoting.rb1
1 files changed, 0 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb b/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb
index 0cc0ac74fe..4441c1e2f8 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql/quoting.rb
@@ -42,7 +42,6 @@ module ActiveRecord
def _type_cast(value)
case value
- when Type::Time::Value then value.__getobj__
when Date, Time then value
else super
end