bug #3306875 [edit] Can't rename a database that contains views

This commit is contained in:
Madhura Jayaratne
2011-12-06 18:41:04 +05:30
parent b02f4eec07
commit 5f78897bc8
2 changed files with 8 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ phpMyAdmin - ChangeLog
- bug #3438420 [core] Magic quotes removed in PHP 5.4 - bug #3438420 [core] Magic quotes removed in PHP 5.4
- bug #3398788 [session] No feedback when result is empty (signon auth_type) - bug #3398788 [session] No feedback when result is empty (signon auth_type)
- bug #3384035 [display] Problems regarding ShowTooltipAliasTB - bug #3384035 [display] Problems regarding ShowTooltipAliasTB
- bug #3306875 [edit] Can't rename a database that contains views
3.4.8.0 (2011-12-01) 3.4.8.0 (2011-12-01)
- bug #3425230 [interface] enum data split at space char (more space to edit) - bug #3425230 [interface] enum data split at space char (more space to edit)

View File

@@ -124,7 +124,6 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
} }
unset($sql_constraints, $sql_drop_foreign_keys, $sql_structure); unset($sql_constraints, $sql_drop_foreign_keys, $sql_structure);
foreach ($tables_full as $each_table => $tmp) { foreach ($tables_full as $each_table => $tmp) {
// to be able to rename a db containing views, // to be able to rename a db containing views,
// first all the views are collected and a stand-in is created // first all the views are collected and a stand-in is created
@@ -133,11 +132,17 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
$views[] = $each_table; $views[] = $each_table;
// Create stand-in definition to resolve view dependencies // Create stand-in definition to resolve view dependencies
$sql_view_standin = PMA_getTableDefStandIn($db, $each_table, "\n"); $sql_view_standin = PMA_getTableDefStandIn($db, $each_table, "\n");
PMA_DBI_select_db($newname);
PMA_DBI_query($sql_view_standin); PMA_DBI_query($sql_view_standin);
$GLOBALS['sql_query'] .= "\n" . $sql_view_standin . ';'; $GLOBALS['sql_query'] .= "\n" . $sql_view_standin . ';';
}
}
foreach ($tables_full as $each_table => $tmp) {
// skip the views; we have creted stand-in definitions
if (PMA_Table::isView($db, $each_table)) {
continue; continue;
} }
$back = $sql_query; $back = $sql_query;
$sql_query = ''; $sql_query = '';