Comment 4 for bug 812970

Revision history for this message
Geert JM Vanderkelen (geertjmvdk) wrote :

Something seems indeed not quite right. The following code mightn show some issues, but I'm not sure if this is the same as discussed in this bug.

import time
import mysql.connector

def bug812970():
    print('Script starts. Waiting 5 secs..')
    time.sleep(5)
    cnx = mysql.connector.connect(user='root',database='test',buffered=False)

    i = 0
    while i < 100:
        cur = cnx.cursor()
        cur.execute("SELECT REPEAT('a',5000000)")
        rows = cur.fetchall()
        cur.close()
        i += 1
    rows = None

    print('Cursor execution done. Waiting 10 secs..')
    time.sleep(10)
    cnx.close()
    print('Connection closed. Waiting 10 secs..')
    time.sleep(10)