Clear cache only for MySQL

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1520 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2010-05-05 16:29:17 +00:00
parent cc04be2eb2
commit 4809139347
2 changed files with 2 additions and 2 deletions

View file

@ -2,11 +2,9 @@
if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP changes add.x to add_x
restart_session();
if ($_POST["drop"]) {
set_session("databases", null);
queries_redirect(remove_from_uri("db|database"), lang('Database has been dropped.'), drop_databases(array(DB)));
} elseif (DB !== $_POST["name"]) {
// create or rename database
set_session("databases", null); // clear cache
if (DB != "") {
queries_redirect(preg_replace('~db=[^&]*&~', '', ME) . "db=" . urlencode($_POST["name"]), lang('Database has been renamed.'), rename_database($_POST["name"], $_POST["collation"]));
} else {

View file

@ -506,6 +506,7 @@ if (!defined("DRIVER")) {
* @return string
*/
function create_database($db, $collation) {
set_session("databases", null);
return queries("CREATE DATABASE " . idf_escape($db) . ($collation ? " COLLATE " . $connection->quote($collation) : ""));
}
@ -514,6 +515,7 @@ if (!defined("DRIVER")) {
* @return bool
*/
function drop_databases($databases) {
set_session("databases", null);
foreach ($databases as $db) {
if (!queries("DROP DATABASE " . idf_escape($db))) {
return false;