This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Sqlite Integer Fields
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, brian.curtin, goatsofmendez, loewis, petri.lehtinen, pitrou, tim.golden
Priority: release blocker Keywords:

Created on 2012-03-26 11:00 by goatsofmendez, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
sqltest.py goatsofmendez, 2012-03-26 11:00
Messages (12)
msg156809 - (view) Author: Mendez (goatsofmendez) Date: 2012-03-26 11:00
There appears to be a problem with the handling of integer fields in SQLite in the 32-bit release candidate for 2.7.3.

I'm running the 64-bit version of Windows 7.

I've attached a script which reproduces the issue. The following are the results I get with different versions of Python, with the later two being as expected.

Python - 2.7.3 rc2 - 32-bit:
R:\>c:\python27\python "C:\Temp\sqltest.py"
530428456761032704 <type 'long'>

Python - 2.7.2 - 32-bit:
R:\>c:\python27\python "C:\Temp\sqltest.py"
123499999 <type 'int'>

Python - 2.7.2 rc2 - 64-bit:
R:\>c:\python27_64\python c:\temp\sqltest.py
123499999 <type 'int'>

I wonder if this might be related to the changes in #8033.
msg156812 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-03-26 11:40
Can't reproduce under Linux. Can someone test under Windows?
msg156817 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-03-26 12:10
Can't reproduce on a 2.7 debug build under Windows either.
Some data points:

>>> hex(530428456761032704)
'0x75c75df00000000'
>>> hex(123499999)
'0x75c75df'

Looking at #8033, it seems unlikely to have caused this problem.
Perhaps we shipped the 2.7.3 rc with a buggy SQLite build?

Can you (or someone else) check the 2.6, 3.1 and 3.2 release candidates as well?
msg156818 - (view) Author: Mendez (goatsofmendez) Date: 2012-03-26 12:43
I've tried the 32-bit version of 3.2.3rc2 and that works as expected.

There don't seem to be Windows builds of 2.6 and 3.1 available so I haven't been able to try those.
msg156929 - (view) Author: Mendez (goatsofmendez) Date: 2012-03-27 14:29
I've done some more checking

2.7.3rc1 32-bit works as expected.

If I replace

sqlite3.dll
_sqlite3.lib

in rc2 32-bit with those from rc1 then that fixes the problem.
msg156940 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-03-27 16:27
I can't reproduce that. Your test script, with the released 2.7.3rc2, on Windows 7, gives 

123499999 <type 'int'>

for me, as it should.
msg156959 - (view) Author: Mendez (goatsofmendez) Date: 2012-03-28 00:39
Is that with the 32-bit Python on a 64-bit copy of Windows?

I've tried it on a different machine, again running Windows 7 64-bit and I'm getting the same incorrect results.
msg156972 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-03-28 05:52
> Is that with the 32-bit Python on a 64-bit copy of Windows?

No, it was the 64-bit version.
msg157671 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2012-04-06 16:54
What steps can we take to further debug/address this?
msg157904 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2012-04-09 21:20
Given the lack of progress here, I will be releasing 2.7.3.
msg158122 - (view) Author: Mendez (goatsofmendez) Date: 2012-04-12 11:50
I've tested the released 2.7.3 and this works fine so there must just have been some oddity with the packaging of sqlite in rc2.
msg158123 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2012-04-12 12:07
Great!
History
Date User Action Args
2022-04-11 14:57:28adminsetgithub: 58620
2012-04-12 12:07:36benjamin.petersonsetstatus: open -> closed
resolution: out of date
messages: + msg158123
2012-04-12 11:50:55goatsofmendezsetmessages: + msg158122
2012-04-09 21:20:18benjamin.petersonsetmessages: + msg157904
2012-04-06 16:54:39benjamin.petersonsetmessages: + msg157671
2012-03-28 05:52:18loewissetmessages: + msg156972
2012-03-28 00:39:47goatsofmendezsetmessages: + msg156959
2012-03-27 16:27:22loewissetmessages: + msg156940
2012-03-27 14:29:52goatsofmendezsetmessages: + msg156929
2012-03-26 12:43:45goatsofmendezsetmessages: + msg156818
2012-03-26 12:10:44pitrousetnosy: + loewis, petri.lehtinen
messages: + msg156817
2012-03-26 11:40:14pitrousetpriority: normal -> release blocker

nosy: + tim.golden, brian.curtin, pitrou, benjamin.peterson
messages: + msg156812

components: + Library (Lib)
2012-03-26 11:00:01goatsofmendezcreate