Display execution time in SQL query
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@609 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
0bd864ea6f
commit
faa43e4c3c
|
@ -1,5 +1,6 @@
|
||||||
phpMinAdmin 1.10.2:
|
phpMinAdmin 1.10.2:
|
||||||
Connection through socket by server :/path/to/socket
|
Connection through socket by server :/path/to/socket
|
||||||
|
Display execution time in SQL query
|
||||||
|
|
||||||
phpMinAdmin 1.10.1:
|
phpMinAdmin 1.10.1:
|
||||||
Highlight odd and hover rows
|
Highlight odd and hover rows
|
||||||
|
|
|
@ -22,6 +22,7 @@ code { background: #eee; }
|
||||||
.enum { color: #007F7F; }
|
.enum { color: #007F7F; }
|
||||||
.binary { color: red; }
|
.binary { color: red; }
|
||||||
.odd td { background: #F5F5F5; }
|
.odd td { background: #F5F5F5; }
|
||||||
|
.time { color: Silver; font-size: 70%; float: right; margin-top: -3em; }
|
||||||
tr:hover td { background: #ddf; }
|
tr:hover td { background: #ddf; }
|
||||||
thead tr:hover td { background: transparent; }
|
thead tr:hover td { background: transparent; }
|
||||||
#menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; overflow: auto; overflow-y: hidden; white-space: nowrap; }
|
#menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; overflow: auto; overflow-y: hidden; white-space: nowrap; }
|
||||||
|
|
|
@ -216,4 +216,5 @@ $translations = array(
|
||||||
'Stop on error' => 'Zastavit při chybě',
|
'Stop on error' => 'Zastavit při chybě',
|
||||||
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Byl překročen maximální povolený počet polí. Zvyšte prosím %s a %s.',
|
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Byl překročen maximální povolený počet polí. Zvyšte prosím %s a %s.',
|
||||||
'(anywhere)' => '(kdekoliv)',
|
'(anywhere)' => '(kdekoliv)',
|
||||||
|
'%.3f s' => '%.3f s',
|
||||||
);
|
);
|
||||||
|
|
|
@ -26,6 +26,7 @@ if (!$error && $_POST) {
|
||||||
$empty = false;
|
$empty = false;
|
||||||
echo "<pre class='jush-sql'>" . htmlspecialchars(substr($query, 0, $match[0][1])) . "</pre>\n";
|
echo "<pre class='jush-sql'>" . htmlspecialchars(substr($query, 0, $match[0][1])) . "</pre>\n";
|
||||||
flush();
|
flush();
|
||||||
|
$start = explode(" ", microtime());
|
||||||
//! don't allow changing of character_set_results, convert encoding of displayed query
|
//! don't allow changing of character_set_results, convert encoding of displayed query
|
||||||
if (!$dbh->multi_query(substr($query, 0, $match[0][1]))) {
|
if (!$dbh->multi_query(substr($query, 0, $match[0][1]))) {
|
||||||
echo "<p class='error'>" . lang('Error in query') . ": " . htmlspecialchars($dbh->error) . "</p>\n";
|
echo "<p class='error'>" . lang('Error in query') . ": " . htmlspecialchars($dbh->error) . "</p>\n";
|
||||||
|
@ -33,6 +34,8 @@ if (!$error && $_POST) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$end = explode(" ", microtime());
|
||||||
|
echo "<p class='time'>" . lang('%.3f s', max(0, $end[0] - $start[0] + $end[1] - $start[1])) . "</p>\n";
|
||||||
do {
|
do {
|
||||||
$result = $dbh->store_result();
|
$result = $dbh->store_result();
|
||||||
if (is_object($result)) {
|
if (is_object($result)) {
|
||||||
|
|
Loading…
Reference in a new issue