{"action":"created","issue":{"url":"https://api.github.com/repos/ibmdb/ruby-ibmdb/issues/58","repository_url":"https://api.github.com/repos/ibmdb/ruby-ibmdb","labels_url":"https://api.github.com/repos/ibmdb/ruby-ibmdb/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/ibmdb/ruby-ibmdb/issues/58/comments","events_url":"https://api.github.com/repos/ibmdb/ruby-ibmdb/issues/58/events","html_url":"https://github.com/ibmdb/ruby-ibmdb/issues/58","id":151713488,"number":58,"title":"Selects not getting fully prepared","user":{"login":"paulharv","id":3089774,"avatar_url":"https://avatars.githubusercontent.com/u/3089774?v=3","gravatar_id":"","url":"https://api.github.com/users/paulharv","html_url":"https://github.com/paulharv","followers_url":"https://api.github.com/users/paulharv/followers","following_url":"https://api.github.com/users/paulharv/following{/other_user}","gists_url":"https://api.github.com/users/paulharv/gists{/gist_id}","starred_url":"https://api.github.com/users/paulharv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulharv/subscriptions","organizations_url":"https://api.github.com/users/paulharv/orgs","repos_url":"https://api.github.com/users/paulharv/repos","events_url":"https://api.github.com/users/paulharv/events{/privacy}","received_events_url":"https://api.github.com/users/paulharv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-04-28T18:38:00Z","updated_at":"2016-07-19T03:05:43Z","closed_at":null,"body":"We are using versions 2.6.1 and 3.0.1 and in both cases we are observing that select statements do not get fully prepared if the datatypes in a call to `Model.where` are mixed.\r\n\r\nFor example… \r\nThese all produce fully prepared statements...\r\n```\r\nModel.where(“column1=? And column2=?”, 10, 20) \t\t# ==> select * from model_table where column1=? And column2=? \t# OK\r\nModel.where(“column1=? And column2=?”, \"Red\", \"Blue\")   # ==> select * from model_table where column1=? And column2=? \t# OK!\r\nModel.where(“column1=? And column2=?”, \"Red\", \"20\")   # ==> select * from model_table where column1=? And column2=? \t# OK!\r\n```\r\nBut this, which has mixed datatypes in the parameter array, does not...\r\n```\r\nModel.where(“column1=? And column2=?”, \"Red\", 20) \t# ==> select * from model_table where column1=? And column2=20 \t# BAD!\r\n```\r\n\r\nWe're seeing this have significant impact on performance so would love to see it addressed!\r\n\r\nThanks very much,\r\n\r\nPaul"},"comment":{"url":"https://api.github.com/repos/ibmdb/ruby-ibmdb/issues/comments/233518259","html_url":"https://github.com/ibmdb/ruby-ibmdb/issues/58#issuecomment-233518259","issue_url":"https://api.github.com/repos/ibmdb/ruby-ibmdb/issues/58","id":233518259,"user":{"login":"mcdonalduid","id":9395327,"avatar_url":"https://avatars.githubusercontent.com/u/9395327?v=3","gravatar_id":"","url":"https://api.github.com/users/mcdonalduid","html_url":"https://github.com/mcdonalduid","followers_url":"https://api.github.com/users/mcdonalduid/followers","following_url":"https://api.github.com/users/mcdonalduid/following{/other_user}","gists_url":"https://api.github.com/users/mcdonalduid/gists{/gist_id}","starred_url":"https://api.github.com/users/mcdonalduid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcdonalduid/subscriptions","organizations_url":"https://api.github.com/users/mcdonalduid/orgs","repos_url":"https://api.github.com/users/mcdonalduid/repos","events_url":"https://api.github.com/users/mcdonalduid/events{/privacy}","received_events_url":"https://api.github.com/users/mcdonalduid/received_events","type":"User","site_admin":false},"created_at":"2016-07-19T03:05:43Z","updated_at":"2016-07-19T03:05:43Z","body":"How would I do the following?\r\n\r\nCar.find_by(\"reg_num=? and year!=?\", 1111, 2013,)\r\n2.1.8 :129 > Car.find_by(:reg_num => 1111, :year!=2014)\r\nSyntaxError: (irb):129: syntax error, unexpected ')', expecting =>\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/railties-4.2.6/lib/rails/commands/console.rb:110:in `start'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/railties-4.2.6/lib/rails/commands/console.rb:9:in `start'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:68:in `console'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'\r\n\tfrom /home/rmcdonal/Projects/spotlight/bin/rails:9:in `<top (required)>'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `block in load'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/commands/rails.rb:6:in `call'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/command_wrapper.rb:38:in `call'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/application.rb:191:in `block in serve'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/application.rb:161:in `fork'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/application.rb:161:in `serve'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/application.rb:131:in `block in run'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/application.rb:125:in `loop'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/application.rb:125:in `run'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/application/boot.rb:19:in `<top (required)>'\r\n\tfrom /usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'\r\n\tfrom /usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'\r\n\tfrom -e:1:in `<main>'2.1.8 :130 > Car.find_by(:reg_num => 1111, :year<>2014)\r\nSyntaxError: (irb):130: syntax error, unexpected '>'\r\nCar.find_by(:reg_num => 1111, :year<>2014)\r\n                                     ^\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/railties-4.2.6/lib/rails/commands/console.rb:110:in `start'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/railties-4.2.6/lib/rails/commands/console.rb:9:in `start'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:68:in `console'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'\r\n\tfrom /home/rmcdonal/Projects/spotlight/bin/rails:9:in `<top (required)>'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `block in load'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/commands/rails.rb:6:in `call'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/command_wrapper.rb:38:in `call'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/application.rb:191:in `block in serve'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/application.rb:161:in `fork'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/application.rb:161:in `serve'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/application.rb:131:in `block in run'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/application.rb:125:in `loop'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/application.rb:125:in `run'\r\n\tfrom /usr/local/rvm/gems/ruby-2.1.8/gems/spring-1.7.1/lib/spring/application/boot.rb:19:in `<top (required)>'\r\n\tfrom /usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'\r\n\tfrom /usr/local/rvm/rubies/ruby-2.1.8/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'\r\n\tfrom -e:1:in `<main>'2.1.8 :131 > \r\n"}}
{"actor":{"display_login":"mcdonalduid"}}