1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 01:48:26 +02:00
Files
archived-php-src/ext/pdo_sqlite/tests/bug_63916-2.phpt
T
Gabriel Caruso c93aba042f Give a reason why the test was skipped
This will help us debug why a test was skipped in GCOV
(http://gcov.php.net/viewer.php?version=PHP_HEAD&func=skip), and maybe
put them to run again
2018-07-22 16:41:41 -03:00

28 lines
790 B
PHP

--TEST--
Bug #63916 PDO::PARAM_INT casts to 32bit int internally even on 64bit builds in pdo_sqlite
--SKIPIF--
<?php
if (!extension_loaded('pdo_sqlite')) die('skip pdo_sqlite extension not loaded');
if (PHP_INT_SIZE > 4) die('skip 32-bit only');
?>
--FILE--
<?php
$num = PHP_INT_MAX; // 32 bits
$conn = new PDO('sqlite::memory:');
$conn->query('CREATE TABLE users (id INTEGER NOT NULL, num INTEGER NOT NULL, PRIMARY KEY(id))');
$stmt = $conn->prepare('insert into users (id, num) values (:id, :num)');
$stmt->bindValue(':id', 1, PDO::PARAM_INT);
$stmt->bindValue(':num', $num, PDO::PARAM_INT);
$stmt->execute();
$stmt = $conn->query('SELECT num FROM users');
$result = $stmt->fetchAll(PDO::FETCH_COLUMN);
var_dump($num,$result[0]);
?>
--EXPECT--
int(2147483647)
string(10) "2147483647"