[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_7_1-23850-g9f04e8f

Madhura Jayaratne madhuracj at users.sourceforge.net
Fri Dec 2 04:57:15 CET 2011


The branch, master has been updated
       via  9f04e8f7bbc98ea5eb7e2df7beae66e93f2437dc (commit)
      from  d39a2309922e5646034262a37024b1bdb363a207 (commit)


- Log -----------------------------------------------------------------
commit 9f04e8f7bbc98ea5eb7e2df7beae66e93f2437dc
Author: Madhura Jayaratne <madhura.cj at gmail.com>
Date:   Fri Dec 2 09:24:55 2011 +0530

    The number of rows is approximated for views

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

Summary of changes:
 js/db_structure.js |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/js/db_structure.js b/js/db_structure.js
index f9d9c13..bb1e38e 100644
--- a/js/db_structure.js
+++ b/js/db_structure.js
@@ -41,11 +41,18 @@ function PMA_adjustTotals() {
     var rowsSum = 0;
     var sizeSum = 0;
     var overheadSum = 0;
+    var rowSumApproximated = false;
     
     $allTr.each(function () {
         var $this = $(this);
         // Get the number of rows for this SQL table
         var strRows = $this.find('.tbl_rows').text();
+        // If the value is approximated
+        if (strRows.indexOf('~') == 0) {
+            rowSumApproximated = true;
+            // The approximated value contains a preceding ~ and a following 2 (Eg 100 --> ~1002)
+            strRows = strRows.substring(1, strRows.length - 1);
+        }
         strRows = strRows.replace(/[,.]/g , '');
         var intRow = parseInt(strRows, 10);
         if (! isNaN(intRow)) {
@@ -84,6 +91,10 @@ function PMA_adjustTotals() {
     while (regex.test(strRowSum)) {
         strRowSum = strRowSum.replace(regex, '$1' + ',' + '$2');
     }
+    // If approximated total value add ~ in front
+    if (rowSumApproximated) {
+        strRowSum = "~" + strRowSum;
+    }
     // Calculate the magnitude for the size and overhead values
     var size_magnitude = 0, overhead_magnitude = 0;
     while (sizeSum >= 1024) {


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list