mirror of
https://github.com/vrana/adminer.git
synced 2025-08-14 02:23:59 +02:00
Display "EXPLAIN SELECT invalid_column" error (thanks to Michal Vrabel)
This commit is contained in:
@@ -92,24 +92,21 @@ if (!$error && $_POST) {
|
||||
}
|
||||
$start = explode(" ", microtime()); // microtime(true) is available since PHP 5
|
||||
//! don't allow changing of character_set_results, convert encoding of displayed query
|
||||
if ($connection->multi_query($q)) {
|
||||
if (is_object($connection2) && preg_match("~^$space*USE\\b~isU", $q)) {
|
||||
if ($connection->multi_query($q) && is_object($connection2) && preg_match("~^$space*USE\\b~isU", $q)) {
|
||||
$connection2->query($q);
|
||||
}
|
||||
do {
|
||||
$result = $connection->store_result();
|
||||
$end = explode(" ", microtime());
|
||||
$time = format_time($start, $end) . (strlen($q) < 1000 ? " <a href='" . h(ME) . "sql=" . urlencode(trim($q)) . "'>" . lang('Edit') . "</a>" : ""); // 1000 - maximum length of encoded URL in IE is 2083 characters
|
||||
if (!is_object($result)) {
|
||||
if (preg_match("~^$space*(CREATE|DROP|ALTER)$space+(DATABASE|SCHEMA)\\b~isU", $q)) {
|
||||
restart_session();
|
||||
set_session("dbs", null); // clear cache
|
||||
session_write_close();
|
||||
if ($connection->error) {
|
||||
echo ($_POST["only_errors"] ? $print : "");
|
||||
echo "<p class='error'>" . lang('Error in query') . ": " . error() . "\n";
|
||||
$errors[] = " <a href='#sql-$commands'>$commands</a>";
|
||||
if ($_POST["error_stops"]) {
|
||||
break;
|
||||
}
|
||||
if (!$_POST["only_errors"]) {
|
||||
echo "<p class='message' title='" . h($connection->info) . "'>" . lang('Query executed OK, %d row(s) affected.', $connection->affected_rows) . "$time\n";
|
||||
}
|
||||
} else {
|
||||
} elseif (is_object($result)) {
|
||||
select($result, $connection2);
|
||||
if (!$_POST["only_errors"]) {
|
||||
echo "<form action='' method='post'>\n";
|
||||
@@ -132,17 +129,18 @@ if (!$error && $_POST) {
|
||||
}
|
||||
echo "</form>\n";
|
||||
}
|
||||
} else {
|
||||
if (preg_match("~^$space*(CREATE|DROP|ALTER)$space+(DATABASE|SCHEMA)\\b~isU", $q)) {
|
||||
restart_session();
|
||||
set_session("dbs", null); // clear cache
|
||||
session_write_close();
|
||||
}
|
||||
if (!$_POST["only_errors"]) {
|
||||
echo "<p class='message' title='" . h($connection->info) . "'>" . lang('Query executed OK, %d row(s) affected.', $connection->affected_rows) . "$time\n";
|
||||
}
|
||||
}
|
||||
$start = $end;
|
||||
} while ($connection->next_result());
|
||||
} elseif ($connection->error) {
|
||||
echo ($_POST["only_errors"] ? $print : "");
|
||||
echo "<p class='error'>" . lang('Error in query') . ": " . error() . "\n";
|
||||
$errors[] = " <a href='#sql-$commands'>$commands</a>";
|
||||
if ($_POST["error_stops"]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
$query = substr($query, $offset);
|
||||
$offset = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user