[Phpmyadmin-git] [SCM] phpMyAdmin branch, QA_3_3, updated. RELEASE_3_3_9-5-g066b746

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


The branch, QA_3_3 has been updated
       via  066b746befdacf10d87f2eaf3de8ee68f745a447 (commit)
      from  ba2326d7033e12b4ac134cbb585f016203a93517 (commit)


- Log -----------------------------------------------------------------
commit 066b746befdacf10d87f2eaf3de8ee68f745a447
Author: Madhura Jayaratne <madhuracj at users.sourceforge.net>
Date:   Mon Jan 3 08:10:49 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 14915d2..6c67957 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
 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 300a925..8da1035 100644
--- a/libraries/database_interface.lib.php
+++ b/libraries/database_interface.lib.php
@@ -367,8 +367,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