1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 01:02:25 +01:00
Files
archived-php-src/ext/pdo_sqlite/tests/bug79664.phpt
Nikita Popov e6160e99d8 Report len as -1 instead of INT_MAX
Per docs it should be -1. And would be on 32-bit systems, but
not on 64-bit systems.

(cherry picked from commit 39111585a2)
2020-07-08 10:38:11 +02:00

33 lines
582 B
PHP

--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(-1)
["precision"]=>
int(0)
["pdo_type"]=>
int(2)
}