mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
refactor sql parser. sqlite support limit clause. #1556
This commit is contained in:
@@ -48,7 +48,7 @@ public class DB2SelectQueryBlock extends SQLSelectQueryBlock implements DB2Objec
|
||||
acceptChild(visitor, this.from);
|
||||
acceptChild(visitor, this.where);
|
||||
acceptChild(visitor, this.groupBy);
|
||||
acceptChild(visitor, this.first);
|
||||
acceptChild(visitor, this.getFirst());
|
||||
}
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
|
||||
@@ -23,15 +23,17 @@ import com.alibaba.druid.sql.ast.statement.SQLSelectQueryBlock;
|
||||
import com.alibaba.druid.sql.dialect.db2.ast.stmt.DB2SelectQueryBlock;
|
||||
import com.alibaba.druid.sql.dialect.db2.ast.stmt.DB2ValuesStatement;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTOutputVisitor;
|
||||
import com.alibaba.druid.util.JdbcConstants;
|
||||
|
||||
public class DB2OutputVisitor extends SQLASTOutputVisitor implements DB2ASTVisitor {
|
||||
|
||||
public DB2OutputVisitor(Appendable appender){
|
||||
super(appender);
|
||||
super(appender, JdbcConstants.DB2);
|
||||
}
|
||||
|
||||
public DB2OutputVisitor(Appendable appender, boolean parameterized){
|
||||
super(appender, parameterized);
|
||||
this.dbType = JdbcConstants.DB2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
-13
@@ -35,8 +35,6 @@ public class MySqlSelectQueryBlock extends SQLSelectQueryBlock implements MySqlO
|
||||
private Boolean cache;
|
||||
private boolean calcFoundRows;
|
||||
|
||||
private SQLLimit limit;
|
||||
|
||||
private SQLName procedureName;
|
||||
private List<SQLExpr> procedureArgumentList;
|
||||
|
||||
@@ -150,17 +148,6 @@ public class MySqlSelectQueryBlock extends SQLSelectQueryBlock implements MySqlO
|
||||
this.calcFoundRows = calcFoundRows;
|
||||
}
|
||||
|
||||
public SQLLimit getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public void setLimit(SQLLimit limit) {
|
||||
if (limit != null) {
|
||||
limit.setParent(this);
|
||||
}
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
|
||||
@@ -728,30 +728,6 @@ public class MySqlExprParser extends SQLExprParser {
|
||||
return super.nameRest(name);
|
||||
}
|
||||
|
||||
public SQLLimit parseLimit() {
|
||||
if (lexer.token() == Token.LIMIT) {
|
||||
lexer.nextToken();
|
||||
|
||||
SQLLimit limit = new SQLLimit();
|
||||
|
||||
SQLExpr temp = this.expr();
|
||||
if (lexer.token() == (Token.COMMA)) {
|
||||
limit.setOffset(temp);
|
||||
lexer.nextToken();
|
||||
limit.setRowCount(this.expr());
|
||||
} else if (identifierEquals("OFFSET")) {
|
||||
limit.setRowCount(temp);
|
||||
lexer.nextToken();
|
||||
limit.setOffset(this.expr());
|
||||
} else {
|
||||
limit.setRowCount(temp);
|
||||
}
|
||||
return limit;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MySqlPrimaryKey parsePrimaryKey() {
|
||||
accept(Token.PRIMARY);
|
||||
|
||||
@@ -157,7 +157,7 @@ public class MySqlSelectIntoParser extends SQLSelectParser {
|
||||
queryBlock.setOrderBy(this.exprParser.parseOrderBy());
|
||||
|
||||
if (lexer.token() == Token.LIMIT) {
|
||||
queryBlock.setLimit(parseLimit());
|
||||
queryBlock.setLimit(this.exprParser.parseLimit());
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.PROCEDURE) {
|
||||
@@ -344,14 +344,10 @@ public class MySqlSelectIntoParser extends SQLSelectParser {
|
||||
public SQLUnionQuery unionRest(SQLUnionQuery union) {
|
||||
if (lexer.token() == Token.LIMIT) {
|
||||
MySqlUnionQuery mysqlUnionQuery = (MySqlUnionQuery) union;
|
||||
mysqlUnionQuery.setLimit(parseLimit());
|
||||
mysqlUnionQuery.setLimit(this.exprParser.parseLimit());
|
||||
}
|
||||
return super.unionRest(union);
|
||||
}
|
||||
|
||||
public SQLLimit parseLimit() {
|
||||
return ((MySqlExprParser) this.exprParser).parseLimit();
|
||||
}
|
||||
|
||||
public MySqlExprParser getExprParser() {
|
||||
return (MySqlExprParser) exprParser;
|
||||
|
||||
@@ -163,7 +163,7 @@ public class MySqlSelectParser extends SQLSelectParser {
|
||||
queryBlock.setOrderBy(this.exprParser.parseOrderBy());
|
||||
|
||||
if (lexer.token() == Token.LIMIT) {
|
||||
queryBlock.setLimit(parseLimit());
|
||||
queryBlock.setLimit(this.exprParser.parseLimit());
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.PROCEDURE) {
|
||||
@@ -304,7 +304,7 @@ public class MySqlSelectParser extends SQLSelectParser {
|
||||
}
|
||||
|
||||
update.setOrderBy(this.exprParser.parseOrderBy());
|
||||
update.setLimit(parseLimit());
|
||||
update.setLimit(this.exprParser.parseLimit());
|
||||
|
||||
return update;
|
||||
}
|
||||
@@ -445,15 +445,11 @@ public class MySqlSelectParser extends SQLSelectParser {
|
||||
public SQLUnionQuery unionRest(SQLUnionQuery union) {
|
||||
if (lexer.token() == Token.LIMIT) {
|
||||
MySqlUnionQuery mysqlUnionQuery = (MySqlUnionQuery) union;
|
||||
mysqlUnionQuery.setLimit(parseLimit());
|
||||
mysqlUnionQuery.setLimit(this.exprParser.parseLimit());
|
||||
}
|
||||
return super.unionRest(union);
|
||||
}
|
||||
|
||||
public SQLLimit parseLimit() {
|
||||
return ((MySqlExprParser) this.exprParser).parseLimit();
|
||||
}
|
||||
|
||||
public MySqlExprParser getExprParser() {
|
||||
return (MySqlExprParser) exprParser;
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
deleteStatement.setOrderBy(orderBy);
|
||||
}
|
||||
|
||||
deleteStatement.setLimit(parseLimit());
|
||||
deleteStatement.setLimit(this.exprParser.parseLimit());
|
||||
|
||||
return deleteStatement;
|
||||
}
|
||||
@@ -865,7 +865,7 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
lexer.nextToken();
|
||||
|
||||
MySqlShowErrorsStatement stmt = new MySqlShowErrorsStatement();
|
||||
stmt.setLimit(parseLimit());
|
||||
stmt.setLimit(this.exprParser.parseLimit());
|
||||
|
||||
return stmt;
|
||||
}
|
||||
@@ -998,7 +998,7 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
stmt.setFrom(this.exprParser.expr());
|
||||
}
|
||||
|
||||
stmt.setLimit(parseLimit());
|
||||
stmt.setLimit(this.exprParser.parseLimit());
|
||||
|
||||
return stmt;
|
||||
}
|
||||
@@ -1341,7 +1341,7 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
stmt.setForQuery(this.exprParser.primary());
|
||||
}
|
||||
|
||||
stmt.setLimit(this.parseLimit());
|
||||
stmt.setLimit(this.exprParser.parseLimit());
|
||||
|
||||
return stmt;
|
||||
}
|
||||
@@ -1361,7 +1361,7 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
stmt.setFrom(this.exprParser.primary());
|
||||
}
|
||||
|
||||
stmt.setLimit(this.parseLimit());
|
||||
stmt.setLimit(this.exprParser.parseLimit());
|
||||
|
||||
return stmt;
|
||||
}
|
||||
@@ -1381,7 +1381,7 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
stmt.setFrom(this.exprParser.primary());
|
||||
}
|
||||
|
||||
stmt.setLimit(this.parseLimit());
|
||||
stmt.setLimit(this.exprParser.parseLimit());
|
||||
|
||||
return stmt;
|
||||
}
|
||||
@@ -1488,7 +1488,7 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
private MySqlShowWarningsStatement parseShowWarnings() {
|
||||
MySqlShowWarningsStatement stmt = new MySqlShowWarningsStatement();
|
||||
|
||||
stmt.setLimit(parseLimit());
|
||||
stmt.setLimit(this.exprParser.parseLimit());
|
||||
|
||||
return stmt;
|
||||
}
|
||||
@@ -2322,10 +2322,6 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
}
|
||||
}
|
||||
|
||||
public SQLLimit parseLimit() {
|
||||
return ((MySqlExprParser) this.exprParser).parseLimit();
|
||||
}
|
||||
|
||||
public SQLStatement parseAlter() {
|
||||
accept(Token.ALTER);
|
||||
|
||||
|
||||
@@ -31,8 +31,6 @@ public class OdpsSelectQueryBlock extends SQLSelectQueryBlock {
|
||||
|
||||
private SQLOrderBy orderBy;
|
||||
|
||||
private SQLExpr limit;
|
||||
|
||||
protected List<SQLHint> hints;
|
||||
|
||||
protected List<SQLExpr> distributeBy = new ArrayList<SQLExpr>();
|
||||
@@ -58,17 +56,6 @@ public class OdpsSelectQueryBlock extends SQLSelectQueryBlock {
|
||||
return sortBy;
|
||||
}
|
||||
|
||||
public SQLExpr getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public void setLimit(SQLExpr limit) {
|
||||
if (limit != null) {
|
||||
limit.setParent(this);
|
||||
}
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.alibaba.druid.sql.dialect.odps.parser;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.ast.SQLLimit;
|
||||
import com.alibaba.druid.sql.ast.SQLOrderingSpecification;
|
||||
import com.alibaba.druid.sql.ast.SQLSetQuantifier;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLMethodInvokeExpr;
|
||||
@@ -117,7 +118,7 @@ public class OdpsSelectParser extends SQLSelectParser {
|
||||
|
||||
if (lexer.token() == Token.LIMIT) {
|
||||
lexer.nextToken();
|
||||
queryBlock.setLimit(this.expr());
|
||||
queryBlock.setLimit(new SQLLimit(this.expr()));
|
||||
}
|
||||
|
||||
return queryRest(queryBlock);
|
||||
|
||||
@@ -526,7 +526,6 @@ public class OdpsOutputVisitor extends SQLASTOutputVisitor implements OdpsASTVis
|
||||
|
||||
if (x.getLimit() != null) {
|
||||
println();
|
||||
print0(ucase ? "LIMIT " : "limit ");
|
||||
x.getLimit().accept(this);
|
||||
}
|
||||
|
||||
|
||||
-69
@@ -32,7 +32,6 @@ public class PGSelectQueryBlock extends SQLSelectQueryBlock {
|
||||
|
||||
private PGWithClause with;
|
||||
private List<SQLExpr> distinctOn = new ArrayList<SQLExpr>(2);
|
||||
private PGLimit limit;
|
||||
private WindowClause window;
|
||||
|
||||
private SQLOrderBy orderBy;
|
||||
@@ -107,14 +106,6 @@ public class PGSelectQueryBlock extends SQLSelectQueryBlock {
|
||||
this.with = with;
|
||||
}
|
||||
|
||||
public PGLimit getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public void setLimit(PGLimit limit) {
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
public SQLOrderBy getOrderBy() {
|
||||
return orderBy;
|
||||
}
|
||||
@@ -123,21 +114,6 @@ public class PGSelectQueryBlock extends SQLSelectQueryBlock {
|
||||
this.orderBy = orderBy;
|
||||
}
|
||||
|
||||
public SQLExpr getOffset() {
|
||||
if (limit != null) {
|
||||
return limit.offset;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setOffset(SQLExpr offset) {
|
||||
if (limit == null) {
|
||||
limit = new PGLimit();
|
||||
limit.setParent(this);
|
||||
}
|
||||
limit.setOffset(offset);
|
||||
}
|
||||
|
||||
public List<SQLExpr> getDistinctOn() {
|
||||
return distinctOn;
|
||||
}
|
||||
@@ -255,51 +231,6 @@ public class PGSelectQueryBlock extends SQLSelectQueryBlock {
|
||||
}
|
||||
}
|
||||
|
||||
public static class PGLimit extends SQLObjectImpl implements SQLExpr, PGSQLObject {
|
||||
|
||||
public PGLimit(){
|
||||
|
||||
}
|
||||
|
||||
private SQLExpr rowCount;
|
||||
private SQLExpr offset;
|
||||
|
||||
public SQLExpr getRowCount() {
|
||||
return rowCount;
|
||||
}
|
||||
|
||||
public void setRowCount(SQLExpr rowCount) {
|
||||
if (rowCount != null) {
|
||||
rowCount.setParent(this);
|
||||
}
|
||||
this.rowCount = rowCount;
|
||||
}
|
||||
|
||||
public SQLExpr getOffset() {
|
||||
return offset;
|
||||
}
|
||||
|
||||
public void setOffset(SQLExpr offset) {
|
||||
if (offset != null) {
|
||||
offset.setParent(this);
|
||||
}
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
accept0((PGASTVisitor) visitor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept0(PGASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, offset);
|
||||
acceptChild(visitor, rowCount);
|
||||
}
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.alibaba.druid.sql.dialect.postgresql.parser;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.ast.SQLLimit;
|
||||
import com.alibaba.druid.sql.ast.SQLParameter;
|
||||
import com.alibaba.druid.sql.ast.SQLSetQuantifier;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr;
|
||||
@@ -28,7 +29,6 @@ import com.alibaba.druid.sql.ast.statement.SQLTableSource;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGFunctionTableSource;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock.IntoOption;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock.PGLimit;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGValuesQuery;
|
||||
import com.alibaba.druid.sql.parser.ParserException;
|
||||
import com.alibaba.druid.sql.parser.SQLExprParser;
|
||||
@@ -159,7 +159,7 @@ public class PGSelectParser extends SQLSelectParser {
|
||||
|
||||
for (;;) {
|
||||
if (lexer.token() == Token.LIMIT) {
|
||||
PGLimit limit = new PGLimit();
|
||||
SQLLimit limit = new SQLLimit();
|
||||
|
||||
lexer.nextToken();
|
||||
if (lexer.token() == Token.ALL) {
|
||||
@@ -171,9 +171,9 @@ public class PGSelectParser extends SQLSelectParser {
|
||||
|
||||
queryBlock.setLimit(limit);
|
||||
} else if (lexer.token() == Token.OFFSET) {
|
||||
PGLimit limit = queryBlock.getLimit();
|
||||
SQLLimit limit = queryBlock.getLimit();
|
||||
if (limit == null) {
|
||||
limit = new PGLimit();
|
||||
limit = new SQLLimit();
|
||||
queryBlock.setLimit(limit);
|
||||
}
|
||||
lexer.nextToken();
|
||||
|
||||
@@ -39,10 +39,6 @@ import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGValuesQuery;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
public interface PGASTVisitor extends SQLASTVisitor {
|
||||
|
||||
boolean visit(PGSelectQueryBlock.PGLimit x);
|
||||
|
||||
void endVisit(PGSelectQueryBlock.PGLimit x);
|
||||
|
||||
void endVisit(PGSelectQueryBlock x);
|
||||
|
||||
|
||||
-11
@@ -34,7 +34,6 @@ import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGInsertStatement;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock.FetchClause;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock.ForClause;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock.PGLimit;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock.WindowClause;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectStatement;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGShowStatement;
|
||||
@@ -158,16 +157,6 @@ public class PGASTVisitorAdapter extends SQLASTVisitorAdapter implements PGASTVi
|
||||
public boolean visit(PGFunctionTableSource x) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(PGLimit x) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(PGLimit x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(PGTypeCastExpr x) {
|
||||
|
||||
+14
-17
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.postgresql.visitor;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLLimit;
|
||||
import com.alibaba.druid.sql.ast.SQLSetQuantifier;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLBinaryExpr;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLSelectStatement;
|
||||
@@ -38,7 +39,6 @@ import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGInsertStatement;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock.FetchClause;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock.ForClause;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock.PGLimit;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock.WindowClause;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectStatement;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGShowStatement;
|
||||
@@ -233,7 +233,6 @@ public class PGOutputVisitor extends SQLASTOutputVisitor implements PGASTVisitor
|
||||
|
||||
if (x.getLimit() != null) {
|
||||
println();
|
||||
print0(ucase ? "LIMIT " : "limit ");
|
||||
x.getLimit().accept(this);
|
||||
}
|
||||
|
||||
@@ -459,21 +458,6 @@ public class PGOutputVisitor extends SQLASTOutputVisitor implements PGASTVisitor
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(PGLimit x) {
|
||||
x.getRowCount().accept(this);
|
||||
if (x.getOffset() != null) {
|
||||
print0(ucase ? " OFFSET " : " offset ");
|
||||
x.getOffset().accept(this);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(PGLimit x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(PGTypeCastExpr x) {
|
||||
|
||||
@@ -643,4 +627,17 @@ public class PGOutputVisitor extends SQLASTOutputVisitor implements PGASTVisitor
|
||||
x.getExpr().accept(this);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(SQLLimit x) {
|
||||
print0(ucase ? "LIMIT " : "limit ");
|
||||
|
||||
x.getRowCount().accept(this);
|
||||
|
||||
if (x.getOffset() != null) {
|
||||
print0(ucase ? " OFFSET " : " offset ");
|
||||
x.getOffset().accept(this);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
-11
@@ -40,7 +40,6 @@ import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGInsertStatement;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock.FetchClause;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock.ForClause;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock.PGLimit;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectQueryBlock.WindowClause;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGSelectStatement;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGShowStatement;
|
||||
@@ -271,16 +270,6 @@ public class PGSchemaStatVisitor extends SchemaStatVisitor implements PGASTVisit
|
||||
public boolean visit(PGFunctionTableSource x) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(PGLimit x) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(PGLimit x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(PGTypeCastExpr x) {
|
||||
|
||||
+3
-1
@@ -35,15 +35,17 @@ import com.alibaba.druid.sql.dialect.sqlserver.ast.stmt.SQLServerSetTransactionI
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.stmt.SQLServerUpdateStatement;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.stmt.SQLServerWaitForStatement;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTOutputVisitor;
|
||||
import com.alibaba.druid.util.JdbcConstants;
|
||||
|
||||
public class SQLServerOutputVisitor extends SQLASTOutputVisitor implements SQLServerASTVisitor {
|
||||
|
||||
public SQLServerOutputVisitor(Appendable appender){
|
||||
super(appender);
|
||||
super(appender, JdbcConstants.SQL_SERVER);
|
||||
}
|
||||
|
||||
public SQLServerOutputVisitor(Appendable appender, boolean parameterized){
|
||||
super(appender, parameterized);
|
||||
this.dbType = JdbcConstants.SQL_SERVER;
|
||||
}
|
||||
|
||||
public boolean visit(SQLServerSelectQueryBlock x) {
|
||||
|
||||
Reference in New Issue
Block a user