Loading sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/extractor/impl/dml/select/WhereExtractor.java→sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/extractor/impl/dml/select/SelectWhereExtractor.java +2 −2 Original line number Diff line number Diff line Loading @@ -23,11 +23,11 @@ import org.apache.shardingsphere.core.parse.antlr.extractor.util.ExtractorUtils; import org.apache.shardingsphere.core.parse.antlr.extractor.util.RuleName; /** * Where extractor. * Where extractor for select. * * @author duhongjun */ public final class WhereExtractor extends AbstractWhereExtractor { public final class SelectWhereExtractor extends AbstractWhereExtractor { @Override protected Optional<ParserRuleContext> extractWhere(final ParserRuleContext ancestorNode) { Loading sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/extractor/impl/dml/select/SubqueryConditionExtractor.java +3 −2 Original line number Diff line number Diff line Loading @@ -34,13 +34,14 @@ import java.util.Collection; */ public final class SubqueryConditionExtractor implements OptionalSQLSegmentExtractor { private final SelectWhereExtractor selectWhereExtractor = new SelectWhereExtractor(); @Override public Optional<SubqueryConditionSegment> extract(final ParserRuleContext ancestorNode) { Collection<ParserRuleContext> suQueryNodes = ExtractorUtils.getAllDescendantNodes(ancestorNode, RuleName.SUBQUERY); SubqueryConditionSegment result = new SubqueryConditionSegment(); WhereExtractor whereExtractor = new WhereExtractor(); for (ParserRuleContext each : suQueryNodes) { Optional<WhereSegment> condition = whereExtractor.extract(each, ancestorNode); Optional<WhereSegment> condition = selectWhereExtractor.extract(each, ancestorNode); if (condition.isPresent()) { result.getOrConditions().add(condition.get().getConditions()); } Loading sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/extractor/impl/dml/select/SubqueryExtractor.java +2 −2 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ import org.apache.shardingsphere.core.parse.antlr.sql.segment.dml.order.OrderByS */ public final class SubqueryExtractor implements OptionalSQLSegmentExtractor { private final WhereExtractor whereExtractor = new WhereExtractor(); private final SelectWhereExtractor selectWhereExtractor = new SelectWhereExtractor(); private final GroupByExtractor groupByExtractor = new GroupByExtractor(); Loading @@ -60,7 +60,7 @@ public final class SubqueryExtractor implements OptionalSQLSegmentExtractor { if (selectClauseSegment.isPresent()) { result.setSelectClauseSegment(selectClauseSegment.get()); } Optional<WhereSegment> whereSegment = whereExtractor.extract(subqueryNode); Optional<WhereSegment> whereSegment = selectWhereExtractor.extract(subqueryNode); if (whereSegment.isPresent()) { result.setWhereSegment(whereSegment.get()); } Loading sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/resources/META-INF/parsing-rule-definition/common/extractor-rule-definition.xml +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ <extractor-rule id="onDuplicateKeyColumns" extractor-class="org.apache.shardingsphere.core.parse.antlr.extractor.impl.dml.insert.OnDuplicateKeyColumnsExtractor" /> <extractor-rule id="tableReferences" extractor-class="org.apache.shardingsphere.core.parse.antlr.extractor.impl.dml.TableReferencesExtractor" /> <extractor-rule id="selectClause" extractor-class="org.apache.shardingsphere.core.parse.antlr.extractor.impl.dml.select.SelectClauseExtractor" /> <extractor-rule id="where" extractor-class="org.apache.shardingsphere.core.parse.antlr.extractor.impl.dml.select.WhereExtractor" /> <extractor-rule id="selectWhere" extractor-class="org.apache.shardingsphere.core.parse.antlr.extractor.impl.dml.select.SelectWhereExtractor" /> <extractor-rule id="updateSetWhere" extractor-class="org.apache.shardingsphere.core.parse.antlr.extractor.impl.dml.update.UpdateWhereExtractor" /> <extractor-rule id="deleteWhere" extractor-class="org.apache.shardingsphere.core.parse.antlr.extractor.impl.dml.delete.DeleteWhereExtractor" /> <extractor-rule id="groupBy" extractor-class="org.apache.shardingsphere.core.parse.antlr.extractor.impl.dml.select.GroupByExtractor" /> Loading sharding-core/sharding-core-parse/sharding-core-parse-mysql/src/main/resources/META-INF/parsing-rule-definition/encrypt/mysql/sql-statement-rule-definition.xml +1 −1 Original line number Diff line number Diff line Loading @@ -20,5 +20,5 @@ <sql-statement-rule context="insert" sql-statement-class="org.apache.shardingsphere.core.parse.antlr.sql.statement.dml.InsertStatement" extractor-rule-refs="tables, insertColumns, insertValues, setAssignments" /> <sql-statement-rule context="update" sql-statement-class="org.apache.shardingsphere.core.parse.antlr.sql.statement.dml.UpdateStatement" extractor-rule-refs="tableReferences, setAssignments, updateWhere" /> <sql-statement-rule context="delete" sql-statement-class="org.apache.shardingsphere.core.parse.antlr.sql.statement.dml.DeleteStatement" extractor-rule-refs="tables, deleteWhere" /> <sql-statement-rule context="select" sql-statement-class="org.apache.shardingsphere.core.parse.antlr.sql.statement.dml.SelectStatement" extractor-rule-refs="tables, where, subqueryCondition"/> <sql-statement-rule context="select" sql-statement-class="org.apache.shardingsphere.core.parse.antlr.sql.statement.dml.SelectStatement" extractor-rule-refs="tables, selectWhere, subqueryCondition"/> </sql-statement-rule-definition> Loading
sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/extractor/impl/dml/select/WhereExtractor.java→sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/extractor/impl/dml/select/SelectWhereExtractor.java +2 −2 Original line number Diff line number Diff line Loading @@ -23,11 +23,11 @@ import org.apache.shardingsphere.core.parse.antlr.extractor.util.ExtractorUtils; import org.apache.shardingsphere.core.parse.antlr.extractor.util.RuleName; /** * Where extractor. * Where extractor for select. * * @author duhongjun */ public final class WhereExtractor extends AbstractWhereExtractor { public final class SelectWhereExtractor extends AbstractWhereExtractor { @Override protected Optional<ParserRuleContext> extractWhere(final ParserRuleContext ancestorNode) { Loading
sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/extractor/impl/dml/select/SubqueryConditionExtractor.java +3 −2 Original line number Diff line number Diff line Loading @@ -34,13 +34,14 @@ import java.util.Collection; */ public final class SubqueryConditionExtractor implements OptionalSQLSegmentExtractor { private final SelectWhereExtractor selectWhereExtractor = new SelectWhereExtractor(); @Override public Optional<SubqueryConditionSegment> extract(final ParserRuleContext ancestorNode) { Collection<ParserRuleContext> suQueryNodes = ExtractorUtils.getAllDescendantNodes(ancestorNode, RuleName.SUBQUERY); SubqueryConditionSegment result = new SubqueryConditionSegment(); WhereExtractor whereExtractor = new WhereExtractor(); for (ParserRuleContext each : suQueryNodes) { Optional<WhereSegment> condition = whereExtractor.extract(each, ancestorNode); Optional<WhereSegment> condition = selectWhereExtractor.extract(each, ancestorNode); if (condition.isPresent()) { result.getOrConditions().add(condition.get().getConditions()); } Loading
sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/extractor/impl/dml/select/SubqueryExtractor.java +2 −2 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ import org.apache.shardingsphere.core.parse.antlr.sql.segment.dml.order.OrderByS */ public final class SubqueryExtractor implements OptionalSQLSegmentExtractor { private final WhereExtractor whereExtractor = new WhereExtractor(); private final SelectWhereExtractor selectWhereExtractor = new SelectWhereExtractor(); private final GroupByExtractor groupByExtractor = new GroupByExtractor(); Loading @@ -60,7 +60,7 @@ public final class SubqueryExtractor implements OptionalSQLSegmentExtractor { if (selectClauseSegment.isPresent()) { result.setSelectClauseSegment(selectClauseSegment.get()); } Optional<WhereSegment> whereSegment = whereExtractor.extract(subqueryNode); Optional<WhereSegment> whereSegment = selectWhereExtractor.extract(subqueryNode); if (whereSegment.isPresent()) { result.setWhereSegment(whereSegment.get()); } Loading
sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/resources/META-INF/parsing-rule-definition/common/extractor-rule-definition.xml +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ <extractor-rule id="onDuplicateKeyColumns" extractor-class="org.apache.shardingsphere.core.parse.antlr.extractor.impl.dml.insert.OnDuplicateKeyColumnsExtractor" /> <extractor-rule id="tableReferences" extractor-class="org.apache.shardingsphere.core.parse.antlr.extractor.impl.dml.TableReferencesExtractor" /> <extractor-rule id="selectClause" extractor-class="org.apache.shardingsphere.core.parse.antlr.extractor.impl.dml.select.SelectClauseExtractor" /> <extractor-rule id="where" extractor-class="org.apache.shardingsphere.core.parse.antlr.extractor.impl.dml.select.WhereExtractor" /> <extractor-rule id="selectWhere" extractor-class="org.apache.shardingsphere.core.parse.antlr.extractor.impl.dml.select.SelectWhereExtractor" /> <extractor-rule id="updateSetWhere" extractor-class="org.apache.shardingsphere.core.parse.antlr.extractor.impl.dml.update.UpdateWhereExtractor" /> <extractor-rule id="deleteWhere" extractor-class="org.apache.shardingsphere.core.parse.antlr.extractor.impl.dml.delete.DeleteWhereExtractor" /> <extractor-rule id="groupBy" extractor-class="org.apache.shardingsphere.core.parse.antlr.extractor.impl.dml.select.GroupByExtractor" /> Loading
sharding-core/sharding-core-parse/sharding-core-parse-mysql/src/main/resources/META-INF/parsing-rule-definition/encrypt/mysql/sql-statement-rule-definition.xml +1 −1 Original line number Diff line number Diff line Loading @@ -20,5 +20,5 @@ <sql-statement-rule context="insert" sql-statement-class="org.apache.shardingsphere.core.parse.antlr.sql.statement.dml.InsertStatement" extractor-rule-refs="tables, insertColumns, insertValues, setAssignments" /> <sql-statement-rule context="update" sql-statement-class="org.apache.shardingsphere.core.parse.antlr.sql.statement.dml.UpdateStatement" extractor-rule-refs="tableReferences, setAssignments, updateWhere" /> <sql-statement-rule context="delete" sql-statement-class="org.apache.shardingsphere.core.parse.antlr.sql.statement.dml.DeleteStatement" extractor-rule-refs="tables, deleteWhere" /> <sql-statement-rule context="select" sql-statement-class="org.apache.shardingsphere.core.parse.antlr.sql.statement.dml.SelectStatement" extractor-rule-refs="tables, where, subqueryCondition"/> <sql-statement-rule context="select" sql-statement-class="org.apache.shardingsphere.core.parse.antlr.sql.statement.dml.SelectStatement" extractor-rule-refs="tables, selectWhere, subqueryCondition"/> </sql-statement-rule-definition>