'Wrong number of arguments(1 for 0)' on Rails 4.0.1.rc3 with mysql #12647

Closed
jasonrclark opened this Issue Oct 25, 2013 · 5 comments

Comments

Projects
None yet
3 participants
@jasonrclark

Updated local projects to 4.0.1.rc3, and started getting 'Wrong number of arguments(1 for 0)' errors on ActiveRecord object creations (full trace below).

Dup'ing repo
I set up a mostly empty app that dups at https://github.com/jasonrclark/rails4.0.1.rc3_issue.

Relevant versions from Gemfile.lock

  mysql (2.9.1)
  rails (4.0.1.rc3)

Potentially is related to this PR? #11802

The Trace

~/source/newrelic/support/rc3_issue: bundle exec rails runner 'Order.create'
/Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/railties-4.0.1.rc3/lib/rails/commands/runner.rb:53:in `eval': wrong number of arguments(1 for 0) (ArgumentError)
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/connection_adapters/mysql_adapter.rb:562:in `set_field_encoding'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:464:in `block (2 levels) in columns'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/connection_adapters/mysql_adapter.rb:146:in `block in each_hash'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/connection_adapters/mysql_adapter.rb:144:in `each_hash'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/connection_adapters/mysql_adapter.rb:144:in `each_hash'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:463:in `each'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:463:in `map'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:463:in `block in columns'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/connection_adapters/mysql_adapter.rb:447:in `execute_and_free'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:462:in `columns'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/connection_adapters/schema_cache.rb:114:in `block in prepare_default_proc'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/connection_adapters/schema_cache.rb:56:in `yield'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/connection_adapters/schema_cache.rb:56:in `default'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/connection_adapters/schema_cache.rb:56:in `columns'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/model_schema.rb:208:in `columns'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/model_schema.rb:249:in `column_defaults'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/locking/optimistic.rb:169:in `column_defaults'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/core.rb:171:in `initialize'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/inheritance.rb:27:in `new'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/inheritance.rb:27:in `new'
from /Users/jclark/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/activerecord-4.0.1.rc3/lib/active_record/persistence.rb:36:in `create'
from (eval):1:in `<top (required)>'
...
@rafaelfranca

This comment has been minimized.

Show comment Hide comment
@rafaelfranca

rafaelfranca Oct 25, 2013

Member

@senny you backported 166b235. Could you take a look?

Member

rafaelfranca commented Oct 25, 2013

@senny you backported 166b235. Could you take a look?

@senny

This comment has been minimized.

Show comment Hide comment
@senny

senny Oct 28, 2013

Member

For me this already breaks down on bin/rake db:migrate. The following line is odd... my guess is it should be encode!. Either way, it looks like no tests hit this code path and it's broken.

This could be a possible fix https://gist.github.com/senny/7193374 but we should talk to Aaron first. Another approach may be to revert the two commits.

166b235 is a follow up to aef61b4.

Member

senny commented Oct 28, 2013

For me this already breaks down on bin/rake db:migrate. The following line is odd... my guess is it should be encode!. Either way, it looks like no tests hit this code path and it's broken.

This could be a possible fix https://gist.github.com/senny/7193374 but we should talk to Aaron first. Another approach may be to revert the two commits.

166b235 is a follow up to aef61b4.

@senny senny closed this in d0ea5c5 Oct 30, 2013

senny added a commit that referenced this issue Oct 30, 2013

fix code typo in `MysqlAdapter` .Closes #12647.
Conflicts:
	activerecord/CHANGELOG.md

senny added a commit that referenced this issue Oct 30, 2013

fix code typo in `MysqlAdapter` .Closes #12647.
Conflicts:
	activerecord/CHANGELOG.md
@jasonrclark

This comment has been minimized.

Show comment Hide comment
@jasonrclark

jasonrclark Oct 31, 2013

Plugged 4.0.1.rc4 into our CI systems that caught the issue to begin with, and everything looks good here. Thanks for the fix!

Plugged 4.0.1.rc4 into our CI systems that caught the issue to begin with, and everything looks good here. Thanks for the fix!

@rafaelfranca

This comment has been minimized.

Show comment Hide comment
@rafaelfranca

rafaelfranca Oct 31, 2013

Member

💚💛❤️💜💙

Member

rafaelfranca commented Oct 31, 2013

💚💛❤️💜💙

@senny

This comment has been minimized.

Show comment Hide comment
@senny

senny Oct 31, 2013

Member

@jasonrclark thank you for confirming and trying out the RC's ❤️

Member

senny commented Oct 31, 2013

@jasonrclark thank you for confirming and trying out the RC's ❤️

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