mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved db2 parser support. for issue #2489
This commit is contained in:
@@ -2418,6 +2418,18 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
|
||||
}
|
||||
}
|
||||
|
||||
SQLExpr generatedAlawsAs = x.getGeneratedAlawsAs();
|
||||
if (generatedAlawsAs != null) {
|
||||
print0(ucase ? " GENERATED ALWAYS AS " : " generated always as ");
|
||||
printExpr(generatedAlawsAs);
|
||||
}
|
||||
|
||||
SQLColumnDefinition.Identity identity = x.getIdentity();
|
||||
if (identity != null) {
|
||||
print(' ');
|
||||
identity.accept(this);
|
||||
}
|
||||
|
||||
if (x.getEnable() != null) {
|
||||
if (x.getEnable().booleanValue()) {
|
||||
print0(ucase ? " ENABLE" : " enable");
|
||||
@@ -6525,6 +6537,14 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(SQLWindow x) {
|
||||
x.getName().accept(this);
|
||||
print0(ucase ? " AS " : " as ");
|
||||
x.getOver().accept(this);
|
||||
return false;
|
||||
}
|
||||
|
||||
public void print(float value) {
|
||||
if (this.appender == null) {
|
||||
return;
|
||||
|
||||
@@ -838,4 +838,8 @@ public interface SQLASTVisitor {
|
||||
|
||||
boolean visit(SQLRealExpr x);
|
||||
void endVisit(SQLRealExpr x);
|
||||
|
||||
boolean visit(SQLWindow x);
|
||||
void endVisit(SQLWindow x);
|
||||
|
||||
}
|
||||
|
||||
@@ -1990,6 +1990,17 @@ public class SQLASTVisitorAdapter implements SQLASTVisitor {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean visit(SQLWindow x) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void endVisit(SQLWindow x) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public final boolean isEnabled(VisitorFeature feature) {
|
||||
return VisitorFeature.isEnabled(this.features, feature);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user