[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_0BETA1-1409-gcfca67f

Marc Delisle lem9 at users.sourceforge.net
Mon Jan 3 14:05:14 CET 2011


The branch, master has been updated
       via  cfca67f4229d480b34dc5e5ca49cb3ea5e2bb911 (commit)
       via  55cd2fd898dc2f0aa01c9ef18a4c24f3e25598db (commit)
      from  af4b01024a47127dfaf925353e6e7318f3dcc9c7 (commit)


- Log -----------------------------------------------------------------
commit cfca67f4229d480b34dc5e5ca49cb3ea5e2bb911
Merge: af4b01024a47127dfaf925353e6e7318f3dcc9c7 55cd2fd898dc2f0aa01c9ef18a4c24f3e25598db
Author: Marc Delisle <marc at infomarc.info>
Date:   Mon Jan 3 08:03:41 2011 -0500

    Merge branch 'QA_3_3'

commit 55cd2fd898dc2f0aa01c9ef18a4c24f3e25598db
Author: Madhura Jayaratne <madhuracj at users.sourceforge.net>
Date:   Mon Jan 3 08:02:28 2011 -0500

    patch #3150164 [structure] Ordering by size gives incorrect results

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

Summary of changes:
 ChangeLog                            |    2 ++
 libraries/database_interface.lib.php |   12 ++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d1ab4ec..5f20f7c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -132,6 +132,8 @@
 3.3.10.0 (not yet released)
 - patch #3147400 [structure] Aria table size printed as unknown,
   thanks to erickoh75 - erickoh75
+- patch #3150164 [structure] Ordering by size gives incorrect results,
+  thanks to Madhura Jayaratne - madhuracj 
 
 3.3.9.0 (2011-01-03)
 - bug [doc] Fix references to MySQL doc
diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php
index d5754a4..0877dda 100644
--- a/libraries/database_interface.lib.php
+++ b/libraries/database_interface.lib.php
@@ -355,8 +355,16 @@ function PMA_DBI_get_tables_full($database, $table = false, $tbl_is_group = fals
             } else {
                 // Prepare to sort by creating array of the selected sort
                 // value to pass to array_multisort
-                foreach ($each_tables as $table_name => $table_data) {
-                    ${$sort_by}[$table_name] = strtolower($table_data[$sort_by]);
+
+                // Size = Data_length + Index_length
+                if ($sort_by == 'Data_length') {
+                    foreach ($each_tables as $table_name => $table_data) {
+                        ${$sort_by}[$table_name] = strtolower($table_data['Data_length'] + $table_data['Index_length']);
+                    }
+                } else {
+                    foreach ($each_tables as $table_name => $table_data) {
+                        ${$sort_by}[$table_name] = strtolower($table_data[$sort_by]);
+                    }
                 }
 
                 if ($sort_order == 'DESC') {


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list