{"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,"milestone":null,"comments":1,"created_at":"2016-04-28T18:38:00Z","updated_at":"2016-04-29T07:03:03Z","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/215642960","html_url":"https://github.com/ibmdb/ruby-ibmdb/issues/58#issuecomment-215642960","issue_url":"https://api.github.com/repos/ibmdb/ruby-ibmdb/issues/58","id":215642960,"user":{"login":"arvindgu","id":10601295,"avatar_url":"https://avatars.githubusercontent.com/u/10601295?v=3","gravatar_id":"","url":"https://api.github.com/users/arvindgu","html_url":"https://github.com/arvindgu","followers_url":"https://api.github.com/users/arvindgu/followers","following_url":"https://api.github.com/users/arvindgu/following{/other_user}","gists_url":"https://api.github.com/users/arvindgu/gists{/gist_id}","starred_url":"https://api.github.com/users/arvindgu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arvindgu/subscriptions","organizations_url":"https://api.github.com/users/arvindgu/orgs","repos_url":"https://api.github.com/users/arvindgu/repos","events_url":"https://api.github.com/users/arvindgu/events{/privacy}","received_events_url":"https://api.github.com/users/arvindgu/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T07:03:03Z","updated_at":"2016-04-29T07:03:03Z","body":"I could not reproduce this problem. I have listed my reproduction steps below. Please provide me exact reproduction steps so that I can further investigate on it. \r\n\r\nrails generate scaffold Car name:string reg_num:integer year:integer features:string\r\n\r\nI have run below steps using rails console.\r\n\r\ncar= Car.new\r\ncar.name='Skoda'\r\ncar.reg_num=1111\r\ncar.year=2014\r\ncar.features='Semi-Luxury'\r\ncar.save\r\n\r\ncar= Car.new\r\ncar.name='volkswagen'\r\ncar.reg_num=2222\r\ncar.year=2012\r\ncar.features='Luxury'\r\ncar.save\r\n\r\nCar.where(\"reg_num=? and year=?\", 2222, 2012)    #==> SELECT cars.* FROM cars WHERE (reg_num=2222 and year=2012) # OK\r\nCar.where(\"name=? and features =?\",'Skoda', 'Semi-Luxury')  #==>   SELECT cars.* FROM cars WHERE (name='Skoda'and features ='Semi-Luxury') # OK\r\nCar.where(\"name=? And reg_num=?\", 'Skoda', 1111)  #==>     SELECT cars.* FROM cars WHERE (name='Skoda' And reg_num=1111) # OK"}}