Unlock session in alter database
This commit is contained in:
parent
4fe6bad829
commit
3e4c6d67e5
|
@ -2,7 +2,6 @@
|
||||||
$row = $_POST;
|
$row = $_POST;
|
||||||
|
|
||||||
if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP changes add.x to add_x
|
if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP changes add.x to add_x
|
||||||
restart_session();
|
|
||||||
$name = trim($row["name"]);
|
$name = trim($row["name"]);
|
||||||
if ($_POST["drop"]) {
|
if ($_POST["drop"]) {
|
||||||
$_GET["db"] = ""; // to save in global history
|
$_GET["db"] = ""; // to save in global history
|
||||||
|
@ -24,6 +23,8 @@ if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP c
|
||||||
$last = $db;
|
$last = $db;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
restart_session();
|
||||||
|
set_session("dbs", null);
|
||||||
queries_redirect(ME . "db=" . urlencode($last), lang('Database has been created.'), $success);
|
queries_redirect(ME . "db=" . urlencode($last), lang('Database has been created.'), $success);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -584,7 +584,6 @@ if (!defined("DRIVER")) {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function create_database($db, $collation) {
|
function create_database($db, $collation) {
|
||||||
set_session("dbs", null);
|
|
||||||
return queries("CREATE DATABASE " . idf_escape($db) . ($collation ? " COLLATE " . q($collation) : ""));
|
return queries("CREATE DATABASE " . idf_escape($db) . ($collation ? " COLLATE " . q($collation) : ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -593,9 +592,10 @@ if (!defined("DRIVER")) {
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function drop_databases($databases) {
|
function drop_databases($databases) {
|
||||||
|
$return = apply_queries("DROP DATABASE", $databases, 'idf_escape');
|
||||||
restart_session();
|
restart_session();
|
||||||
set_session("dbs", null);
|
set_session("dbs", null);
|
||||||
return apply_queries("DROP DATABASE", $databases, 'idf_escape');
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Rename database from DB
|
/** Rename database from DB
|
||||||
|
@ -604,18 +604,21 @@ if (!defined("DRIVER")) {
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function rename_database($name, $collation) {
|
function rename_database($name, $collation) {
|
||||||
|
$return = false;
|
||||||
if (create_database($name, $collation)) {
|
if (create_database($name, $collation)) {
|
||||||
//! move triggers
|
//! move triggers
|
||||||
$rename = array();
|
$rename = array();
|
||||||
foreach (tables_list() as $table => $type) {
|
foreach (tables_list() as $table => $type) {
|
||||||
$rename[] = table($table) . " TO " . idf_escape($name) . "." . table($table);
|
$rename[] = table($table) . " TO " . idf_escape($name) . "." . table($table);
|
||||||
}
|
}
|
||||||
if (!$rename || queries("RENAME TABLE " . implode(", ", $rename))) {
|
$return = (!$rename || queries("RENAME TABLE " . implode(", ", $rename)));
|
||||||
|
if ($return) {
|
||||||
queries("DROP DATABASE " . idf_escape(DB));
|
queries("DROP DATABASE " . idf_escape(DB));
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
restart_session();
|
||||||
|
set_session("dbs", null);
|
||||||
}
|
}
|
||||||
return false;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Generate modifier for auto increment column
|
/** Generate modifier for auto increment column
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
Adminer 4.1.1-dev:
|
Adminer 4.1.1-dev:
|
||||||
Fix reading routine column collations
|
Fix reading routine column collations
|
||||||
|
Unlock session in alter database
|
||||||
MySQL: Use utf8mb4 if available
|
MySQL: Use utf8mb4 if available
|
||||||
|
|
||||||
Adminer 4.1.0 (released 2014-04-18)
|
Adminer 4.1.0 (released 2014-04-18)
|
||||||
|
|
Loading…
Reference in a new issue