Merge branch 'QA_3_3'

This commit is contained in:
Dieter Adriaenssens
2010-11-14 21:08:28 +01:00
2 changed files with 21 additions and 13 deletions

View File

@@ -124,6 +124,7 @@
- patch #3101490 Default function for TIMESTAMP, thanks to jirand - jirand - patch #3101490 Default function for TIMESTAMP, thanks to jirand - jirand
- bug #3103853 [js] Double quotes were not escaped in generated js - bug #3103853 [js] Double quotes were not escaped in generated js
- bug #3077463 [core] Events were not copied when copying/renaming database - bug #3077463 [core] Events were not copied when copying/renaming database
- bug #1762306 [core] Copy database with view of a view
3.3.8.0 (2010-10-25) 3.3.8.0 (2010-10-25)
- bug #3059311 [import] BIGINT field type added to table analysis - bug #3059311 [import] BIGINT field type added to table analysis

View File

@@ -128,14 +128,15 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
foreach ($tables_full as $each_table => $tmp) { foreach ($tables_full as $each_table => $tmp) {
// to be able to rename a db containing views, we // to be able to rename a db containing views,
// first collect in $views all the views we find and we // first all the views are collected and a stand-in is created
// will handle them after the tables // the real views are created after the tables
/**
* @todo support a view of a view
*/
if (PMA_Table::isView($db, $each_table)) { if (PMA_Table::isView($db, $each_table)) {
$views[] = $each_table; $views[] = $each_table;
// Create stand-in definition to resolve view dependencies
$sql_view_standin = PMA_getTableDefStandIn($db, $each_table, "\n");
PMA_DBI_query($sql_view_standin);
$GLOBALS['sql_query'] .= "\n" . $sql_view_standin . ';';
continue; continue;
} }
@@ -193,13 +194,19 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
// handle the views // handle the views
if (! $_error) { if (! $_error) {
foreach ($views as $view) { // temporarily force to add DROP IF EXIST to CREATE VIEW query,
if (! PMA_Table::moveCopy($db, $view, $newname, $view, // to remove stand-in VIEW that was created earlier
'structure', $move, 'db_copy')) { $temp_drop_if_exists = $GLOBALS['drop_if_exists'];
$_error = true; $GLOBALS['drop_if_exists'] = 'true';
break;
} foreach ($views as $view) {
} if (! PMA_Table::moveCopy($db, $view, $newname, $view, 'structure', $move, 'db_copy')) {
$_error = true;
break;
}
}
// restore previous value
$GLOBALS['drop_if_exists'] = $temp_drop_if_exists;
} }
unset($view, $views); unset($view, $views);