mirror of
https://github.com/vrana/adminer.git
synced 2025-08-15 19:13: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
|
$start = explode(" ", microtime()); // microtime(true) is available since PHP 5
|
||||||
//! 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 ($connection->multi_query($q)) {
|
if ($connection->multi_query($q) && is_object($connection2) && preg_match("~^$space*USE\\b~isU", $q)) {
|
||||||
if (is_object($connection2) && preg_match("~^$space*USE\\b~isU", $q)) {
|
|
||||||
$connection2->query($q);
|
$connection2->query($q);
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
$result = $connection->store_result();
|
$result = $connection->store_result();
|
||||||
$end = explode(" ", microtime());
|
$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
|
$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 ($connection->error) {
|
||||||
if (preg_match("~^$space*(CREATE|DROP|ALTER)$space+(DATABASE|SCHEMA)\\b~isU", $q)) {
|
echo ($_POST["only_errors"] ? $print : "");
|
||||||
restart_session();
|
echo "<p class='error'>" . lang('Error in query') . ": " . error() . "\n";
|
||||||
set_session("dbs", null); // clear cache
|
$errors[] = " <a href='#sql-$commands'>$commands</a>";
|
||||||
session_write_close();
|
if ($_POST["error_stops"]) {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (!$_POST["only_errors"]) {
|
} elseif (is_object($result)) {
|
||||||
echo "<p class='message' title='" . h($connection->info) . "'>" . lang('Query executed OK, %d row(s) affected.', $connection->affected_rows) . "$time\n";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
select($result, $connection2);
|
select($result, $connection2);
|
||||||
if (!$_POST["only_errors"]) {
|
if (!$_POST["only_errors"]) {
|
||||||
echo "<form action='' method='post'>\n";
|
echo "<form action='' method='post'>\n";
|
||||||
@@ -132,17 +129,18 @@ if (!$error && $_POST) {
|
|||||||
}
|
}
|
||||||
echo "</form>\n";
|
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;
|
$start = $end;
|
||||||
} while ($connection->next_result());
|
} 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);
|
$query = substr($query, $offset);
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user