warnings

Overview

Returns the number of warnings from the last executed statement, or zero. (read only)

See also: MariaDB Connector/Python 1.1 and in 1.0

EXAMPLES

import mariadb

conn = mariadb.connect(
    host = 'localhost',
    user = 'root',
    password = 'secret',
    database = 'test',
    )

# The connection class supports warnings:
print(conn.warnings) # Prints an integer count

cursor = conn.cursor()

cursor.execute("SELECT * FROM sample")
lst = cursor.fetchall()

# The cursor class also supports warnings:
print(cursor.warnings) # Prints an integer count

CHANGE HISTORY

Release Series

History

1.1

  • Present starting in MariaDB Connector/Python 1.1.0rc1.

1.0

  • Present starting in MariaDB Connector/Python 1.0.0.