mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved oracle sql parser. issue #1400
This commit is contained in:
@@ -54,7 +54,23 @@ public class SQLDeleteStatement extends SQLStatementImpl {
|
||||
}
|
||||
|
||||
public SQLName getTableName() {
|
||||
return (SQLName) getExprTableSource().getExpr();
|
||||
if (this.tableSource instanceof SQLExprTableSource) {
|
||||
SQLExprTableSource exprTableSource = (SQLExprTableSource) this.tableSource;
|
||||
return (SQLName) exprTableSource.getExpr();
|
||||
}
|
||||
|
||||
if (tableSource instanceof SQLSubqueryTableSource) {
|
||||
SQLSelectQuery selectQuery = ((SQLSubqueryTableSource) tableSource).getSelect().getQuery();
|
||||
if (selectQuery instanceof SQLSelectQueryBlock) {
|
||||
SQLTableSource subQueryTableSource = ((SQLSelectQueryBlock) selectQuery).getFrom();
|
||||
if (subQueryTableSource instanceof SQLExprTableSource) {
|
||||
SQLExpr subQueryTableSourceExpr = ((SQLExprTableSource) subQueryTableSource).getExpr();
|
||||
return (SQLName) subQueryTableSourceExpr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setTableName(SQLName tableName) {
|
||||
|
||||
Reference in New Issue
Block a user