2006-01-05 07:04:06 +08:00
|
|
|
--TEST--
|
2007-05-08 01:23:53 +08:00
|
|
|
Bug #35517 (mysqli_stmt_fetch returns NULL)
|
2006-01-05 07:04:06 +08:00
|
|
|
--SKIPIF--
|
2007-12-29 02:28:21 +08:00
|
|
|
<?php
|
|
|
|
require_once('skipif.inc');
|
2007-08-09 17:43:28 +08:00
|
|
|
require_once('skipifconnectfailure.inc');
|
|
|
|
?>
|
2006-01-05 07:04:06 +08:00
|
|
|
--FILE--
|
|
|
|
<?php
|
2009-10-20 04:07:25 +08:00
|
|
|
require_once("connect.inc");
|
2006-01-05 07:04:06 +08:00
|
|
|
|
2009-09-24 20:51:03 +08:00
|
|
|
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
2006-01-05 07:04:06 +08:00
|
|
|
|
|
|
|
$mysql->query("CREATE TABLE temp (id INT UNSIGNED NOT NULL)");
|
|
|
|
$mysql->query("INSERT INTO temp (id) VALUES (3000000897),(3800001532),(3900002281),(3100059612)");
|
|
|
|
$stmt = $mysql->prepare("SELECT id FROM temp");
|
|
|
|
$stmt->execute();
|
|
|
|
$stmt->bind_result($id);
|
|
|
|
while ($stmt->fetch()) {
|
2007-12-29 02:28:21 +08:00
|
|
|
if (PHP_INT_SIZE == 8) {
|
|
|
|
if ((gettype($id) !== 'int') && (gettype($id) != 'integer'))
|
|
|
|
printf("[001] Expecting integer on 64bit got %s/%s\n", gettype($id), var_export($id, true));
|
|
|
|
} else {
|
|
|
|
if (gettype($id) !== 'string') {
|
|
|
|
printf("[002] Expecting string on 32bit got %s/%s\n", gettype($id), var_export($id, true));
|
|
|
|
}
|
2009-05-28 22:11:41 +08:00
|
|
|
if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($id)) {
|
2007-12-29 02:28:21 +08:00
|
|
|
printf("[003] Expecting unicode string\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
print $id;
|
|
|
|
print "\n";
|
2006-01-05 07:04:06 +08:00
|
|
|
}
|
|
|
|
$stmt->close();
|
|
|
|
|
|
|
|
$mysql->query("DROP TABLE temp");
|
|
|
|
$mysql->close();
|
2007-12-29 02:28:21 +08:00
|
|
|
print "done!";
|
2006-01-05 07:04:06 +08:00
|
|
|
?>
|
2009-07-06 22:36:52 +08:00
|
|
|
--CLEAN--
|
|
|
|
<?php
|
2009-10-20 04:07:25 +08:00
|
|
|
require_once("connect.inc");
|
2009-09-24 20:51:03 +08:00
|
|
|
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
2009-07-06 22:36:52 +08:00
|
|
|
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
|
|
|
|
|
|
|
if (!mysqli_query($link, "DROP TABLE IF EXISTS temp"))
|
|
|
|
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
|
|
|
|
|
|
|
mysqli_close($link);
|
|
|
|
?>
|
2006-01-05 07:04:06 +08:00
|
|
|
--EXPECTF--
|
2007-12-29 02:28:21 +08:00
|
|
|
3000000897
|
|
|
|
3800001532
|
|
|
|
3900002281
|
|
|
|
3100059612
|
|
|
|
done!
|