Windows Vista Home Basic Ru + sp2
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on win32
MySQLdb svn rev 633 (self build from mingw32 gcc 4.4.0)
Sample code to reproduce:
from MySQLdb import connect
conn = connect(...)
curs = conn.cursor()
curs.execute('drop table if exists notExistTable')
Console session:
F:\Lang\sf.net\svn\MySQLdb>warning_test.py
Traceback (most recent call last):
File "F:\Lang\sf.net\svn\MySQLdb\warning_test.py", line 5, in <module>
curs.execute('drop table if exists notExistTable')
File "F:\Lang\sf.net\svn\MySQLdb\MySQLdb\cursors.py", line 184, in execute
self._warning_check()
File "F:\Lang\sf.net\svn\MySQLdb\MySQLdb\cursors.py", line 90, in _warning_check
warnings = self._get_db()._show_warnings()
AttributeError: _show_warnings
Simple correct line
warnings = self._get_db()._show_warnings()
to
warnings = self.connection._show_warnings()
Please include the version you're using. I think you're using the trunk version. If so, this is a duplicate of bug 2796727 and has already been fixed (though in a slightly different way).
http://mysql-python.svn.sourceforge.net/viewvc/mysql-python/trunk/MySQLdb/MySQLdb/cursors.py?revision=633&view=markup
I write version for start messages: MySQLdb svn rev 633
svn info:
URL: https://mysql-python.svn.sourceforge.net/svnroot/mysql-python/trunk/MySQLdb
Repository Root: https://mysql-python.svn.sourceforge.net/svnroot/mysql-python
Repository UUID: 9fc6cd9a-920d-0410-adcf-ac96716ed7e8
Revision: 633
Node Kind: directory
Schedule: normal
Last Changed Author: kylev
Last Changed Rev: 633
Last Changed Date: 2009-07-24 07:35:20 +0700 (Пт, 24 июл 2009)
In rev 633 You add underscore to function name :_show_warnings
But object returned _get_db() do not has _show_warnings.
_show_warnings has connection.
Your patch will not be applied.