[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqli/tests/mysqli_report.phpt branches/PHP_5_4/ext/mysqli/tests/mysqli_report.phpt trunk/ext/mysqli/tests/mysqli_report.phpt

2012-03-14 Thread Ulf Wendel
uw   Wed, 14 Mar 2012 14:55:09 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324242

Log:
Test for MySQL version.Variable is deprecated in MySQL 5.6.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_report.phpt
U   php/php-src/branches/PHP_5_4/ext/mysqli/tests/mysqli_report.phpt
U   php/php-src/trunk/ext/mysqli/tests/mysqli_report.phpt

Modified: php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_report.phpt
===
--- php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_report.phpt	2012-03-14 14:05:54 UTC (rev 324241)
+++ php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_report.phpt	2012-03-14 14:55:09 UTC (rev 324242)
@@ -194,37 +194,39 @@
 	if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
 		printf([017] [%d] %s\n, mysqli_connect_errno(), mysqli_connect_error());

-	// this might cause a warning - no index used
-	if (!$res = @mysqli_query($link, SHOW VARIABLES LIKE 'log_slow_queries'))
-		printf([018] [%d] %s\n, mysqli_errno($link), mysqli_error($link));
+	if (mysqli_get_server_version($link) = 50600) {
+		// this might cause a warning - no index used
+		if (!$res = @mysqli_query($link, SHOW VARIABLES LIKE 'log_slow_queries'))
+			printf([018] [%d] %s\n, mysqli_errno($link), mysqli_error($link));

-	if (!$row = mysqli_fetch_assoc($res))
-		printf([019] [%d] %s\n, mysqli_errno($link), mysqli_error($link));
+		if (!$row = mysqli_fetch_assoc($res))
+			printf([019] [%d] %s\n, mysqli_errno($link), mysqli_error($link));

-	$log_slow_query = ('ON' == $row['Value']);
+		$log_slow_query = ('ON' == $row['Value']);

-	if (mysqli_get_server_version($link) = 51011) {
-		// this might cause a warning - no index used
-		if (!$res = @mysqli_query($link, SHOW VARIABLES LIKE 'log_queries_not_using_indexes'))
-			printf([020] [%d] %s\n, mysqli_errno($link), mysqli_error($link));
+		if (mysqli_get_server_version($link) = 50111) {
+			// this might cause a warning - no index used
+			if (!$res = @mysqli_query($link, SHOW VARIABLES LIKE 'log_queries_not_using_indexes'))
+printf([020] [%d] %s\n, mysqli_errno($link), mysqli_error($link));

-		if (!$row = mysqli_fetch_assoc($res))
-			printf([021] [%d] %s\n, mysqli_errno($link), mysqli_error($link));
+			if (!$row = mysqli_fetch_assoc($res))
+printf([021] [%d] %s\n, mysqli_errno($link), mysqli_error($link));

-		$log_queries_not_using_indexes = ('ON' == $row['Value']);
+			$log_queries_not_using_indexes = ('ON' == $row['Value']);

-		if ($log_slow_queries  $log_queries_not_using_indexes) {
+			if ($log_slow_queries  $log_queries_not_using_indexes) {

-			for ($i = 100; $i  2; $i++) {
-if (!mysqli_query($link, INSERT INTO test(id, label) VALUES ($i, 'z')))
-	printf([022 - %d] [%d] %s\n, $i - 99, mysqli_errno($link), mysqli_error($link));
-			}
+for ($i = 100; $i  2; $i++) {
+	if (!mysqli_query($link, INSERT INTO test(id, label) VALUES ($i, 'z')))
+		printf([022 - %d] [%d] %s\n, $i - 99, mysqli_errno($link), mysqli_error($link));
+}

-			// this might cause a warning - no index used
-			if (!$res = @mysqli_query($link, SELECT id, label FROM test WHERE id = 1323))
-printf([023] [%d] %s\n, mysqli_errno($link), mysqli_error($link));
+// this might cause a warning - no index used
+if (!$res = @mysqli_query($link, SELECT id, label FROM test WHERE id = 1323))
+	printf([023] [%d] %s\n, mysqli_errno($link), mysqli_error($link));

-			mysqli_free_result($res);
+mysqli_free_result($res);
+			}
 		}
 	}


Modified: php/php-src/branches/PHP_5_4/ext/mysqli/tests/mysqli_report.phpt
===
--- php/php-src/branches/PHP_5_4/ext/mysqli/tests/mysqli_report.phpt	2012-03-14 14:05:54 UTC (rev 324241)
+++ php/php-src/branches/PHP_5_4/ext/mysqli/tests/mysqli_report.phpt	2012-03-14 14:55:09 UTC (rev 324242)
@@ -194,37 +194,39 @@
 	if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
 		printf([017] [%d] %s\n, mysqli_connect_errno(), mysqli_connect_error());

-	// this might cause a warning - no index used
-	if (!$res = @mysqli_query($link, SHOW VARIABLES LIKE 'log_slow_queries'))
-		printf([018] [%d] %s\n, mysqli_errno($link), mysqli_error($link));
+	if (mysqli_get_server_version($link) = 50600) {
+		// this might cause a warning - no index used
+		if (!$res = @mysqli_query($link, SHOW VARIABLES LIKE 'log_slow_queries'))
+			printf([018] [%d] %s\n, mysqli_errno($link), mysqli_error($link));

-	if (!$row = mysqli_fetch_assoc($res))
-		printf([019] [%d] %s\n, mysqli_errno($link), mysqli_error($link));
+		if (!$row = mysqli_fetch_assoc($res))
+			printf([019] [%d] %s\n, mysqli_errno($link), mysqli_error($link));

-	$log_slow_query = ('ON' == $row['Value']);
+		$log_slow_query = ('ON' == $row['Value']);

-	if (mysqli_get_server_version($link) = 51011) {
-		// this might cause a 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqli/tests/mysqli_report.phpt branches/PHP_5_4/ext/mysqli/tests/mysqli_report.phpt trunk/ext/mysqli/tests/mysqli_report.phpt

2011-12-14 Thread Andrey Hristov
andrey   Wed, 14 Dec 2011 18:36:04 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=321021

Log:
fix test

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_report.phpt
U   php/php-src/branches/PHP_5_4/ext/mysqli/tests/mysqli_report.phpt
U   php/php-src/trunk/ext/mysqli/tests/mysqli_report.phpt

Modified: php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_report.phpt
===
--- php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_report.phpt
2011-12-14 17:59:11 UTC (rev 321020)
+++ php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_report.phpt
2011-12-14 18:36:04 UTC (rev 321021)
@@ -289,7 +289,7 @@

 Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check 
the manual that corresponds to your MySQL server version for the right syntax 
to use near 'FOO' at line 1 in %s on line %d

-Warning: mysqli_change_user(): (%d/%d): Access denied for user 
'0123456789-10-4%s'@'%s' (using password: YES) in %s on line %d
+Warning: mysqli_change_user(): (%d/%d): Access denied for user '%s'@'%s' 
(using password: YES) in %s on line %d

 Warning: mysqli_kill(): processid should have positive value in %s on line %d


Modified: php/php-src/branches/PHP_5_4/ext/mysqli/tests/mysqli_report.phpt
===
--- php/php-src/branches/PHP_5_4/ext/mysqli/tests/mysqli_report.phpt
2011-12-14 17:59:11 UTC (rev 321020)
+++ php/php-src/branches/PHP_5_4/ext/mysqli/tests/mysqli_report.phpt
2011-12-14 18:36:04 UTC (rev 321021)
@@ -289,7 +289,7 @@

 Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check 
the manual that corresponds to your MySQL server version for the right syntax 
to use near 'FOO' at line 1 in %s on line %d

-Warning: mysqli_change_user(): (%d/%d): Access denied for user 
'0123456789-10-4%s'@'%s' (using password: YES) in %s on line %d
+Warning: mysqli_change_user(): (%d/%d): Access denied for user '%s'@'%s' 
(using password: YES) in %s on line %d

 Warning: mysqli_kill(): processid should have positive value in %s on line %d


Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_report.phpt
===
--- php/php-src/trunk/ext/mysqli/tests/mysqli_report.phpt   2011-12-14 
17:59:11 UTC (rev 321020)
+++ php/php-src/trunk/ext/mysqli/tests/mysqli_report.phpt   2011-12-14 
18:36:04 UTC (rev 321021)
@@ -289,7 +289,7 @@

 Warning: mysqli_query(): (%d/%d): You have an error in your SQL syntax; check 
the manual that corresponds to your MySQL server version for the right syntax 
to use near 'FOO' at line 1 in %s on line %d

-Warning: mysqli_change_user(): (%d/%d): Access denied for user 
'0123456789-10-4%s'@'%s' (using password: YES) in %s on line %d
+Warning: mysqli_change_user(): (%d/%d): Access denied for user '%s'@'%s' 
(using password: YES) in %s on line %d

 Warning: mysqli_kill(): processid should have positive value in %s on line %d


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php