$query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . table($PROCEDURE) . "(" . implode(", ", $call) . ")";
$start = microtime(true);
$result = $connection->multi_query($query);
- echo $adminer->selectQuery($query, $start);
+ echo $adminer->selectQuery($query, $start, !$result);
if (!$result) {
echo "<p class='error'>" . error() . "\n";
$start = microtime(true);
$search = $this->_conn->query($query, $data);
if ($print) {
- echo $adminer->selectQuery("$query: " . print_r($data, true), $start);
+ echo $adminer->selectQuery("$query: " . print_r($data, true), $start, !$search);
}
if (!$search) {
return false;
/** Query printed in select before execution
* @param string query to be executed
* @param float start time of the query
+ * @param bool
* @return string
*/
- function selectQuery($query, $start) {
+ function selectQuery($query, $start, $failed = false) {
global $jush, $driver;
$return = "</p>\n"; // required for IE9 inline edit
- $warnings = $driver->warnings();
- if ($warnings) {
+ if (!$failed && ($warnings = $driver->warnings())) {
$id = "warnings";
$return = ", <a href='#$id'>" . lang('Warnings') . "</a>" . script("qsl('a').onclick = partial(toggle, '$id');", "")
. "$return<div id='$id' class='hidden'>\n$warnings</div>\n"
/** Query printed after execution in the message
* @param string executed query
* @param string elapsed time
+ * @param bool
* @return string
*/
- function messageQuery($query, $time) {
+ function messageQuery($query, $time, $failed = false) {
global $jush, $driver;
restart_session();
$history = &get_session("queries");
$history[$_GET["db"]][] = array($query, time(), $time); // not DB - $_GET["db"] is changed in database.inc.php //! respect $_GET["ns"]
$sql_id = "sql-" . count($history[$_GET["db"]]);
$return = "<a href='#$sql_id' class='toggle'>" . lang('SQL command') . "</a>\n";
- $warnings = $driver->warnings();
- if ($warnings) {
+ if (!$failed && ($warnings = $driver->warnings())) {
$id = "warnings-" . count($history[$_GET["db"]]);
$return = "<a href='#$id' class='toggle'>" . lang('Warnings') . "</a>, $return<div id='$id' class='hidden'>\n$warnings</div>\n";
}
$start = microtime(true);
$return = $this->_conn->query($query);
if ($print) {
- echo $adminer->selectQuery($query, $start);
+ echo $adminer->selectQuery($query, $start, !$return);
}
return $return;
}
}
$sql = "";
if ($query) {
- $sql = $adminer->messageQuery($query, $time);
+ $sql = $adminer->messageQuery($query, $time, $failed);
}
if ($failed) {
$error = error() . $sql . script("messagesPrint();");
}
}
- function selectQuery($query, $start) {
+ function selectQuery($query, $start, $failed = false) {
return "<!--\n" . str_replace("--", "--><!-- ", $query) . "\n(" . format_time($start) . ")\n-->\n";
}
return "";
}
- function messageQuery($query, $time) {
+ function messageQuery($query, $time, $failed = false) {
return " <span class='time'>" . @date("H:i:s") . "</span><!--\n" . str_replace("--", "--><!-- ", $query) . "\n" . ($time ? "($time)\n" : "") . "-->";
}
}
}
- function messageQuery($query, $time) {
+ function messageQuery($query, $time, $failed = false) {
//! doesn't work with sql.inc.php
$connection = connection();
$result = $connection->query('SHOW MASTER STATUS');
return $this->_applyPlugin(__FUNCTION__, $args);
}
- function selectQuery($query, $start) {
+ function selectQuery($query, $start, $failed = false) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
return $this->_applyPlugin(__FUNCTION__, $args);
}
- function messageQuery($query, $time) {
+ function messageQuery($query, $time, $failed = false) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
$this->filename = $filename;
}
- function messageQuery($query, $time) {
+ function messageQuery($query, $time, $failed = false) {
$this->_log($query);
}