Author: uwendel
Date: 2007-07-05 14:00:27 +0200 (Thu, 05 Jul 2007)
New Revision: 647
Modified:
trunk/tests/ext/mysqli/mysqli_report.phpt
Log:
Portability: log_queries_not_using_indexes was added in MySQL 5.1.11.
Modified: trunk/tests/ext/mysqli/mysqli_report.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_report.phpt 2007-07-05 10:28:52 UTC (rev 646)
+++ trunk/tests/ext/mysqli/mysqli_report.phpt 2007-07-05 12:00:27 UTC (rev 647)
@@ -40,7 +40,8 @@
mysqli_multi_query($link, "BAR; FOO;");
mysqli_query($link, "FOO");
- mysqli_change_user($link, "This might work if you accept anonymous users in your
setup", "password", $db);
+ /* This might work if you accept anonymous users in your setup */
+ mysqli_change_user($link,
"0123456789-10-456789-20-456789-30-456789-40-456789-50-456789-60-456789-70-456789-80-456789-90-456789",
"password", $db);
mysqli_kill($link, -1);
// mysqli_ping() cannot be tested, because one would need to cause an error inside
the C function to test it
@@ -195,32 +196,32 @@
printf("[019] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$log_slow_query = ('ON' == $row['Value']);
-
- 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 (mysqli_get_server_version($link) >= 51011) {
+ if (!$res = mysqli_query($link, "SHOW VARIABLES LIKE
'log_queries_not_using_indexes'"))
+ printf("[020] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
- $log_queries_not_using_indexes = ('ON' == $row['Value']);
+ 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']);
- if ($log_slow_queries && $log_queries_not_using_indexes) {
+ if ($log_slow_queries && $log_queries_not_using_indexes) {
- for ($i = 100; $i < 20000; $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 < 20000; $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));
+ }
- if (!$res = @mysqli_query($link, "SELECT id, label FROM test WHERE id = 1323"))
- printf("[023] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+ 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);
- mysqli_report(MYSQLI_REPORT_OFF);
- mysqli_report(MYSQLI_REPORT_INDEX);
-
-
- }
+ mysqli_report(MYSQLI_REPORT_OFF);
+ mysqli_report(MYSQLI_REPORT_INDEX);
+ }
+ }
print "done!";
?>
@@ -229,7 +230,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 'This might work if you
accept anonymous users in'@'%s' (using password: YES) in %s on line %d
+Warning: mysqli_change_user(): (%d/%d): Access denied for user
'0123456789-10-456789-20-456789-3'@'%s' (using password: YES) in %s on line %d
Warning: mysqli_kill(): processid should have positive value in %s on line %d
| Thread |
|---|
| • PHP mysqlnd svn commit: r647 - trunk/tests/ext/mysqli | uwendel | 5 Jul |