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:
@@ -519,10 +519,19 @@ public class SchemaRepository {
|
||||
|
||||
String ident = x.getName();
|
||||
SQLTableSource tableSource = null;
|
||||
if (queryBlock.getFrom() instanceof SQLJoinTableSource) {
|
||||
if (queryBlock.getFrom() instanceof SQLJoinTableSource
|
||||
|| queryBlock.getFrom() instanceof SQLSubqueryTableSource) {
|
||||
tableSource = queryBlock.findTableSourceWithColumn(ident);
|
||||
} else {
|
||||
tableSource = queryBlock.getFrom();
|
||||
if (tableSource instanceof SQLExprTableSource) {
|
||||
SchemaObject table = ((SQLExprTableSource) tableSource).getSchemaObject();
|
||||
if (table != null) {
|
||||
if (table.findColumn(ident) == null) {
|
||||
tableSource = null; // maybe parent
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tableSource != null) {
|
||||
|
||||
Reference in New Issue
Block a user