You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for the cross post: jruby/activerecord-jdbc-adapter#691
I got this error on: jruby 9.0.4.0 (2.2.2) 2015-11-12 b9fb7aa Java HotSpot(TM) 64-Bit Server VM 25.66-b17 on 1.8.0_66-b17 +indy +jit [darwin-x86_64]
Here is my JRUBY_OPTS: export JRUBY_OPTS="-J-Xmn512m -J-Xms2048m -J-Xmx2048m -J-XX:+UseConcMarkSweepGC -Xcompile.invokedynamic=true"
Here is a pretty isolated testcase you just need to create the "test_ar" database:
beginrequire'bundler/inline'rescueLoadError=>e
$stderr.puts'Bundler version 1.10 or later is required. Please update your Bundler'raiseeendgemfile(true)dosource'https://rubygems.org'# Activate the gem you are reporting the issue against.gem'activerecord','4.2.5'gem'activerecord-jdbcpostgresql-adapter'endrequire'active_record'require'minitest/autorun'require'logger'# Ensure backward compatibility with Minitest 4Minitest::Test=MiniTest::Unit::TestCaseunlessdefined?(Minitest::Test)# This connection will do for database-independent bug reports.ActiveRecord::Base.establish_connection(adapter: 'postgresql',database: 'test_ar')ActiveRecord::Base.logger=Logger.new(STDOUT)ActiveRecord::Schema.definedobegindrop_table:postsdrop_table:commentsdrop_table:usersrescueActiveRecord::StatementInvalidendcreate_table:posts,force: truedo |t|
endcreate_table:comments,force: truedo |t|
t.integer:post_idt.integer:user_idendcreate_table:users,force: truedo |t|
t.string:usernameendendclassPost < ActiveRecord::Basehas_many:commentshas_many:users,through: :commentsendclassComment < ActiveRecord::Basebelongs_to:postbelongs_to:userendclassUser < ActiveRecord::Basehas_many:commentsendclassBugTest < Minitest::Testdeftest_association_stuffpost=Post.create!user=User.create!username: 'cool user'post.comments << Comment.create!(user_id: user.id)post.comments << Comment.create!post.comments << Comment.create!(user_id: user.id)post.comments << Comment.create!post.comments << Comment.create!(user_id: user.id)post.comments << Comment.create!post.comments << Comment.create!(user_id: user.id)post.reload10000.timesdopost.reloadpost.users.order(:username).pluck(:username).mapdo |username|
usernameendendenddefteardownPost.delete_allComment.delete_allUser.delete_allendend
if I run it I get:
Finished in 2.094541s, 0.4774 runs/s, 0.0000 assertions/s.
1) Error:
BugTest#test_association_stuff:
ActiveRecord::StatementInvalid: ArgumentError: wrong number of arguments (1 for 2): SELECT "posts".* FROM "posts" WHERE "posts"."id" = 1 LIMIT 1
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.19/lib/arjdbc/jdbc/adapter.rb:455:in `block in exec_query'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract_adapter.rb:472:in `block in log'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activesupport-4.2.5/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract_adapter.rb:466:in `log'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.19/lib/arjdbc/jdbc/adapter.rb:455:in `exec_query'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-jdbc-adapter-1.3.19/lib/arjdbc/jdbc/adapter.rb:542:in `select'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/database_statements.rb:32:in `select_all'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/query_cache.rb:70:in `select_all'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/querying.rb:39:in `find_by_sql'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/relation.rb:639:in `exec_queries'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/relation.rb:515:in `load'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/relation.rb:243:in `to_a'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/relation/finder_methods.rb:475:in `find_take'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/relation/finder_methods.rb:105:in `take'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/relation/finder_methods.rb:442:in `find_one'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/relation/finder_methods.rb:423:in `find_with_ids'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/relation/finder_methods.rb:71:in `find'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/querying.rb:3:in `find'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/core.rb:131:in `find'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/persistence.rb:416:in `block in reload'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/scoping/default.rb:33:in `block in unscoped'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/relation.rb:302:in `scoping'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/scoping/default.rb:33:in `unscoped'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/persistence.rb:416:in `reload'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/attribute_methods/dirty.rb:36:in `reload'
/usr/local/var/rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/activerecord-4.2.5/lib/active_record/autosave_association.rb:227:in `reload'
test_has_many.rb:80:in `block in test_association_stuff'
org/jruby/RubyFixnum.java:301:in `times'
test_has_many.rb:79:in `test_association_stuff'
I'm thinking it's either jRuby invokedynamic that is wrong or it's activerecord-jdbc that doesn't work with invokedynamic.
The text was updated successfully, but these errors were encountered:
do we fix this at JRuby's (obviously dispatch does not match with native overloads when using indy) ?
... or shall we hack around at AR-JDBC's - no one else seems to have hit the issue thus far ?
// cc @enebo@headius
Sorry for the cross post: jruby/activerecord-jdbc-adapter#691
I got this error on:
jruby 9.0.4.0 (2.2.2) 2015-11-12 b9fb7aa Java HotSpot(TM) 64-Bit Server VM 25.66-b17 on 1.8.0_66-b17 +indy +jit [darwin-x86_64]
Here is my JRUBY_OPTS:
export JRUBY_OPTS="-J-Xmn512m -J-Xms2048m -J-Xmx2048m -J-XX:+UseConcMarkSweepGC -Xcompile.invokedynamic=true"
Here is a pretty isolated testcase you just need to create the "test_ar" database:
if I run it I get:
I'm thinking it's either jRuby invokedynamic that is wrong or it's activerecord-jdbc that doesn't work with invokedynamic.
The text was updated successfully, but these errors were encountered: