large integer handling, as used in LIMIT for unlimited size, fails in 3.1 as a bind param
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oursql |
New
|
Undecided
|
Unassigned |
Bug Description
MySQL's documented syntax for selecting with an OFFSET and unlimited LIMIT is to specify the large number 184467440737095
http://
To retrieve all rows from a certain offset up to the end of the result set, you can use some large number for the second parameter.
This statement retrieves all rows from the 96th row to the last:
SELECT * FROM tbl LIMIT 95,184467440737
The following script fails in Python 3.1, OurSQL 0.9.2:
import oursql
conn = oursql.
cursor = conn.cursor()
try:
except:
pass
cursor.
create table test(
id integer primary key
)
""")
cursor.
print("hi")
cursor.
hiTraceback (most recent call last):
File "test.py", line 18, in <module>
print("hi")
OverflowError: Python int too large to convert to C long
the "print("hi")" is important (in that there is some kind of method call before the fetchall()), as it triggers a particular oddness I've seen when Python has problems with native libraries. You'll notice it actually prints the "hi", then fails before getting to the fetchall().
The script works if the number is passed as a string. The script works as is in Python 2.x.
Looking into this. I need to rebuild python 3.1 with debugging flags to be able to step through it.