]> granicus.if.org Git - php/commitdiff
Bug #55653
authorUlf Wendel <uw@php.net>
Fri, 9 Sep 2011 12:12:08 +0000 (12:12 +0000)
committerUlf Wendel <uw@php.net>
Fri, 9 Sep 2011 12:12:08 +0000 (12:12 +0000)
ext/mysqli/tests/bug55653.phpt [new file with mode: 0644]

diff --git a/ext/mysqli/tests/bug55653.phpt b/ext/mysqli/tests/bug55653.phpt
new file mode 100644 (file)
index 0000000..f9cd297
--- /dev/null
@@ -0,0 +1,36 @@
+--TEST--\r
+Bug #55653     PS crash with libmysql when binding same variable as param and out\r
+--SKIPIF--\r
+<?php\r
+require_once('skipif.inc');\r
+require_once('skipifconnectfailure.inc');\r
+?>\r
+--FILE--\r
+<?php\r
+       require_once("connect.inc");\r
+\r
+       if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {\r
+               printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());\r
+       }\r
+\r
+       $in_and_out = "a";\r
+\r
+       if (!($stmt = $link->stmt_init()))\r
+               printf("[002] [%d] %s\n", $link->errno, $link->error);\r
+\r
+       if (!($stmt->prepare("SELECT ?")) ||\r
+               !($stmt->bind_param("s", $in_and_out)) ||\r
+               !($stmt->execute()) ||\r
+               !($stmt->bind_result($in_and_out)))\r
+               printf("[003] [%d] %s\n", $stmt->errno, $stmt->error);\r
+\r
+       if (!$stmt->fetch())\r
+               printf("[004] [%d] %s\n", $stmt->errno, $stmt->error);\r
+\r
+       if ("a" !== $in_and_out)\r
+               printf("[005] Wrong result: '%s'\n", $in_and_out);\r
+\r
+       echo "done!";\r
+?>\r
+--EXPECT--\r
+done!
\ No newline at end of file