KeyError exception while trying to execute sql query

Bug #121300 reported by dervish
4
Affects Status Importance Assigned to Milestone
python-mysqldb (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: python-mysqldb

I have encountered a serious problem with the 64bit version of python-mysqldb coming with feisty (version 1.2.1).
I cannot execute even a simple SQL query (using pyformat placeholders).

import MySQLdb
>>> MySQLdb.__version__
'1.2.1_p2'
>>> c = MySQLdb.connect("localhost", "root", "", "mydatabase")
>>> c.cursor().execute("SELECT * FROM table_name WHERE table_name.id = %(id)s", {'id':1})

This results in a python execption:
Exceptions.KeyError: 'id'

The same code works on the 32bit version and on other 64bit linux distros with the same version of python-mysqldb. It seems also to be already fixed in the gutsy package, which provides version 1.2.2.

Revision history for this message
xteejx (xteejx) wrote :

Thank you for reporting this bug to Ubuntu. Unfortunately, Feisty reached EOL in October 2008.
Please see this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases
If this bug persists in Jaunty, please reopen this bug by setting the status back to New.
Please feel free to report any other bugs you may find.

Changed in python-mysqldb (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.