block table rename if newname empty
This commit is contained in:
@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
|
||||
$Id$
|
||||
$Source$
|
||||
|
||||
2001-07-17 Steve Alberty <alberty@neptunlabs.de>
|
||||
* tbl_addfield.php3: add trouble detection if insert field failed
|
||||
* tbl_rename.php3,tbl_copy.php3: block table rename if newname empty
|
||||
|
||||
2001-07-16 Marc Delisle <lem9@users.sourceforge.net>
|
||||
* tbl_change.php3, bug 441689, "Insert as new row" was not copying blobs.
|
||||
|
@@ -16,6 +16,8 @@ function my_handler($sql_insert)
|
||||
$sql_query = $sql_insert;
|
||||
}
|
||||
|
||||
if (isset($new_name)) $new_name=trim($new_name); // Cleanup to suppress '' tables
|
||||
if (isset($new_name) && $new_name!=""){
|
||||
$sql_structure = get_table_def($db, $table, "\n");
|
||||
// speedup copy table - staybyte - 22. Juni 2001
|
||||
if(MYSQL_MAJOR_VERSION >= "3.23"){
|
||||
@@ -30,15 +32,14 @@ else{
|
||||
$sql_structure = ereg_replace("CREATE TABLE $table", "CREATE TABLE $new_name", $sql_structure);
|
||||
$result = mysql_query($sql_structure) or mysql_die();
|
||||
}
|
||||
}
|
||||
else mysql_die($strTableEmpty);
|
||||
|
||||
if (isset($sql_query))
|
||||
$sql_query .= "\n$sql_structure";
|
||||
else
|
||||
$sql_query = "$sql_structure";
|
||||
|
||||
//$sql_query .= "\n$sql_structure";
|
||||
|
||||
|
||||
if(MYSQL_MAJOR_VERSION < "3.23" && $what == "data") get_table_content($db, $table, "my_handler");
|
||||
|
||||
eval("\$message = \"$strCopyTableOK\";");
|
||||
|
@@ -4,15 +4,24 @@
|
||||
|
||||
require("./grab_globals.inc.php3");
|
||||
|
||||
if (isset($new_name)) $new_name=trim($new_name); // Cleanup to suppress '' tables
|
||||
if (isset($new_name) && $new_name!=""){
|
||||
|
||||
$old_name = $table;
|
||||
$table = $new_name;
|
||||
require("./header.inc.php3");
|
||||
|
||||
include("./header.inc.php3");
|
||||
|
||||
mysql_select_db($db);
|
||||
$result = mysql_query("ALTER TABLE $old_name RENAME $new_name") or mysql_die();
|
||||
$table = $old_name;
|
||||
eval("\$message = \"$strRenameTableOK\";");
|
||||
$table = $new_name;
|
||||
}
|
||||
else{
|
||||
include("./header.inc.php3");
|
||||
mysql_die($strTableEmpty);
|
||||
}
|
||||
|
||||
require("./tbl_properties.php3");
|
||||
?>
|
||||
|
Reference in New Issue
Block a user