We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a4810a commit 556def7Copy full SHA for 556def7
ext/pdo_odbc/odbc_stmt.c
@@ -136,7 +136,11 @@ static int odbc_stmt_dtor(pdo_stmt_t *stmt)
136
{
137
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
138
139
- if (S->stmt != SQL_NULL_HANDLE) {
+ // TODO: Factor this out; pg/mysql/firebird do the same thing
140
+ bool server_obj_usable = !Z_ISUNDEF(stmt->database_object_handle)
141
+ && IS_OBJ_VALID(EG(objects_store).object_buckets[Z_OBJ_HANDLE(stmt->database_object_handle)])
142
+ && !(OBJ_FLAGS(Z_OBJ(stmt->database_object_handle)) & IS_OBJ_FREE_CALLED);
143
+ if (S->stmt != SQL_NULL_HANDLE && server_obj_usable) {
144
if (stmt->executed) {
145
SQLCloseCursor(S->stmt);
146
}
0 commit comments