BUG #17663:Connect to the database through jdbc, call the stored procedure containing the rollback statement,the database triggers an assertion, and the database is in recovery mode.

From: 赵其桂 <zhaoqg45023(at)hundsun(dot)com>
To: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: "402142054(at)qq(dot)com" <402142054(at)qq(dot)com>
Subject: BUG #17663:Connect to the database through jdbc, call the stored procedure containing the rollback statement,the database triggers an assertion, and the database is in recovery mode.
Date: 2022-11-01 12:57:00
Message-ID: 1667307420050.56657@hundsun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear developer:
The patch submitted addresses #17663 in the pgsql-bugs(at)lists(dot)postgresql(dot)org list.
Problem: Add the parameters --enable-debug and --enable-cassert when the database is compiled. Driven by jdbc, the stored procedure containing rollbck is called, and an assertion occurs.
Cause of the problem: Driven by jdbc, in the function BuildCachedPlan, the CachedPlan memory context is generated to save the execution plan (plan) of the input SQL. If the stored procedure contains rollback, call the function ReleaseCachedPlan to release the CachedPlan memory context. Therefore, before the function pgss_store collects statistical information, it is necessary to retain the stmt_location and stmt_len data required in pstmt, which will not be released by the cCachedPlan memory context, resulting in random values for the parameters required by the function pgss_store.?

Attachment Content-Type Size
0001-fix-BUG-17663-Connect-to-the-database-through-jdbc-c.patch text/plain 1.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2022-11-01 13:07:17 Re: pg_upgrade allows itself to be run twice
Previous Message Peter Eisentraut 2022-11-01 12:54:35 Re: pg_upgrade allows itself to be run twice