mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
refactor sql parser.
This commit is contained in:
+2
-2
@@ -44,10 +44,10 @@ public class SQLServerExprParser extends SQLExprParser {
|
||||
|
||||
static {
|
||||
String[] strings = { "AVG", "COUNT", "MAX", "MIN", "ROW_NUMBER", "STDDEV", "SUM" };
|
||||
AGGREGATE_FUNCTIONS_CODES = FnvHash.fnv_64_lower(strings, true);
|
||||
AGGREGATE_FUNCTIONS_CODES = FnvHash.fnv1a_64_lower(strings, true);
|
||||
AGGREGATE_FUNCTIONS = new String[AGGREGATE_FUNCTIONS_CODES.length];
|
||||
for (String str : strings) {
|
||||
long hash = FnvHash.fnv_64_lower(str);
|
||||
long hash = FnvHash.fnv1a_64_lower(str);
|
||||
int index = Arrays.binarySearch(AGGREGATE_FUNCTIONS_CODES, hash);
|
||||
AGGREGATE_FUNCTIONS[index] = str;
|
||||
}
|
||||
|
||||
-5
@@ -84,16 +84,11 @@ public class SQLServerSchemaStatVisitor extends SchemaStatVisitor implements SQL
|
||||
|
||||
@Override
|
||||
public boolean visit(SQLServerUpdateStatement x) {
|
||||
setAliasMap();
|
||||
|
||||
String ident = x.getTableName().toString();
|
||||
|
||||
TableStat stat = getTableStat(ident);
|
||||
stat.incrementUpdateCount();
|
||||
|
||||
Map<String, String> aliasMap = getAliasMap();
|
||||
aliasMap.put(ident, ident);
|
||||
|
||||
accept(x.getItems());
|
||||
accept(x.getFrom());
|
||||
accept(x.getWhere());
|
||||
|
||||
Reference in New Issue
Block a user