unbuffered sets (text protocol and PS).
$i++;
} while (mysqli_stmt_fetch($stmt));
- if (0 !== ($tmp = mysqli_stmt_num_rows($stmt)))
- printf("[54] Expecting int/0, got %s/%s\n", gettype($tmp), $tmp);
+ if (7 !== ($tmp = mysqli_stmt_num_rows($stmt)))
+ printf("[54] Expecting int/7, got %s/%s\n", gettype($tmp), $tmp);
} else {
printf("[055] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
MYSQLND_METHOD(mysqlnd_res, num_rows)(const MYSQLND_RES * const result TSRMLS_DC)
{
/* Be compatible with libmysql. We count row_count, but will return 0 */
- return result->stored_data? result->stored_data->row_count:0;
+ return result->stored_data? result->stored_data->row_count:(result->unbuf && result->unbuf->eof_reached? result->unbuf->row_count:0);
}
/* }}} */