mirror of
https://github.com/php/php-src.git
synced 2024-10-01 23:06:11 +00:00
63791d055a
implies more memory copy. The old method is still available and can be used. It stays as default. Choosing the method is through a flag to mysqli_query()/mysqli_real_query() New mode can be forced with an INI setting, for all extensions that support this mode (ext/mysql and mysqli, because PDO due to it's architecture can't support it) The setting is mysqlnd.fetch_data_copy=[0|1]
42 lines
1.0 KiB
PHP
42 lines
1.0 KiB
PHP
--TEST--
|
|
mysqli_store_result()
|
|
--SKIPIF--
|
|
<?php
|
|
require_once('skipif.inc');
|
|
require_once('skipifemb.inc');
|
|
require_once('skipifconnectfailure.inc');
|
|
?>
|
|
--INI--
|
|
mysqlnd.debug=d:t:O,/tmp/mysqlnd.trace
|
|
--FILE--
|
|
<?php
|
|
require_once("connect.inc");
|
|
|
|
$tmp = NULL;
|
|
$link = NULL;
|
|
|
|
|
|
require('table.inc');
|
|
|
|
if (!$res = mysqli_real_query($link, "SELECT id, label FROM test ORDER BY id"))
|
|
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
|
|
|
if (!is_object($res = mysqli_store_result($link, MYSQLI_STORE_RESULT_COPY_DATA)))
|
|
printf("[004] Expecting object, got %s/%s. [%d] %s\n",
|
|
gettype($res), $res, mysqli_errno($link), mysqli_error($link));
|
|
|
|
if (true !== ($tmp = mysqli_data_seek($res, 2)))
|
|
printf("[005] Expecting boolean/true, got %s/%s. [%d] %s\n",
|
|
gettype($tmp), $tmp, mysqli_errno($link), mysqli_error($link));
|
|
|
|
mysqli_free_result($res);
|
|
|
|
print "done!";
|
|
?>
|
|
--CLEAN--
|
|
<?php
|
|
require_once("clean_table.inc");
|
|
?>
|
|
--EXPECTF--
|
|
Warning: mysqli_store_result(): Couldn't fetch mysqli in %s on line %d
|
|
done!
|