Skip to content

Instantly share code, notes, and snippets.

@dkam
Created April 12, 2011 10:44
Show Gist options
  • Save dkam/915313 to your computer and use it in GitHub Desktop.
Save dkam/915313 to your computer and use it in GitHub Desktop.
Loading production environment (Rails 2.3.11)
ree-1.8.7-2011.03 :001 > Product.find_by_gtin("9781854309655")
ArgumentError: time out of range
from /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/mysql2-0.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:635:in `local'
from /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/mysql2-0.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:635:in `each'
from /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/mysql2-0.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:635:in `select'
from /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all_without_query_cache'
from /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract/query_cache.rb:62:in `select_all'
from /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.11/lib/active_record/base.rb:665:in `find_by_sql'
from /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.11/lib/active_record/base.rb:1582:in `find_every'
from /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.11/lib/active_record/base.rb:1539:in `find_initial'
from /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.11/lib/active_record/base.rb:617:in `find'
from /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.11/lib/active_record/base.rb:1914:in `find_by_gtin'
from /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.11/lib/active_record/base.rb:1919:in `send'
from /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/activerecord-2.3.11/lib/active_record/base.rb:1919:in `method_missing'
from (irb):1
mysql> select * from products where gtin='9781854309655';
*************************** 1. row ***************************
id: 924982
title: You're Too Small!
author: Shen Roddie
image_url: http://static.booko.com.au/images/covers/5/5/6/9/9781854309655.jpg
publisher: Little Tiger Press
published_on: 2051-01-01 00:00:00
accessed_on: 2011-04-12 09:21:44
state_updated_at: 2011-04-12 09:22:00
published_in: United Kingdom, 07 March 2005
format: Paperback
subtitle: NULL
type: Book
gtin: 9781854309655
region: NULL
pricer_pid: 3938
state: 0
updated_at: 2011-04-12 09:22:00
work_id: NULL
detail_lookup_on: 2011-04-12 09:21:48
1 row in set (0.00 sec)
mysql>
@dkam
Copy link
Author

dkam commented Apr 12, 2011

Turns out - the "published_on" value of 2051 breaks rails!

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