mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix #79664: PDOStatement::getColumnMeta fails on empty result set
As its name suggests, `sqlite3_data_count` returns the number of columns in the current row of the result set; we are interested in the number of columns regardless of the current row, so we have to use `sqlite3_column_count` instead.
This commit is contained in:
parent
923c45bdca
commit
63bd8f38f4
3 changed files with 37 additions and 1 deletions
|
@ -337,7 +337,7 @@ static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *ret
|
|||
if (!S->stmt) {
|
||||
return FAILURE;
|
||||
}
|
||||
if(colno >= sqlite3_data_count(S->stmt)) {
|
||||
if(colno >= sqlite3_column_count(S->stmt)) {
|
||||
/* error invalid column */
|
||||
pdo_sqlite_error_stmt(stmt);
|
||||
return FAILURE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue