Use separate connection for exploring indexes

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@649 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-06-03 18:34:57 +00:00
parent d2dfc5aa7c
commit fbebb08722
5 changed files with 47 additions and 41 deletions

View File

@@ -13,6 +13,10 @@ if (!$error && $_POST) {
$offset = 0;
$empty = true;
$space = "(\\s+|/\\*.*\\*/|(#|-- )[^\n]*\n|--\n)";
$dbh2 = (strlen($_GET["db"]) ? connect() : null); // connection for exploring indexes (to not replace FOUND_ROWS()) //! PDO - silent error
if (is_object($dbh2)) {
$dbh2->select_db($_GET["db"]);
}
while (rtrim($query)) {
if (!$offset && preg_match('~^\\s*DELIMITER\\s+(.+)~i', $query, $match)) {
$delimiter = $match[1];
@@ -39,7 +43,7 @@ if (!$error && $_POST) {
do {
$result = $dbh->store_result();
if (is_object($result)) {
select($result);
select($result, $dbh2);
} else {
if (preg_match("~^$space*(CREATE|DROP)$space+(DATABASE|SCHEMA)\\b~isU", $query)) {
unset($_SESSION["databases"][$_GET["server"]]);