mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
sql format support lower case
This commit is contained in:
@@ -23,9 +23,11 @@ public interface MySqlIndexHint extends MySqlHint {
|
||||
;
|
||||
|
||||
public final String name;
|
||||
public final String name_lcase;
|
||||
|
||||
Option(String name) {
|
||||
this.name = name;
|
||||
this.name_lcase = name.toLowerCase();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,5 +28,11 @@ public enum MySqlIntervalUnit {
|
||||
|
||||
SECOND, SECOND_MICROSECOND,
|
||||
|
||||
MICROSECOND
|
||||
MICROSECOND;
|
||||
|
||||
public final String name_lcase;
|
||||
|
||||
private MySqlIntervalUnit() {
|
||||
this.name_lcase = name().toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
+545
-526
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -108,7 +108,7 @@ public class MySqlParameterizedOutputVisitor extends MySqlOutputVisitor implemen
|
||||
}
|
||||
if (isNumber) {
|
||||
String realName = name.substring(0, pos);
|
||||
print(realName);
|
||||
print0(realName);
|
||||
incrementReplaceCunt();
|
||||
return false;
|
||||
}
|
||||
@@ -127,12 +127,12 @@ public class MySqlParameterizedOutputVisitor extends MySqlOutputVisitor implemen
|
||||
if (numberCount > 1) {
|
||||
int numPos = name.length() - numberCount;
|
||||
String realName = name.substring(0, numPos);
|
||||
print(realName);
|
||||
print0(realName);
|
||||
incrementReplaceCunt();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
print(name);
|
||||
print0(name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ public class MySqlParameterizedOutputVisitor extends MySqlOutputVisitor implemen
|
||||
|
||||
protected void printValuesList(MySqlInsertStatement x) {
|
||||
List<ValuesClause> valuesList = x.getValuesList();
|
||||
print("VALUES ");
|
||||
print0(ucase ? "VALUES " : "values ");
|
||||
incrementIndent();
|
||||
valuesList.get(0).accept(this);
|
||||
decrementIndent();
|
||||
|
||||
Reference in New Issue
Block a user