} unset($views); // now that all tables exist, create all the accumulated constraints if (!$_error && count($sqlConstratints) > 0) { PMA_createAllAccumulatedConstraints($sqlConstratints); } unset($sqlConstratints); 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 PMA_runEventDefinitionsForDb($GLOBALS['db']); } // go back to current db, just in case $GLOBALS['dbi']->selectDb($GLOBALS['db']); // Duplicate the bookmarks for this db (done once for each db) PMA_duplicateBookmarks($_error, $GLOBALS['db']); if (!$_error && $move) { if (isset($_REQUEST['adjust_privileges']) && !empty($_REQUEST['adjust_privileges'])) { PMA_AdjustPrivileges_moveDB($GLOBALS['db'], $_REQUEST['newname']); } /** * cleanup pmadb stuff for this db */ include_once 'libraries/relation_cleanup.lib.php'; PMA_relationsCleanupDatabase($GLOBALS['db']); // if someday the RENAME DATABASE reappears, do not DROP $local_query = 'DROP DATABASE ' . PMA\libraries\Util::backquote($GLOBALS['db']) . ';'; $sql_query .= "\n" . $local_query; $GLOBALS['dbi']->query($local_query); $message = PMA\libraries\Message::success(__('Database %1$s has been renamed to %2$s.')); $message->addParam($GLOBALS['db']);
$_error = PMA_handleTheViews($views, $move, $db); } unset($views); // now that all tables exist, create all the accumulated constraints if (!$_error && count($GLOBALS['sql_constraints_query_full_db']) > 0) { PMA_createAllAccumulatedConstraints(); } if (!PMA_DRIZZLE && 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 PMA_runEventDefinitionsForDb($db); } // go back to current db, just in case $GLOBALS['dbi']->selectDb($db); // Duplicate the bookmarks for this db (done once for each db) PMA_duplicateBookmarks($_error, $db); if (!$_error && $move) { /** * cleanup pmadb stuff for this db */ include_once 'libraries/relation_cleanup.lib.php'; PMA_relationsCleanupDatabase($db); // if someday the RENAME DATABASE reappears, do not DROP $local_query = 'DROP DATABASE ' . PMA_Util::backquote($db) . ';'; $sql_query .= "\n" . $local_query; $GLOBALS['dbi']->query($local_query); $message = PMA_Message::success(__('Database %1$s has been renamed to %2$s.')); $message->addParam($db); $message->addParam($_REQUEST['newname']); } elseif (!$_error) { $message = PMA_Message::success(__('Database %1$s has been copied to %2$s.'));