user/postgresql: (aarch64) FTTFS: +ERROR: could not compile PL/Python function "transaction_test4" / +DETAIL: SystemError: unknown opcode
Found on aarch64:
...
Trying to find all regression.diffs files in build directory...
=== test failure: src/pl/plpython/regression.diffs ===
diff -U3 /usr/src/packages/user/postgresql/src/postgresql-14.3/src/pl/plpython/expected/python3/plpython_transaction.out /usr/src/packages/user/postgresql/src/postgresql-14.3/src/pl/plpython/results/python3/plpython_transaction.out
--- /usr/src/packages/user/postgresql/src/postgresql-14.3/src/pl/plpython/expected/python3/plpython_transaction.out 2022-12-01 13:38:12.428855310 +0000
+++ /usr/src/packages/user/postgresql/src/postgresql-14.3/src/pl/plpython/results/python3/plpython_transaction.out 2022-12-01 13:38:19.612584531 +0000
@@ -69,12 +69,14 @@
plpy.execute("CALL transaction_test1()")
return 1
$$;
-SELECT transaction_test3();
-ERROR: spiexceptions.InvalidTransactionTermination: invalid transaction termination
+ERROR: could not compile PL/Python function "transaction_test3"
+DETAIL: SystemError: unknown opcode
CONTEXT: Traceback (most recent call last):
- PL/Python function "transaction_test3", line 2, in <module>
- plpy.execute("CALL transaction_test1()")
-PL/Python function "transaction_test3"
+SELECT transaction_test3();
+ERROR: function transaction_test3() does not exist
+LINE 1: SELECT transaction_test3();
+ ^
+HINT: No function matches the given name and argument types. You might need to add explicit type casts.
SELECT * FROM test1;
a | b
---+---
@@ -87,109 +89,21 @@
plpy.execute("DO LANGUAGE plpython3u $x$ plpy.commit() $x$")
return 1
$$;
-SELECT transaction_test4();
-ERROR: spiexceptions.InvalidTransactionTermination: invalid transaction termination
+ERROR: could not compile PL/Python function "transaction_test4"
+DETAIL: SystemError: unknown opcode
CONTEXT: Traceback (most recent call last):
- PL/Python function "transaction_test4", line 2, in <module>
- plpy.execute("DO LANGUAGE plpython3u $x$ plpy.commit() $x$")
-PL/Python function "transaction_test4"
+SELECT transaction_test4();
+ERROR: function transaction_test4() does not exist
+LINE 1: SELECT transaction_test4();
+ ^
+HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-- commit inside subtransaction (prohibited)
DO LANGUAGE plpython3u $$
s = plpy.subtransaction()
s.enter()
plpy.commit()
$$;
-WARNING: forcibly aborting a subtransaction that has not been exited
-ERROR: cannot commit while a subtransaction is active
-CONTEXT: PL/Python anonymous code block
--- commit inside cursor loop
-CREATE TABLE test2 (x int);
-INSERT INTO test2 VALUES (0), (1), (2), (3), (4);
-TRUNCATE test1;
-DO LANGUAGE plpython3u $$
-for row in plpy.cursor("SELECT * FROM test2 ORDER BY x"):
- plpy.execute("INSERT INTO test1 (a) VALUES (%s)" % row['x'])
- plpy.commit()
-$$;
-SELECT * FROM test1;
- a | b
----+---
- 0 |
- 1 |
- 2 |
- 3 |
- 4 |
-(5 rows)
-
--- check that this doesn't leak a holdable portal
-SELECT * FROM pg_cursors;
- name | statement | is_holdable | is_binary | is_scrollable | creation_time
-------+-----------+-------------+-----------+---------------+---------------
-(0 rows)
-
--- error in cursor loop with commit
-TRUNCATE test1;
-DO LANGUAGE plpython3u $$
-for row in plpy.cursor("SELECT * FROM test2 ORDER BY x"):
- plpy.execute("INSERT INTO test1 (a) VALUES (12/(%s-2))" % row['x'])
- plpy.commit()
-$$;
-ERROR: spiexceptions.DivisionByZero: division by zero
-CONTEXT: Traceback (most recent call last):
- PL/Python anonymous code block, line 3, in <module>
- plpy.execute("INSERT INTO test1 (a) VALUES (12/(%s-2))" % row['x'])
-PL/Python anonymous code block
-SELECT * FROM test1;
- a | b
------+---
- -6 |
- -12 |
-(2 rows)
-
-SELECT * FROM pg_cursors;
- name | statement | is_holdable | is_binary | is_scrollable | creation_time
-------+-----------+-------------+-----------+---------------+---------------
-(0 rows)
-
--- rollback inside cursor loop
-TRUNCATE test1;
-DO LANGUAGE plpython3u $$
-for row in plpy.cursor("SELECT * FROM test2 ORDER BY x"):
- plpy.execute("INSERT INTO test1 (a) VALUES (%s)" % row['x'])
- plpy.rollback()
-$$;
-SELECT * FROM test1;
- a | b
----+---
-(0 rows)
-
-SELECT * FROM pg_cursors;
- name | statement | is_holdable | is_binary | is_scrollable | creation_time
-------+-----------+-------------+-----------+---------------+---------------
-(0 rows)
-
--- first commit then rollback inside cursor loop
-TRUNCATE test1;
-DO LANGUAGE plpython3u $$
-for row in plpy.cursor("SELECT * FROM test2 ORDER BY x"):
- plpy.execute("INSERT INTO test1 (a) VALUES (%s)" % row['x'])
- if row['x'] % 2 == 0:
- plpy.commit()
- else:
- plpy.rollback()
-$$;
-SELECT * FROM test1;
- a | b
----+---
- 0 |
- 2 |
- 4 |
-(3 rows)
-
-SELECT * FROM pg_cursors;
- name | statement | is_holdable | is_binary | is_scrollable | creation_time
-------+-----------+-------------+-----------+---------------+---------------
-(0 rows)
-
-DROP TABLE test1;
-DROP TABLE test2;
+server closed the connection unexpectedly
+ This probably means the server terminated abnormally
+ before or while processing the request.
+connection to server was lost
diff -U3 /usr/src/packages/user/postgresql/src/postgresql-14.3/src/pl/plpython/expected/python3/plpython_drop.out /usr/src/packages/user/postgresql/src/postgresql-14.3/src/pl/plpython/results/python3/plpython_drop.out
--- /usr/src/packages/user/postgresql/src/postgresql-14.3/src/pl/plpython/expected/python3/plpython_drop.out 2022-12-01 13:38:12.436855009 +0000
+++ /usr/src/packages/user/postgresql/src/postgresql-14.3/src/pl/plpython/results/python3/plpython_drop.out 2022-12-01 13:38:19.812576993 +0000
@@ -1,6 +1 @@
---
--- For paranoia's sake, don't leave an untrusted language sitting around
---
-SET client_min_messages = WARNING;
-DROP EXTENSION plpython3u CASCADE;
-DROP EXTENSION IF EXISTS plpython2u CASCADE;
+psql: error: connection to server on socket "/tmp/pg_regress-MMOaBa/.s.PGSQL.58083" failed: FATAL: the database system is in recovery mode
>>> ERROR: postgresql: check failed
Likely due to recent Python 3.11
bump.