Tab characters should be 4 spaces
This commit is contained in:
@@ -133,10 +133,10 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
|
|||||||
// the real views are created after the tables
|
// the real views are created after the tables
|
||||||
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
|
// 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_query($sql_view_standin);
|
PMA_DBI_query($sql_view_standin);
|
||||||
$GLOBALS['sql_query'] .= "\n" . $sql_view_standin . ';';
|
$GLOBALS['sql_query'] .= "\n" . $sql_view_standin . ';';
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,19 +194,19 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
|
|||||||
|
|
||||||
// handle the views
|
// handle the views
|
||||||
if (! $_error) {
|
if (! $_error) {
|
||||||
// temporarily force to add DROP IF EXIST to CREATE VIEW query,
|
// temporarily force to add DROP IF EXIST to CREATE VIEW query,
|
||||||
// to remove stand-in VIEW that was created earlier
|
// to remove stand-in VIEW that was created earlier
|
||||||
$temp_drop_if_exists = $GLOBALS['drop_if_exists'];
|
$temp_drop_if_exists = $GLOBALS['drop_if_exists'];
|
||||||
$GLOBALS['drop_if_exists'] = 'true';
|
$GLOBALS['drop_if_exists'] = 'true';
|
||||||
|
|
||||||
foreach ($views as $view) {
|
foreach ($views as $view) {
|
||||||
if (! PMA_Table::moveCopy($db, $view, $newname, $view, 'structure', $move, 'db_copy')) {
|
if (! PMA_Table::moveCopy($db, $view, $newname, $view, 'structure', $move, 'db_copy')) {
|
||||||
$_error = true;
|
$_error = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// restore previous value
|
// restore previous value
|
||||||
$GLOBALS['drop_if_exists'] = $temp_drop_if_exists;
|
$GLOBALS['drop_if_exists'] = $temp_drop_if_exists;
|
||||||
}
|
}
|
||||||
unset($view, $views);
|
unset($view, $views);
|
||||||
|
|
||||||
@@ -222,27 +222,27 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
|
|||||||
unset($GLOBALS['sql_constraints_query_full_db'], $one_query);
|
unset($GLOBALS['sql_constraints_query_full_db'], $one_query);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PMA_MYSQL_INT_VERSION >= 50100) {
|
if (PMA_MYSQL_INT_VERSION >= 50100) {
|
||||||
// here DELIMITER is not used because it's not part of the
|
// here DELIMITER is not used because it's not part of the
|
||||||
// language; each statement is sent one by one
|
// language; each statement is sent one by one
|
||||||
|
|
||||||
// to avoid selecting alternatively the current and new db
|
// to avoid selecting alternatively the current and new db
|
||||||
// we would need to modify the CREATE definitions to qualify
|
// we would need to modify the CREATE definitions to qualify
|
||||||
// the db name
|
// the db name
|
||||||
$event_names = PMA_DBI_fetch_result('SELECT EVENT_NAME FROM information_schema.EVENTS WHERE EVENT_SCHEMA= \'' . PMA_sqlAddslashes($db,true) . '\';');
|
$event_names = PMA_DBI_fetch_result('SELECT EVENT_NAME FROM information_schema.EVENTS WHERE EVENT_SCHEMA= \'' . PMA_sqlAddslashes($db,true) . '\';');
|
||||||
if ($event_names) {
|
if ($event_names) {
|
||||||
foreach($event_names as $event_name) {
|
foreach($event_names as $event_name) {
|
||||||
PMA_DBI_select_db($db);
|
PMA_DBI_select_db($db);
|
||||||
$tmp_query = PMA_DBI_get_definition($db, 'EVENT', $event_name);
|
$tmp_query = PMA_DBI_get_definition($db, 'EVENT', $event_name);
|
||||||
// collect for later display
|
// collect for later display
|
||||||
$GLOBALS['sql_query'] .= "\n" . $tmp_query;
|
$GLOBALS['sql_query'] .= "\n" . $tmp_query;
|
||||||
PMA_DBI_select_db($newname);
|
PMA_DBI_select_db($newname);
|
||||||
PMA_DBI_query($tmp_query);
|
PMA_DBI_query($tmp_query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// go back to current db, just in case
|
// go back to current db, just in case
|
||||||
PMA_DBI_select_db($db);
|
PMA_DBI_select_db($db);
|
||||||
|
|
||||||
// Duplicate the bookmarks for this db (done once for each db)
|
// Duplicate the bookmarks for this db (done once for each db)
|
||||||
if (! $_error && $db != $newname) {
|
if (! $_error && $db != $newname) {
|
||||||
|
Reference in New Issue
Block a user