{"action":"created","issue":{"url":"https://api.github.com/repos/jeremyevans/sequel/issues/1059","labels_url":"https://api.github.com/repos/jeremyevans/sequel/issues/1059/labels{/name}","comments_url":"https://api.github.com/repos/jeremyevans/sequel/issues/1059/comments","events_url":"https://api.github.com/repos/jeremyevans/sequel/issues/1059/events","html_url":"https://github.com/jeremyevans/sequel/issues/1059","id":99253674,"number":1059,"title":"Weird results on query","user":{"login":"fotanus","id":215018,"avatar_url":"https://avatars.githubusercontent.com/u/215018?v=3","gravatar_id":"","url":"https://api.github.com/users/fotanus","html_url":"https://github.com/fotanus","followers_url":"https://api.github.com/users/fotanus/followers","following_url":"https://api.github.com/users/fotanus/following{/other_user}","gists_url":"https://api.github.com/users/fotanus/gists{/gist_id}","starred_url":"https://api.github.com/users/fotanus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fotanus/subscriptions","organizations_url":"https://api.github.com/users/fotanus/orgs","repos_url":"https://api.github.com/users/fotanus/repos","events_url":"https://api.github.com/users/fotanus/events{/privacy}","received_events_url":"https://api.github.com/users/fotanus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-05T17:12:02Z","updated_at":"2015-08-05T17:28:42Z","closed_at":"2015-08-05T17:28:42Z","body":"Hi there,\r\n\r\nI'm having some really weird results when doing some queries. Here is some lines:\r\n\r\n```\r\n> require 'sequel'\r\n> conn = Sequel.connect 'postgres://localhost/bundler-api'\r\n> conn[:versions].join(:rubygems, id: :rubygem_id).where(name: '12_hour_time').count\r\n=> 0\r\n > conn[\"select count(*) from versions as v, rubygems as r where v.rubygem_id = r.id and r.name = '12_hour_time';\"].to_a.count\r\n => 26852944 \r\n```\r\n\r\nAnd this is what I got from psql:\r\n\r\n```\r\n$ psql bundler-api\r\nbundler-api=# select count(*) from versions as v, rubygems as r where v.rubygem_id = r.id and r.name = '12_hour_time';\r\n count \r\n-------\r\n     3\r\n(1 row)\r\n```\r\n\r\nI'm using this gems:\r\n```\r\n$ gem list | grep sequel\r\nsequel (4.3.0)\r\nsequel_pg (1.6.8)\r\n```\r\n\r\nDo you have any idea on what is going wrong here? I'll start to check the sequel code now to see if I can find something."},"comment":{"url":"https://api.github.com/repos/jeremyevans/sequel/issues/comments/128084163","html_url":"https://github.com/jeremyevans/sequel/issues/1059#issuecomment-128084163","issue_url":"https://api.github.com/repos/jeremyevans/sequel/issues/1059","id":128084163,"user":{"login":"fotanus","id":215018,"avatar_url":"https://avatars.githubusercontent.com/u/215018?v=3","gravatar_id":"","url":"https://api.github.com/users/fotanus","html_url":"https://github.com/fotanus","followers_url":"https://api.github.com/users/fotanus/followers","following_url":"https://api.github.com/users/fotanus/following{/other_user}","gists_url":"https://api.github.com/users/fotanus/gists{/gist_id}","starred_url":"https://api.github.com/users/fotanus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fotanus/subscriptions","organizations_url":"https://api.github.com/users/fotanus/orgs","repos_url":"https://api.github.com/users/fotanus/repos","events_url":"https://api.github.com/users/fotanus/events{/privacy}","received_events_url":"https://api.github.com/users/fotanus/received_events","type":"User","site_admin":false},"created_at":"2015-08-05T17:28:42Z","updated_at":"2015-08-05T17:28:42Z","body":"Upgrading sequel_pg to 1.6.13 actually solve the issue, thanks!"}}