Merge pull request #752 from yakolee/master

improve sqlparser
This commit is contained in:
Yako
2014-12-21 22:14:15 +08:00
6 changed files with 105 additions and 4 deletions
@@ -592,7 +592,7 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
String text = x.getText();
text = text.replaceAll("'", "''");
text = text.replaceAll("\\\\", "\\\\");
text = text.replace("\\", "\\\\");
print(text);
@@ -180,7 +180,7 @@ public class PGOutputVisitor extends SQLASTOutputVisitor implements PGASTVisitor
} else if (SQLSetQuantifier.DISTINCT == x.getDistionOption()) {
print("DISTINCT ");
if (x.getDistinctOn() != null) {
if (x.getDistinctOn() != null && x.getDistinctOn().size() > 0) {
print("ON ");
printAndAccept(x.getDistinctOn(), ", ");
}