rfe #1778337 [core] Try moving tables by RENAME and fail to CREATE/INSERT if that fails.
This commit is contained in:
@@ -565,12 +565,6 @@ class PMA_Table
|
||||
|
||||
/**
|
||||
* Copies or renames table
|
||||
* @todo use RENAME for move operations
|
||||
* - would work only if the databases are on the same filesystem,
|
||||
* how can we check that? try the operation and
|
||||
* catch an error?
|
||||
* - for views, only if MYSQL > 50013
|
||||
* - still have to handle pmadb synch.
|
||||
*
|
||||
* @author Michal Cihar <michal@cihar.com>
|
||||
*/
|
||||
@@ -578,6 +572,16 @@ class PMA_Table
|
||||
{
|
||||
global $err_url;
|
||||
|
||||
/* Try moving table directly */
|
||||
if ($move && $what == 'data') {
|
||||
$tbl = new PMA_Table($source_table, $source_db);
|
||||
$result = $tbl->rename($target_table, $target_db, PMA_Table::isView($source_db, $source_table));
|
||||
if ($result) {
|
||||
$GLOBALS['message'] = $tbl->getLastMessage();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// set export settings we need
|
||||
$GLOBALS['sql_backquotes'] = 1;
|
||||
$GLOBALS['asfile'] = 1;
|
||||
|
Reference in New Issue
Block a user