Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf498704

Browse files
committed
PL/Python: Fix tests for older Python versions
Commit8561e48 neglected to handleolder Python versions that don't support the "with" statement. So writethe tests in a way that older versions can handle as well.
1 parent2b792ab commitf498704

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

‎src/pl/plpython/expected/plpython_transaction.out

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,9 @@ CONTEXT: Traceback (most recent call last):
9595
PL/Python function "transaction_test4"
9696
-- commit inside subtransaction (prohibited)
9797
DO LANGUAGE plpythonu $$
98-
with plpy.subtransaction():
99-
plpy.commit()
98+
s = plpy.subtransaction()
99+
s.enter()
100+
plpy.commit()
100101
$$;
101102
WARNING: forcibly aborting a subtransaction that has not been exited
102103
ERROR: cannot commit while a subtransaction is active

‎src/pl/plpython/sql/plpython_transaction.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ SELECT transaction_test4();
7979

8080
-- commit inside subtransaction (prohibited)
8181
DO LANGUAGE plpythonu $$
82-
withplpy.subtransaction():
83-
plpy.commit()
82+
s=plpy.subtransaction()
83+
s.enter()
84+
plpy.commit()
8485
$$;
8586

8687

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp