mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #79664: PDOStatement::getColumnMeta fails on empty result set
This commit is contained in:
commit
461135009c
3 changed files with 37 additions and 1 deletions
4
NEWS
4
NEWS
|
@ -6,6 +6,10 @@ PHP NEWS
|
||||||
. Fixed bug #79595 (zend_init_fpu() alters FPU precision). (cmb, Nikita)
|
. Fixed bug #79595 (zend_init_fpu() alters FPU precision). (cmb, Nikita)
|
||||||
. Fixed bug #79650 (php-win.exe 100% cpu lockup). (cmb)
|
. Fixed bug #79650 (php-win.exe 100% cpu lockup). (cmb)
|
||||||
|
|
||||||
|
- PDO SQLite:
|
||||||
|
. Fixed bug #79664 (PDOStatement::getColumnMeta fails on empty result set).
|
||||||
|
(cmb)
|
||||||
|
|
||||||
- phpdbg:
|
- phpdbg:
|
||||||
. Fixed bug #73926 (phpdbg will not accept input on restart execution). (cmb)
|
. Fixed bug #73926 (phpdbg will not accept input on restart execution). (cmb)
|
||||||
. Fixed several mostly Windows related phpdbg bugs. (cmb)
|
. Fixed several mostly Windows related phpdbg bugs. (cmb)
|
||||||
|
|
|
@ -341,7 +341,7 @@ static int pdo_sqlite_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *ret
|
||||||
if (!S->stmt) {
|
if (!S->stmt) {
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
if(colno >= sqlite3_data_count(S->stmt)) {
|
if(colno >= sqlite3_column_count(S->stmt)) {
|
||||||
/* error invalid column */
|
/* error invalid column */
|
||||||
pdo_sqlite_error_stmt(stmt);
|
pdo_sqlite_error_stmt(stmt);
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
|
|
32
ext/pdo_sqlite/tests/bug79664.phpt
Normal file
32
ext/pdo_sqlite/tests/bug79664.phpt
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #79664 (PDOStatement::getColumnMeta fails on empty result set)
|
||||||
|
--SKIPIF--
|
||||||
|
<?php
|
||||||
|
if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
|
||||||
|
?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$pdo = new PDO('sqlite::memory:', null, null, [
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
]);
|
||||||
|
$stmt = $pdo->query('select 1 where 0');
|
||||||
|
if ($stmt->columnCount()) {
|
||||||
|
var_dump($stmt->getColumnMeta(0));
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
array(6) {
|
||||||
|
["native_type"]=>
|
||||||
|
string(4) "null"
|
||||||
|
["flags"]=>
|
||||||
|
array(0) {
|
||||||
|
}
|
||||||
|
["name"]=>
|
||||||
|
string(1) "1"
|
||||||
|
["len"]=>
|
||||||
|
int(4294967295)
|
||||||
|
["precision"]=>
|
||||||
|
int(0)
|
||||||
|
["pdo_type"]=>
|
||||||
|
int(2)
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue