improve sqlparser

This commit is contained in:
Yako
2014-12-21 22:12:00 +08:00
parent 11ff1d6a82
commit c4d1d22fb5
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(), ", ");
}