{"action":"created","issue":{"url":"https://api.github.com/repos/mkleehammer/pyodbc/issues/51","labels_url":"https://api.github.com/repos/mkleehammer/pyodbc/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/mkleehammer/pyodbc/issues/51/comments","events_url":"https://api.github.com/repos/mkleehammer/pyodbc/issues/51/events","html_url":"https://github.com/mkleehammer/pyodbc/issues/51","id":85311733,"number":51,"title":"Teradata 64-Bit ODBC Long/Int Cast Issues","user":{"login":"lycovian","id":360023,"avatar_url":"https://avatars.githubusercontent.com/u/360023?v=3","gravatar_id":"","url":"https://api.github.com/users/lycovian","html_url":"https://github.com/lycovian","followers_url":"https://api.github.com/users/lycovian/followers","following_url":"https://api.github.com/users/lycovian/following{/other_user}","gists_url":"https://api.github.com/users/lycovian/gists{/gist_id}","starred_url":"https://api.github.com/users/lycovian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lycovian/subscriptions","organizations_url":"https://api.github.com/users/lycovian/orgs","repos_url":"https://api.github.com/users/lycovian/repos","events_url":"https://api.github.com/users/lycovian/events{/privacy}","received_events_url":"https://api.github.com/users/lycovian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-04T22:46:52Z","updated_at":"2016-01-28T06:25:03Z","closed_at":null,"body":"With Teradata 14.00 64-bit ODBC using unixODBC (Linux 12.04) running pyodbc (3.11b8) integer values are incorrectly represented:\r\n\r\n    In [16]: cur.execute(\"select 1\").fetchall()\r\n    Out[16]: [(140376711102465, )]\r\n\r\n    In [17]: cur.execute(\"select cast(1 as int)\").fetchall()\r\n    Out[17]: [(140376711102465, )]\r\n\r\nIn order to work I need to cast the values manually to bigint:\r\n\r\n    In [18]: cur.execute(\"select cast(1 as bigint)\").fetchall()\r\n    Out[18]: [(1L, )]\r\n\r\nVerified this issue also exists in `pyodbc` 3.0.7 as well.\r\n\r\nPer Teradata's docs a integer type is signed 4-byte (-2.147B - 2.147B) number.  The value returned by `pyodbc` appears to far larger than that though.\r\n\r\nProblem appears similar to: https://github.com/mkleehammer/pyodbc/issues/42\r\n"},"comment":{"url":"https://api.github.com/repos/mkleehammer/pyodbc/issues/comments/176009257","html_url":"https://github.com/mkleehammer/pyodbc/issues/51#issuecomment-176009257","issue_url":"https://api.github.com/repos/mkleehammer/pyodbc/issues/51","id":176009257,"user":{"login":"yinhao","id":2814486,"avatar_url":"https://avatars.githubusercontent.com/u/2814486?v=3","gravatar_id":"","url":"https://api.github.com/users/yinhao","html_url":"https://github.com/yinhao","followers_url":"https://api.github.com/users/yinhao/followers","following_url":"https://api.github.com/users/yinhao/following{/other_user}","gists_url":"https://api.github.com/users/yinhao/gists{/gist_id}","starred_url":"https://api.github.com/users/yinhao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yinhao/subscriptions","organizations_url":"https://api.github.com/users/yinhao/orgs","repos_url":"https://api.github.com/users/yinhao/repos","events_url":"https://api.github.com/users/yinhao/events{/privacy}","received_events_url":"https://api.github.com/users/yinhao/received_events","type":"User","site_admin":false},"created_at":"2016-01-28T06:25:03Z","updated_at":"2016-01-28T06:25:03Z","body":"Hi Lycovian,\r\n\r\nHave you ever solved this problem?\r\n\r\n"}}