]> 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 10:05:13 +0000 (12:05 +0200)
See #343

tests/test_cursor.py
tests/test_cursor_async.py

index acd79c08bfff0d6f36cf9c776b5e922e08a89cd9..24907051c8749da269afec50282407668dc43ef5 100644 (file)
@@ -339,6 +339,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 2bd029c0134c56c95fabd25a4d63bd10198fc552..db4faeb2d81c0abf42218cc497b4798731d6f516 100644 (file)
@@ -329,6 +329,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