From: Daniele Varrazzo Date: Tue, 18 Mar 2025 14:46:35 +0000 (+0100) Subject: test(crdb): add test reproducing failure with prepared create statement X-Git-Tag: 3.2.7~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04630ebbf751e7ca5641328ede2739104aec5d4d;p=thirdparty%2Fpsycopg.git test(crdb): add test reproducing failure with prepared create statement See #1009 --- diff --git a/tests/crdb/test_connection.py b/tests/crdb/test_connection.py index b935e8530..054246504 100644 --- a/tests/crdb/test_connection.py +++ b/tests/crdb/test_connection.py @@ -91,3 +91,15 @@ def test_identify_closure(conn_cls, dsn): assert 0.2 < dt < 2 finally: gather(t) + + +@pytest.mark.crdb("> 24.0", reason="autocommit_before_ddl not available") +def test_unknown_portal(conn): + # See #1009. The test fails with CRDB v25.1.2 with autocommit before DDL enabled. + conn.execute("set autocommit_before_ddl=on") + conn.commit() + for i in range(10): + conn.execute("drop table if exists integer_table") + conn.execute( + "create table integer_table (id serial primary key, integer_data bigint)" + ) diff --git a/tests/crdb/test_connection_async.py b/tests/crdb/test_connection_async.py index f965ccc5b..a194a0a24 100644 --- a/tests/crdb/test_connection_async.py +++ b/tests/crdb/test_connection_async.py @@ -91,3 +91,15 @@ async def test_identify_closure(aconn_cls, dsn): assert 0.2 < dt < 2 finally: await gather(t) + + +@pytest.mark.crdb("> 24.0", reason="autocommit_before_ddl not available") +async def test_unknown_portal(aconn): + # See #1009. The test fails with CRDB v25.1.2 with autocommit before DDL enabled. + await aconn.execute("set autocommit_before_ddl=on") + await aconn.commit() + for i in range(10): + await aconn.execute("drop table if exists integer_table") + await aconn.execute( + "create table integer_table (id serial primary key, integer_data bigint)" + )