rename db problem

This commit is contained in:
Marc Delisle
2005-06-24 11:29:22 +00:00
parent a3112089c1
commit e69122d0e6
2 changed files with 8 additions and 1 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2005-06-24 Marc Delisle <lem9@users.sourceforge.net>
* db_operations.php: problem renaming a db
2005-06-22 Alexander M. Turek <me@derrabus.de> 2005-06-22 Alexander M. Turek <me@derrabus.de>
* lang/german-*.inc.php: Updates. * lang/german-*.inc.php: Updates.

View File

@@ -2,6 +2,7 @@
/* $Id$ */ /* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4: // vim: expandtab sw=4 ts=4 sts=4:
error_reporting(E_ALL);
require_once('./libraries/grab_globals.lib.php'); require_once('./libraries/grab_globals.lib.php');
require_once('./libraries/common.lib.php'); require_once('./libraries/common.lib.php');
require_once('./libraries/mysql_charsets.lib.php'); require_once('./libraries/mysql_charsets.lib.php');
@@ -25,7 +26,8 @@ if (isset($db) &&
if (!isset($newname) || empty($newname)) { if (!isset($newname) || empty($newname)) {
$message = $strDatabaseEmpty; $message = $strDatabaseEmpty;
} else { } else {
if ($create_database_before_copying) { if ($move ||
(isset($create_database_before_copying) && $create_database_before_copying)) {
$local_query = 'CREATE DATABASE ' . PMA_backquote($newname); $local_query = 'CREATE DATABASE ' . PMA_backquote($newname);
if (isset($db_collation)) { if (isset($db_collation)) {
$local_query .= ' DEFAULT' . PMA_generateCharsetQueryPart($db_collation); $local_query .= ' DEFAULT' . PMA_generateCharsetQueryPart($db_collation);
@@ -63,6 +65,7 @@ if (isset($db) &&
$sql_query = $back . $sql_query; $sql_query = $back . $sql_query;
} }
unset($table);
// Duplicate the bookmarks for this db (done once for each db) // Duplicate the bookmarks for this db (done once for each db)
if ($db != $newname) { if ($db != $newname) {
@@ -198,6 +201,7 @@ if ($cfgRelation['commwork']) {
<form method="post" action="db_operations.php" <form method="post" action="db_operations.php"
onsubmit="return emptyFormElements(this, 'newname')"> onsubmit="return emptyFormElements(this, 'newname')">
<tr bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><td colspan="2"><?php <tr bgcolor="<?php echo $cfg['BgcolorOne']; ?>"><td colspan="2"><?php
echo '<input type="hidden" name="what" value="data" />';
echo '<input type="hidden" name="db_rename" value="true" />' echo '<input type="hidden" name="db_rename" value="true" />'
. PMA_generate_common_hidden_inputs($db); . PMA_generate_common_hidden_inputs($db);
?><input type="text" name="newname" size="30" class="textfield" value="" /></td> ?><input type="text" name="newname" size="30" class="textfield" value="" /></td>