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:
@@ -380,7 +380,7 @@ public class SQLColumnDefinition extends SQLObjectImpl implements SQLTableElemen
|
||||
SQLIdentifierExpr identExpr = (SQLIdentifierExpr) this.name;
|
||||
String columnName = identExpr.getName();
|
||||
columnName = SQLUtils.normalize(columnName, dbType);
|
||||
identExpr.setName(columnName);
|
||||
this.setName(columnName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -584,7 +584,7 @@ public class SQLCreateTableStatement extends SQLStatementImpl implements SQLDDLS
|
||||
SQLIdentifierExpr identExpr = (SQLIdentifierExpr) name;
|
||||
String tableName = identExpr.getName();
|
||||
tableName = SQLUtils.normalize(tableName, dbType);
|
||||
identExpr.setName(tableName);
|
||||
setName(tableName);
|
||||
}
|
||||
|
||||
for (SQLTableElement element : this.tableElementList) {
|
||||
|
||||
@@ -60,6 +60,10 @@ public class SQLExprTableSource extends SQLTableSourceImpl {
|
||||
this.expr = expr;
|
||||
}
|
||||
|
||||
public void setExpr(String name) {
|
||||
this.setExpr(new SQLIdentifierExpr(name));
|
||||
}
|
||||
|
||||
public SQLName getName() {
|
||||
if (expr instanceof SQLName) {
|
||||
return (SQLName) expr;
|
||||
|
||||
@@ -98,7 +98,7 @@ public class SQLUnique extends SQLConstraintImpl implements SQLUniqueConstraint,
|
||||
SQLIdentifierExpr identExpr = (SQLIdentifierExpr) column;
|
||||
String columnName = identExpr.getName();
|
||||
columnName = SQLUtils.normalize(columnName, dbType);
|
||||
identExpr.setName(columnName);
|
||||
item.setExpr(new SQLIdentifierExpr(columnName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user