[MySQLdb] Problems with unsigned int's...

Mike Andersen mike at src.no
Thu Aug 24 10:17:42 EDT 2000


Example:

    import MySQLdb
    query = "select * from iphdr"
    db  = MySQLdb.connect(db='snort',user='root',passwd='')
    cur = db.cursor()
    cur.execute(query)
    result = cur.fetchone()
    print "result: ",result

And it returns:

Traceback (innermost last):
  File "./sjekk.py", line 8, in ?
    cur.execute(query)
  File "/usr/lib/python1.5/site-packages/MySQLdb.py", line 194, in execute
    return self._query(query)
  File "/usr/lib/python1.5/site-packages/MySQLdb.py", line 284, in _query
    self._rows = self._result and self._fetch_all_rows() or ()
  File "/usr/lib/python1.5/site-packages/MySQLdb.py", line 374, in _fetch_all_rows
    return _fetchall(self._result, self.arraysize, self._fetch_type)
  File "/usr/lib/python1.5/site-packages/MySQLdb.py", line 150, in _fetchall
    rows = r = list(apply(result.fetch_row, args))
ValueError: int() literal too large: 3560000024

The row is defined as:

        ip_src      INT      UNSIGNED NOT NULL,

in MySQL.


If I change the definition from INT to BIGINT it workes (but I would
prefer not to).

Is this a bug in the module -- or in my thinking? ;-)  And more
important, what do I have to do to make it work?

-- 
A CONS is an object which cares.
                -- Bernie Greenberg.



More information about the Python-list mailing list