Introduce php_pdo_stmt_valid_db_obj_handle() (#17567)

This commit is contained in:
Niels Dossche 2025-01-28 21:54:11 +01:00 committed by GitHub
parent ad6cdb5aaa
commit 6f4579af85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 23 additions and 18 deletions

View file

@ -122,9 +122,7 @@ static void pgsql_stmt_finish(pdo_pgsql_stmt *S, int fin_mode)
static int pgsql_stmt_dtor(pdo_stmt_t *stmt)
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
bool server_obj_usable = !Z_ISUNDEF(stmt->database_object_handle)
&& IS_OBJ_VALID(EG(objects_store).object_buckets[Z_OBJ_HANDLE(stmt->database_object_handle)])
&& !(OBJ_FLAGS(Z_OBJ(stmt->database_object_handle)) & IS_OBJ_FREE_CALLED);
bool server_obj_usable = php_pdo_stmt_valid_db_obj_handle(stmt);
pgsql_stmt_finish(S, FIN_DISCARD|(server_obj_usable ? FIN_CLOSE|FIN_ABORT : 0));