Annotation of embedaddon/php/ext/mysqli/tests/bug55582.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #55582 mysqli_num_rows() returns always 0 for unbuffered, when mysqlnd is used
! 3: --SKIPIF--
! 4: <?php
! 5: require_once('skipif.inc');
! 6: require_once('skipifconnectfailure.inc');
! 7: require_once("connect.inc");
! 8: ?>
! 9: --FILE--
! 10: <?php
! 11: include "connect.inc";
! 12: if (!($link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))) {
! 13: printf("[001] Cannot connect to the server");
! 14: }
! 15:
! 16: var_dump($link->real_query("SELECT 1"));
! 17: $res = $link->use_result();
! 18: var_dump(mysqli_num_rows($res));
! 19: var_dump($res->fetch_assoc());
! 20: var_dump(mysqli_num_rows($res));
! 21: var_dump($res->fetch_assoc());
! 22: var_dump(mysqli_num_rows($res));
! 23:
! 24: $link->close();
! 25: echo "done\n";
! 26: ?>
! 27: --EXPECTF--
! 28: bool(true)
! 29:
! 30: Warning: mysqli_num_rows(): Function cannot be used with MYSQL_USE_RESULT in %s on line %d
! 31: int(0)
! 32: array(1) {
! 33: [1]=>
! 34: string(1) "1"
! 35: }
! 36:
! 37: Warning: mysqli_num_rows(): Function cannot be used with MYSQL_USE_RESULT in %s on line %d
! 38: int(0)
! 39: NULL
! 40: int(1)
! 41: done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>