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