Author: uwendel
Date: 2008-04-17 15:25:50 +0200 (Thu, 17 Apr 2008)
New Revision: 1486
Added:
trunk/tests/ext/mysqli/mysqli_stmt_store_result_zvalcache.phpt
Log:
As requested by Andrey: trying to mess around with the mysqlnd zval cache
Added: trunk/tests/ext/mysqli/mysqli_stmt_store_result_zvalcache.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_stmt_store_result_zvalcache.phpt
(rev 0)
+++ trunk/tests/ext/mysqli/mysqli_stmt_store_result_zvalcache.phpt 2008-04-17 13:25:50 UTC
(rev 1486)
@@ -0,0 +1,49 @@
+--TEST--
+mysqli_stmt_store_result() - zval cache test
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once('skipifemb.inc');
+require_once('skipifconnectfailure.inc');
+?>
+--FILE--
+<?php
+ require("connect.inc");
+ require("table.inc");
+
+ $id = null;
+
+ if (!is_object($stmt = $link->prepare('SELECT id FROM test ORDER BY id ASC LIMIT
1')))
+ printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+
+ if (!$stmt->bind_result($id) || !$stmt->execute() || !$stmt->store_result())
+ printf("[002] [%d] %s\n", $stmt->errno, $stmt->error);
+
+ if (!$stmt->fetch())
+ printf("[003] [%d] %s\n", $stmt->errno, $stmt->error);
+
+ var_dump($id);
+
+ // mysqlnd only: trying to fool the zval cache :
+ // will it properly clean up zvals and refcounts?
+ if (!$stmt->execute() || !$stmt->fetch())
+ printf("[004] [%d] %s\n", $stmt->errno, $stmt->error);
+
+ var_dump($id);
+
+ if (!$stmt->execute() || !$stmt->fetch())
+ printf("[005] [%d] %s\n", $stmt->errno, $stmt->error);
+
+ var_dump($id);
+
+ if (!$stmt->fetch())
+ printf("[003] [%d] %s\n", $stmt->errno, $stmt->error);
+
+ var_dump($id);
+
+ mysqli_stmt_close($stmt);
+ mysqli_close($link);
+ print "done!";
+?>
+--EXPECTF--
+done!
\ No newline at end of file
| Thread |
|---|
| • PHP mysqlnd svn commit: r1486 - trunk/tests/ext/mysqli | uwendel | 17 Apr |