This property is used to toggle whether warnings should be
fetched automatically. It accepts True or
False (default).
Fetching warnings automatically could be useful when debugging queries. Cursors make warnings available through the method MySQLCursor.fetchwarnings().
>>> cnx.get_warnings = True
>>> cursor.execute('SELECT "a"+1')
>>> cursor.fetchall()
[(1.0,)]
>>> cursor.fetchwarnings()
[(u'Warning', 1292, u"Truncated incorrect DOUBLE value: 'a'")]
Returns True or False.

User Comments
Add your own comment.