Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
jasonrclark opened this Issue · 5 comments

3 participants

Jason R. Clark Rafael Mendonça França Yves Senn
Jason R. Clark

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)>'
...
Rafael Mendonça França

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

Yves Senn
Owner

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.

Yves Senn senny closed this in d0ea5c5
Yves Senn senny referenced this issue from a commit
Yves Senn senny fix code typo in `MysqlAdapter` .Closes #12647.
Conflicts:
	activerecord/CHANGELOG.md
8938e55
Yves Senn senny referenced this issue from a commit
Yves Senn senny fix code typo in `MysqlAdapter` .Closes #12647.
Conflicts:
	activerecord/CHANGELOG.md
5d7e865
Jason R. Clark

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!

Yves Senn
Owner

@jasonrclark thank you for confirming and trying out the RC's :heart:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.