List:Commits« Previous MessageNext Message »
From:uwendel Date:August 29 2007 8:27pm
Subject:PHP mysqlnd svn commit: r964 - trunk/tests/ext/mysqli
View as plain text  
Author: uwendel
Date: 2007-08-29 20:27:45 +0200 (Wed, 29 Aug 2007)
New Revision: 964

Modified:
   trunk/tests/ext/mysqli/mysqli_debug_mysqlnd_control_string.phpt
Log:
To my understanding without 't' there should be no function
traces. Testing that...



Modified: trunk/tests/ext/mysqli/mysqli_debug_mysqlnd_control_string.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_debug_mysqlnd_control_string.phpt	2007-08-29 17:47:59
UTC (rev 963)
+++ trunk/tests/ext/mysqli/mysqli_debug_mysqlnd_control_string.phpt	2007-08-29 18:27:45
UTC (rev 964)
@@ -33,6 +33,9 @@
 				mysqli_error($link));
 			return false;
 		}
+		while ($row = mysqli_fetch_assoc($res))
+			;
+		mysqli_free_result($res);
 
 		clearstatcache();
 		if (!file_exists($trace_file)) {
@@ -84,7 +87,33 @@
 	if (!preg_match("@^\d+:@ismU", $trace))
 		printf("[065] Nesting level seem to be missing, first characters from trace are
'%s'\n", substr($trace, 0, 80));
 
+	// -t,[N] - maximum nesting level
+	$trace = try_control_string($link, 't,1:n:O,' . $trace_file, $trace_file, 70);
+	$lines = explode("\n", $trace);
+	foreach ($lines as $k => $line) {
+		$line = trim($line);
+		if (!preg_match("@^(\d+):+@ismU", $line, $matches)) {
+			printf("[075] Nesting level seem to be missing, first characters from trace are
'%s'\n", substr($line, 0, 80));
+		} else {
+			if (!isset($matches[1]) || ((int)$matches[1] > 1)) {
+				printf("[076] Nesting level seem to be %d, should not be higher than 1, first
characters from trace are '%s'\n",
+					$matches[1],
+					substr($line, 0, 80));
+			}
+		}
+	}
 
+	// omitting t
+	$trace = try_control_string($link, 'n:O,' . $trace_file, $trace_file, 80);
+	$lines = explode("\n", $trace);
+	foreach ($lines as $k => $line) {
+		$line = trim($line);
+		if (preg_match("@^>\w@ismU", $line, $matches)) {
+			printf("[085] Looks like a function call, but there should be none in the trace file,
first characters from trace are '%s'\n",
+				substr($line, 0, 80));
+		}
+	}
+
 	mysqli_close($link);
 	print "done";
 	if ($IS_MYSQLND)

Thread
PHP mysqlnd svn commit: r964 - trunk/tests/ext/mysqliuwendel29 Aug