We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
time
trilogy
For midnigh(00:00) only, the processing of the time type in the trilogy adapter is broken. ※ An example of mysql2 is also included for reference.
# frozen_string_literal: true require "bundler/inline" gemfile(true) do source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } gem "rails", github: "rails/rails", branch: "main" gem "trilogy" gem "mysql2" end require "active_record" require "minitest/autorun" require "logger" ActiveRecord::Base.logger = Logger.new(STDOUT) ActiveRecord::Base.establish_connection(adapter: "trilogy", database: "test", username: "root", host: '127.0.0.1', port: 3306) ActiveRecord::Schema.define do create_table :posts, force: true do |t| t.time :time_column end end class Post < ActiveRecord::Base end Post.create!(time_column: '00:00') class BugTest < Minitest::Test def test_mysql2 ActiveRecord::Base.establish_connection(adapter: "mysql2", database: "test", username: "root", host: '127.0.0.1', port: 3306) assert_equal Post.take.time_column, Time.utc(2000, 1, 1, 0, 0) end def test_trilogy ActiveRecord::Base.establish_connection(adapter: "trilogy", database: "test", username: "root", host: '127.0.0.1', port: 3306) assert_equal Post.take.time_column, Time.utc(2000, 1, 1, 0, 0) end end
Both mysql2 and torilogy, 2000-01-01T00:00:00Z to be returned.
mysql2
torilogy
2000-01-01T00:00:00Z
In case of trilogy, nil is returned.
nil
Failure: BugTest#test_trilogy [midnight.rb:42]: Expected: nil Actual: 2000-01-01 00:00:00 UTC
Is it a problem with Trilogy?
client = Trilogy.new(host: "127.0.0.1", port: 13306, username: "root") client.change_db('test') client.query('SELECT * FROM posts;').to_a #=> [[1, nil]]
I was wondering where to report this. activerecord-trilogy-adapter and trilogy and rails/rails. Sorry if I am wrong.
Rails version: v7.1.0.alpha (main@c9cdd80)
Ruby version: v3.2.2
Trilogy: v2.4.1
The text was updated successfully, but these errors were encountered:
Yes. Thanks for the report. This was recently fixed in trilogy: trilogy-libraries/trilogy#97 -- there should be a release soon.
Sorry, something went wrong.
No branches or pull requests
Steps to reproduce
For midnigh(00:00) only, the processing of the
time
type in the trilogy adapter is broken.※ An example of mysql2 is also included for reference.
Expected behavior
Both
mysql2
andtorilogy
,2000-01-01T00:00:00Z
to be returned.Actual behavior
In case of
trilogy
,nil
is returned.Is it a problem with Trilogy?
I was wondering where to report this. activerecord-trilogy-adapter and trilogy and rails/rails.
Sorry if I am wrong.
System configuration
Rails version: v7.1.0.alpha (main@c9cdd80)
Ruby version: v3.2.2
Trilogy: v2.4.1
The text was updated successfully, but these errors were encountered: