mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Fix GH-9411: PgSQL large object resource is incorrectly closed
This commit is contained in:
commit
b5cad508fe
5 changed files with 95 additions and 5 deletions
|
@ -134,6 +134,8 @@ static int pgsql_stmt_execute(pdo_stmt_t *stmt)
|
|||
pdo_pgsql_db_handle *H = S->H;
|
||||
ExecStatusType status;
|
||||
|
||||
bool in_trans = stmt->dbh->methods->in_transaction(stmt->dbh);
|
||||
|
||||
/* ensure that we free any previous unfetched results */
|
||||
if(S->result) {
|
||||
PQclear(S->result);
|
||||
|
@ -252,6 +254,10 @@ stmt_retry:
|
|||
stmt->row_count = (zend_long)PQntuples(S->result);
|
||||
}
|
||||
|
||||
if (in_trans && !stmt->dbh->methods->in_transaction(stmt->dbh)) {
|
||||
pdo_pgsql_close_lob_streams(stmt->dbh);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue