bug62046.phpt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --TEST--
  2. Bug #62046 mysqli@mysqlnd can't iterate over stored sets after call to mysqli_stmt_reset()
  3. --EXTENSIONS--
  4. mysqli
  5. --SKIPIF--
  6. <?php
  7. require_once('skipifconnectfailure.inc');
  8. ?>
  9. --FILE--
  10. <?php
  11. require_once("connect.inc");
  12. if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
  13. printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
  14. }
  15. if (FALSE === ($stmt = $link->prepare('SELECT 42'))) {
  16. printf("[002] Prepare failed, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
  17. }
  18. if (FALSE === $stmt->execute()) {
  19. printf("[003] Execute failed, [%d] %s\n", $stmt->errorno, $stmt->error);
  20. }
  21. if (FALSE === $stmt->store_result()) {
  22. printf("[004] store_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);
  23. }
  24. $one = NULL;
  25. if (FALSE === $stmt->bind_result($one)) {
  26. printf("[005] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);
  27. }
  28. if (FALSE === $stmt->reset()) {
  29. printf("[006] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);
  30. }
  31. while ($stmt->fetch()) {
  32. var_dump($one);
  33. }
  34. $stmt->close();
  35. $link->close();
  36. echo "done!";
  37. ?>
  38. --EXPECT--
  39. int(42)
  40. done!