Skip to content

Commit

Permalink
MySQL test fix: use server side cursor for select only
Browse files Browse the repository at this point in the history
  • Loading branch information
9EOR9 committed Nov 22, 2020
1 parent fab2a6d commit 1ae8afb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion testing/test/integration/test_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,13 +789,14 @@ def test_conpy42(self):

def test_conpy35(self):
con= create_connection()
cursor = con.cursor(cursor_type=CURSOR.READ_ONLY)
cursor = con.cursor()
cursor.execute("CREATE TEMPORARY table sample (id BIGINT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(64))");

for name in ('foo', 'bar', 'baz'):
cursor.execute("INSERT INTO sample SET name = ?", (name,))
self.assertEqual(cursor.lastrowid, 3)

cursor = con.cursor(cursor_type=CURSOR.READ_ONLY)
cursor.execute("SELECT * FROM sample ORDER BY id")
i= 0
for row in cursor:
Expand Down

0 comments on commit 1ae8afb

Please sign in to comment.