]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
test: add tests to reveal the rowcount problem with SHOW
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 28 Jul 2022 09:26:49 +0000 (11:26 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Thu, 28 Jul 2022 09:37:27 +0000 (11:37 +0200)
See #343

tests/test_cursor.py
tests/test_cursor_async.py

index 797a539fa3848a62afc05fe89e6cfdd3bf42b1b6..75af433cbe9ad9191a796e1685b140970c0bdf6b 100644 (file)
@@ -393,6 +393,9 @@ def test_rowcount(conn):
     cur.execute("select 1 from generate_series(1, 42)")
     assert cur.rowcount == 42
 
+    cur.execute("show timezone")
+    assert cur.rowcount == 1
+
     cur.execute("create table test_rowcount_notuples (id int primary key)")
     assert cur.rowcount == -1
 
index 0af43daca90969d261a9bd5f042cb44fb1de248f..741eba3d96cf5a911c7605a664ba081b9dfb034c 100644 (file)
@@ -383,6 +383,9 @@ async def test_rowcount(aconn):
     await cur.execute("select 1 from generate_series(1, 42)")
     assert cur.rowcount == 42
 
+    await cur.execute("show timezone")
+    assert cur.rowcount == 1
+
     await cur.execute("create table test_rowcount_notuples (id int primary key)")
     assert cur.rowcount == -1