﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18592	"Provide failure recovery for undocumented ""_last_executed"" in MySQLdb's cursor"	reames@…	nobody	"A little bit of context: I'm trying to run django 1.4 on Google AppEngine using CloudSQL, vanilla django 1.4 (and pytz) are in my project directory.

So, in theory, I should be able to use django unmodified. Not the case I've found. I was getting a traceback when doing syncdb to ""last_executed_query"" in the mysql backend.

My workaround, or fix as it may be, is to change around line 238 in db/backends/mysql/base.py
from
{{{
#!python
    def last_executed_query(self, cursor, sql, params):
        # With MySQLdb, cursor objects have an (undocumented) ""_last_executed""
        # attribute where the exact query sent to the database is saved.
        # See MySQLdb/cursors.py in the source distribution.
        return cursor._last_executed
}}}
to
{{{
#!python
    def last_executed_query(self, cursor, sql, params):
        # With MySQLdb, cursor objects have an (undocumented) ""_last_executed""
        # attribute where the exact query sent to the database is saved.
        # See MySQLdb/cursors.py in the source distribution.
        return getattr(cursor, '_last_executed', None)
}}}"	Cleanup/optimization	closed	Database layer (models, ORM)	1.4	Release blocker	fixed			Accepted	1	0	0	0	0	0
