From c33ffe813893c937e3362e8b030e5e66e9bf5de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 21 Jan 2010 11:22:52 +0000 Subject: [PATCH] rfe #1778337 [core] Try moving tables by RENAME and fail to CREATE/INSERT if that fails. --- ChangeLog | 1 + libraries/Table.class.php | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index f9326e9e3..247ca7c3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA + [core] Remove config data from session as it brings chicken-egg problem. + [core] Cookie path now honors PmaAbsoluteUri. + rfe #2393597 [core] phpMyAdmin honors https in PmaAbsoluteUri. ++ rfe #1778337 [core] Try moving tables by RENAME and fail to CREATE/INSERT if that fails. 3.3.0.0 (not yet released) + rfe #2308632 [edit] Use hex for (var)binary fields, diff --git a/libraries/Table.class.php b/libraries/Table.class.php index 2c6208a25..8055dbc09 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -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 */ @@ -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;