diff --git a/adminer/drivers/elastic.inc.php b/adminer/drivers/elastic.inc.php
index 413a67b1..289f9022 100644
--- a/adminer/drivers/elastic.inc.php
+++ b/adminer/drivers/elastic.inc.php
@@ -139,10 +139,11 @@ if (isset($_GET["elastic"])) {
if ($data["query"] && !$data["query"]["filtered"]["query"]) {
$data["query"]["filtered"]["query"] = array("match_all" => array());
}
- if ($print) {
- echo $adminer->selectQuery("$query: " . print_r($data, true));
- }
+ $start = microtime(true);
$search = $this->_conn->query($query, $data);
+ if ($print) {
+ echo $adminer->selectQuery("$query: " . print_r($data, true), format_time($start, microtime(true)));
+ }
if (!$search) {
return false;
}
diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php
index 500f56d4..9d68dc1c 100644
--- a/adminer/include/adminer.inc.php
+++ b/adminer/include/adminer.inc.php
@@ -177,11 +177,12 @@ username.form['auth[driver]'].onchange();
/** Query printed in select before execution
* @param string query to be executed
+ * @param string elapsed time
* @return string
*/
- function selectQuery($query) {
+ function selectQuery($query, $time) {
global $jush;
- return "
" . h(str_replace("\n", " ", $query)) . "
"
+ return "
" . h(str_replace("\n", " ", $query)) . "
($time)"
. (support("sql") ? " " . lang('Edit') . "" : "")
. "
" // - required for IE9 inline edit
;
@@ -500,9 +501,10 @@ username.form['auth[driver]'].onchange();
/** Query printed after execution in the message
* @param string executed query
+ * @param string elapsed time
* @return string
*/
- function messageQuery($query) {
+ function messageQuery($query, $time) {
global $jush;
restart_session();
$history = &get_session("queries");
@@ -510,9 +512,10 @@ username.form['auth[driver]'].onchange();
if (strlen($query) > 1e6) {
$query = preg_replace('~[\x80-\xFF]+$~', '', substr($query, 0, 1e6)) . "\n..."; // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
}
- $history[$_GET["db"]][] = array($query, time()); // not DB - $_GET["db"] is changed in database.inc.php //! respect $_GET["ns"]
+ $history[$_GET["db"]][] = array($query, time(), $time); // not DB - $_GET["db"] is changed in database.inc.php //! respect $_GET["ns"]
return " " . @date("H:i:s") . " " . lang('SQL command') . "" // @ - time zone may be not set
. "" . shorten_utf8($query, 1000) . '
'
+ . ($time ? "
($time)" : '')
. (support("sql") ? '
' . lang('Edit') . '' : '')
. '
'
;
diff --git a/adminer/include/driver.inc.php b/adminer/include/driver.inc.php
index 25bd0217..c0b4b9ad 100644
--- a/adminer/include/driver.inc.php
+++ b/adminer/include/driver.inc.php
@@ -45,7 +45,7 @@
$start = microtime(true);
$return = $this->_conn->query($query);
if ($print) {
- echo $adminer->selectQuery($query . ";\n-- " . format_time($start, microtime(true)));
+ echo $adminer->selectQuery($query, format_time($start, microtime(true)));
}
return $return;
}
diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php
index 76e4aa2e..4da94da2 100644
--- a/adminer/include/editing.inc.php
+++ b/adminer/include/editing.inc.php
@@ -111,9 +111,9 @@ function referencable_primary($self) {
/** Print SQL