mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser.
This commit is contained in:
@@ -41,6 +41,10 @@ public class SQLCharacterDataType extends SQLDataTypeImpl {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public SQLCharacterDataType(String name, int precision){
|
||||
super(name, precision);
|
||||
}
|
||||
|
||||
public String getCharSetName() {
|
||||
return charSetName;
|
||||
}
|
||||
|
||||
@@ -19,16 +19,13 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.druid.sql.SQLUtils;
|
||||
import com.alibaba.druid.sql.ast.SQLDataType;
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.ast.SQLName;
|
||||
import com.alibaba.druid.sql.ast.SQLObjectImpl;
|
||||
import com.alibaba.druid.sql.ast.*;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLPropertyExpr;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
import com.alibaba.druid.util.JdbcConstants;
|
||||
|
||||
public class SQLColumnDefinition extends SQLObjectImpl implements SQLTableElement {
|
||||
public class SQLColumnDefinition extends SQLObjectImpl implements SQLTableElement, SQLObjectWithDataType {
|
||||
protected String dbType;
|
||||
|
||||
protected SQLName name;
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.List;
|
||||
/**
|
||||
* Created by wenshao on 23/05/2017.
|
||||
*/
|
||||
public class SQLCreateFunctionStatement extends SQLStatementImpl implements SQLCreateStatement {
|
||||
public class SQLCreateFunctionStatement extends SQLStatementImpl implements SQLCreateStatement, SQLObjectWithDataType {
|
||||
private SQLName definer;
|
||||
|
||||
private boolean create = true;
|
||||
@@ -85,6 +85,7 @@ public class SQLCreateFunctionStatement extends SQLStatementImpl implements SQLC
|
||||
acceptChild(visitor, definer);
|
||||
acceptChild(visitor, name);
|
||||
acceptChild(visitor, parameters);
|
||||
acceptChild(visitor, returnDataType);
|
||||
acceptChild(visitor, block);
|
||||
}
|
||||
visitor.endVisit(this);
|
||||
@@ -199,4 +200,14 @@ public class SQLCreateFunctionStatement extends SQLStatementImpl implements SQLC
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SQLDataType getDataType() {
|
||||
return returnDataType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDataType(SQLDataType dataType) {
|
||||
this.setReturnDataType(dataType);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user