[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_6RC1-20776-g328defc

Marc Delisle lem9 at users.sourceforge.net
Mon Oct 10 13:26:30 CEST 2011


The branch, master has been updated
       via  328defc9d99f6cb6e9450a6b708474923908faea (commit)
       via  6fec80c61445dc11b4ff3023947b9882e163d382 (commit)
      from  6e1258f95460eb244ff1807cc956e394ec1d7de7 (commit)


- Log -----------------------------------------------------------------
commit 328defc9d99f6cb6e9450a6b708474923908faea
Merge: 6e1258f 6fec80c
Author: Marc Delisle <marc at infomarc.info>
Date:   Mon Oct 10 07:25:52 2011 -0400

    bug [view] View renaming did not work

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                 |    1 +
 libraries/Table.class.php |   16 +++++++---------
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 83d7660..a5ca9e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -54,6 +54,7 @@ phpMyAdmin - ChangeLog
 3.4.7.0 (not yet released)
 - bug #3418610 [interface] Links in navigation when $cfg['MainPageIconic'] = false
 - bug #3418849 [interface] Inline edit shows dropdowns even after closing
+- bug [view] View renaming did not work
 
 3.4.6.0 (not yet released)
 - patch #3404173 InnoDB comment display with tooltips/aliases
diff --git a/libraries/Table.class.php b/libraries/Table.class.php
index 34b144a..7878b8e 100644
--- a/libraries/Table.class.php
+++ b/libraries/Table.class.php
@@ -1104,6 +1104,7 @@ class PMA_Table
      * @param string $new_name new table name
      * @param string $new_db   new database name
      * @param bool   $is_view  is this for a VIEW rename?
+     * @todo    remove the $is_view parameter (also in callers)
      *
      * @return bool success
      */
@@ -1130,15 +1131,12 @@ class PMA_Table
             return false;
         }
 
-        if (! $is_view) {
-            $GLOBALS['sql_query'] = '
-                RENAME TABLE ' . $this->getFullName(true) . '
-                      TO ' . $new_table->getFullName(true) . ';';
-        } else {
-            $GLOBALS['sql_query'] = '
-                ALTER TABLE ' . $this->getFullName(true) . '
-                RENAME ' . $new_table->getFullName(true) . ';';
-        }
+        /*
+         * tested also for a view, in MySQL 5.0.92, 5.1.55 and 5.5.13
+         */
+        $GLOBALS['sql_query'] = '
+            RENAME TABLE ' . $this->getFullName(true) . '
+                  TO ' . $new_table->getFullName(true) . ';';
         // I don't think a specific error message for views is necessary
         if (! PMA_DBI_query($GLOBALS['sql_query'])) {
             $this->errors[] = sprintf(


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list