The branch, QA_3_3 has been updated
       via  8afdcbe2b89888b4e7e3ca58224cb01ebe8db73c (commit)
      from  b6f717a6025c3785430c4cf317cfa5786564729b (commit)


- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

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

diff --git a/ChangeLog b/ChangeLog
index 9c9b92a..988feaf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@ $HeadURL: 
https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
   thanks to Craig Duncan - duncan3dc
 - bug #3112614 [pdf schema] Scratchboard for PDF pages not working
 - bug #3125606 [parser] Query for table "level" causes strange display
+- bug #3127904 [parser] Close all opened round brackets indents
 
 3.3.8.1 (2010-11-29)
 - bug #3115519 (private) [security] XSS on db search, see PMASA-2010-8
diff --git a/libraries/sqlparser.lib.php b/libraries/sqlparser.lib.php
index 738d2fb..3db5308 100644
--- a/libraries/sqlparser.lib.php
+++ b/libraries/sqlparser.lib.php
@@ -2165,7 +2165,6 @@ if (! defined('PMA_MINIMUM_COMMON')) {
 // DEBUG echo "Loop format <strong>" . $arr[$i]['data'] . "</strong> " . 
$arr[$i]['type'] . "<br />";
             $before = '';
             $after  = '';
-            $indent = 0;
             // array_shift($typearr);
             /*
             0 prev2
@@ -2265,17 +2264,20 @@ if (! defined('PMA_MINIMUM_COMMON')) {
                     }
                     break;
                 case 'punct_bracket_close_round':
-                    $bracketlevel--;
-                    if ($infunction == TRUE) {
-                        $functionlevel--;
-                        $after     .= ' ';
-                        $before    .= ' ';
-                    } else {
-                        $indent--;
-                        $before    .= ($mode != 'query_only' ? '</div>' : ' ');
-                    }
-                    $infunction    = ($functionlevel > 0) ? TRUE : FALSE;
-                    break;
+                       // only close bracket level when it was opened before
+                       if ($bracketlevel > 0) {
+                               $bracketlevel--;
+                               if ($infunction == TRUE) {
+                                       $functionlevel--;
+                                       $after     .= ' ';
+                                       $before    .= ' ';
+                               } else {
+                                       $indent--;
+                                       $before    .= ($mode != 'query_only' ? 
'</div>' : ' ');
+                               }
+                               $infunction    = ($functionlevel > 0) ? TRUE : 
FALSE;
+                       }
+                       break;
                 case 'alpha_columnType':
                     if ($typearr[3] == 'alpha_columnAttrib') {
                         $after     .= ' ';
@@ -2466,6 +2468,11 @@ if (! defined('PMA_MINIMUM_COMMON')) {
             }
             $str .= $after;
         } // end for
+       // close unclosed indent levels
+       while ($indent > 0) {
+               $indent--;
+               $str .= ($mode != 'query_only' ? '</div>' : ' ');
+       }
         if ($mode=='color') {
             $str .= '</span>';
         }


hooks/post-receive
-- 
phpMyAdmin

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Phpmyadmin-git mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/phpmyadmin-git

Reply via email to