summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLairson Alencar <lerao@cin.ufpe.br>2013-09-16 02:49:54 -0300
committerLairson Alencar <lerao@cin.ufpe.br>2013-09-16 02:49:54 -0300
commit504efb3558d503d9a8740ef9152410115b8d1def (patch)
tree3b91ddcc3625a12ca075e41380ea18da45539061 /lib
parent7f862d76ef8105ae8e25e1f04a49d00e06d7fd26 (diff)
downloadsql-formatter-504efb3558d503d9a8740ef9152410115b8d1def.zip
sql-formatter-504efb3558d503d9a8740ef9152410115b8d1def.tar.gz
sql-formatter-504efb3558d503d9a8740ef9152410115b8d1def.tar.bz2
Update pull #52
Diffstat (limited to 'lib')
-rw-r--r--lib/SqlFormatter.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/SqlFormatter.php b/lib/SqlFormatter.php
index 2f04763..f48e947 100644
--- a/lib/SqlFormatter.php
+++ b/lib/SqlFormatter.php
@@ -642,6 +642,11 @@ class SqlFormatter
}
}
+ //Checks if there is another SQL command after the LIMIT clause. If yes, not suppress newline
+ elseif ($token[self::TOKEN_VALUE] === ';' && $clause_limit === true) {
+ $clause_limit = false;
+ }
+
// Commas start a new line (unless within inline parentheses or SQL 'LIMIT' clause)
elseif ($token[self::TOKEN_VALUE] === ',' && !$inline_parentheses) {
//If the previous TOKEN_VALUE is 'LIMIT', resets new line