1--TEST--
2Bug GH-7837 (large bigints may be truncated)
3--EXTENSIONS--
4pdo
5pdo_mysql
6mysqlnd
7--SKIPIF--
8<?php
9require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
10MySQLPDOTest::skip();
11if (!MySQLPDOTest::isPDOMySQLnd()) die('skip only for mysqlnd');
12?>
13--FILE--
14<?php
15require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
16$pdo = MySQLPDOTest::factory();
17
18$tbl = "test";
19$pdo->query("DROP TABLE IF EXISTS $tbl");
20$pdo->query("CREATE TABLE $tbl (`ubigint` bigint unsigned NOT NULL) ENGINE=InnoDB");
21$pdo->query("INSERT INTO $tbl (`ubigint`) VALUES (18446744073709551615)");
22$pdo->query("INSERT INTO $tbl (`ubigint`) VALUES (9223372036854775808)");
23$pdo->query("INSERT INTO $tbl (`ubigint`) VALUES (1)");
24$result = $pdo->query("SELECT ubigint FROM $tbl")->fetchAll(PDO::FETCH_ASSOC);
25var_dump($result);
26?>
27--CLEAN--
28<?php
29require dirname(__FILE__) . '/mysql_pdo_test.inc';
30MySQLPDOTest::dropTestTable();
31?>
32--EXPECT--
33array(3) {
34  [0]=>
35  array(1) {
36    ["ubigint"]=>
37    string(20) "18446744073709551615"
38  }
39  [1]=>
40  array(1) {
41    ["ubigint"]=>
42    string(19) "9223372036854775808"
43  }
44  [2]=>
45  array(1) {
46    ["ubigint"]=>
47    int(1)
48  }
49}
50