mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix bug #81343: inconsistent type conversion after closeCursor
S->cols is already freed in the statement destructor and since
caa710037e
the column data is only
populated on the first execute() which means that on subsequent
execute()s after closeCursor was called, all meta-data for column types
was removed and never restored
Closes GH-7355.
This commit is contained in:
parent
865b096890
commit
ace8fba759
3 changed files with 33 additions and 8 deletions
|
@ -240,8 +240,8 @@ stmt_retry:
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!stmt->executed && (!stmt->column_count || S->cols == NULL)) {
|
||||
stmt->column_count = (int) PQnfields(S->result);
|
||||
stmt->column_count = (int) PQnfields(S->result);
|
||||
if (S->cols == NULL) {
|
||||
S->cols = ecalloc(stmt->column_count, sizeof(pdo_pgsql_column));
|
||||
}
|
||||
|
||||
|
@ -674,12 +674,6 @@ static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *r
|
|||
|
||||
static int pdo_pgsql_stmt_cursor_closer(pdo_stmt_t *stmt)
|
||||
{
|
||||
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
|
||||
|
||||
if (S->cols != NULL){
|
||||
efree(S->cols);
|
||||
S->cols = NULL;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue