From 5e64d2273e4b6f28cc8931a40a30d586999de557 Mon Sep 17 00:00:00 2001 From: Ulf Wendel Date: Fri, 28 Dec 2007 14:51:26 +0000 Subject: [PATCH] Sync from 5_3. Cutting off a few edges: - use connection parameter from environment variables - check if MySQL supports procedures - whitespace --- ext/mysqli/tests/bug42548.phpt | 56 +++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/ext/mysqli/tests/bug42548.phpt b/ext/mysqli/tests/bug42548.phpt index a7d5f39ff7..64c2ba31ec 100644 --- a/ext/mysqli/tests/bug42548.phpt +++ b/ext/mysqli/tests/bug42548.phpt @@ -1,43 +1,56 @@ --TEST-- Bug #42548 PROCEDURE xxx can't return a result set in the given context (works in 5.2.3!!) --SKIPIF-- - + --FILE-- real_connect('localhost', 'root', '', 'test'); +$mysqli->real_connect($host, $user, $passwd, $db, $port, $socket); if (mysqli_connect_errno()) { - printf("Connect failed: %s\n", mysqli_connect_error()); - exit(); + printf("Connect failed: %s\n", mysqli_connect_error()); + exit(); } $mysqli->query("DROP PROCEDURE IF EXISTS p1") or die($mysqli->error); $mysqli->query("CREATE PROCEDURE p1() BEGIN SELECT 23; SELECT 42; END") or die($mysqli->error); if ($mysqli->multi_query("CALL p1();")) -{ - do - { - if ($objResult = $mysqli->store_result()) { - while ($row = $objResult->fetch_assoc()) { - print_r($row); - } - $objResult->close(); - if ($mysqli->more_results()) { - print "----- next result -----------\n"; - } - } else { - print "no results found"; - } - } while ($mysqli->more_results() && $mysqli->next_result()); +{ + do + { + if ($objResult = $mysqli->store_result()) { + while ($row = $objResult->fetch_assoc()) { + print_r($row); + } + $objResult->close(); + if ($mysqli->more_results()) { + print "----- next result -----------\n"; + } + } else { + print "no results found\n"; + } + } while ($mysqli->more_results() && $mysqli->next_result()); } else { - print $mysqli->error; + print $mysqli->error; } $mysqli->query("DROP PROCEDURE p1") or die($mysqli->error); $mysqli->close(); +print "done!"; ?> ---EXPECT-- +--EXPECT-- Array ( [23] => 23 @@ -49,3 +62,4 @@ Array ) ----- next result ----------- no results found +done! \ No newline at end of file -- 2.50.1