This method returns a list of tuples containing warnings
generated by previously executed statement. Use the connection's
get_warnings property to set whether warnings
are to be fetched.
The following example shows a
SELECT statement which generated
a warning:
>>> cnx.get_warnings = True
>>> cursor.execute('SELECT "a"+1')
>>> cursor.fetchall()
[(1.0,)]
>>> cursor.fetchwarnings()
[(u'Warning', 1292, u"Truncated incorrect DOUBLE value: 'a'")]
It is also possible to raise errors when warnings are found. See
the MySQLConnection
raise_on_warnings
property.

User Comments
Add your own comment.