提交 6f95343d 编写于 作者: L Liang Zhang 提交者: Zhang Yonglun

Add assertion for column predicates's left value (#4069)

* add shardingsphere-ui-bin-distribution module

* add shardingsphere-ui-src-distribution module

* add final name for shardingsphere-ui

* fix case for select_between_with_single_table

* refactor select_comparison_symbol_with_single_table

* refactor select_count_like_concat

* refactor select_count_tilde_concat

* refactor select_count_with_binding_tables_with_join

* refactor select_count_with_binding_tables_without_join

* refactor select_count_with_sub

* refactor select_count_with_sub_with_whitespace

* refactor select_distinct_with_aggregation_functions

* refactor select_distinct_with_avg

* fix test case for select_distinct_with_count

* fix test case for select_distinct_with_owner_star

* fix test case for select_distinct_with_star

* fix test case for select_distinct_with_sum

* fix test case for select_equal_with_geography

* fix test case for select_equal_with_same_sharding_column

* fix test case for select_equal_with_same_sharding_column

* fix test case for select_equal_with_single_table

* fix test case for select_escape_with_double_quota

* fix test case for select_escape_with_single_quota

* fix test case for select_exclamation_equal_with_single_table

* fix test case for select_for_update

* fix test case for select_group_by_without_grouped_column

* fix test case for select_in_with_geography

* fix test case for select_in_with_same_sharding_column

* fix test case for select_in_with_single_table

* fix test case for select_inner_join_related_with_alias

* fix test case for select_inner_join_related_with_name

* fix test case for select_join_using

* fix test case for select_keyword_table_name_with_back_quotes

* fix test case for select_keyword_table_name_with_double_quotes

* fix test case for select_keyword_table_name_with_square_brackets

* fix test case for select_not_between_with_single_table

* fix test case for select_not_equal_with_single_table

* fix test case for select_not_equal_with_single_table

* fix test case for select_not_in_with_single_table

* fix test case for select_or_mix_and_for_complex_pattern

* fix test case for select_or_mix_and_for_simple_pattern

* fix test case for select_or_mix_and_with_binding_and_broadcast_tables

* fix test case for select_or_mix_and_with_binding_tables

* fix test case for select_or_with_different_sharding_columns

* fix test case for select_order_by_desc_and_index_asc

* fix test case for select_order_by_with_date

* fix test case for select_pagination_with_diff_group_by_and_order_by

* fix test case for select_pagination_with_group_by_and_order_by

* fix test case for select_pagination_with_limit_and_offset_keyword

* fix test case for select_pagination_with_limit_with_back_quotes

* fix test case for select_pagination_with_offset_and_limit

* fix test case for select_pagination_with_offset

* fix test case for select_pagination_with_row_count

* fix test case for select_pagination_with_row_number

* fix test case for select_pagination_with_row_number_and_diff_group_by_and_order_by

* fix test case for select_pagination_with_row_number_and_group_by_and_order_by

* fix test case for select_pagination_with_row_number_for_greater_than

* fix test case for select_pagination_with_row_number_for_greater_than_and_equal

* fix test case for select_pagination_with_row_number_not_at_end

* fix test case for select_pagination_with_top

* fix test case for select_pagination_with_top_and_diff_group_by_and_order_by

* fix test case for select_pagination_with_top_and_diff_group_by_and_order_by_and_parentheses

* fix test case for select_pagination_with_top_and_group_by_and_order_by

* fix test case for select_pagination_with_top_for_greater_than

* fix test case for select_pagination_with_top_for_greater_than_and_equal

* fix test case for select_sharding_route_with_binding_tables

* fix test case for select_sharding_route_with_broadcast_table

* fix test case for select_special_function_nested

* fix test case for select_with_block_comment

* fix test case for select_with_date_format_function

* fix test case for select_with_double_quotes

* fix test case for select_with_force_index_join

* fix test case for select_with_interval_function

* fix test case for select_with_left_function

* fix test case for select_with_mod_function

* fix test case for select_with_regexp

* fix test case for select_with_row_subquery

* fix test case for select_with_row_subquery_without_row_keyword

* fix test case for select_with_same_table_name_and_alias

* fix test case for select_with_same_table_name_and_alias_column_with_owner

* fix test case for select_with_single_comment

* fix test case for select_with_spatial_function

* skip assert for long sql

* skip long sql
上级 b85976ea
......@@ -49,11 +49,11 @@ public final class SQLSegmentAssert {
private static void assertStartIndex(final SQLStatementAssertMessage assertMessage, final SQLSegment actual, final ExpectedSQLSegment expected, final SQLCaseType sqlCaseType) {
int expectedStartIndex = SQLCaseType.Literal == sqlCaseType && null != expected.getLiteralStartIndex() ? expected.getLiteralStartIndex() : expected.getStartIndex();
assertThat(assertMessage.getText(String.format("`%s`'s start index assertion error: ", actual.getClass())), actual.getStartIndex(), is(expectedStartIndex));
assertThat(assertMessage.getText(String.format("`%s`'s start index assertion error: ", actual.getClass().getSimpleName())), actual.getStartIndex(), is(expectedStartIndex));
}
private static void assertStopIndex(final SQLStatementAssertMessage assertMessage, final SQLSegment actual, final ExpectedSQLSegment expected, final SQLCaseType sqlCaseType) {
int expectedStopIndex = SQLCaseType.Literal == sqlCaseType && null != expected.getLiteralStopIndex() ? expected.getLiteralStopIndex() : expected.getStopIndex();
assertThat(assertMessage.getText(String.format("`%s`'s stop index assertion error: ", actual.getClass())), actual.getStopIndex(), is(expectedStopIndex));
assertThat(assertMessage.getText(String.format("`%s`'s stop index assertion error: ", actual.getClass().getSimpleName())), actual.getStopIndex(), is(expectedStopIndex));
}
}
......@@ -83,8 +83,7 @@ public final class SQLStatementAssert {
private static void assertSelectStatement(final SQLStatementAssertMessage assertMessage, final SelectStatement actual, final ParserResult expected, final SQLCaseType sqlCaseType) {
ProjectionAssert.assertIs(assertMessage, actual.getProjections(), expected.getProjections(), sqlCaseType);
Optional<WhereSegment> whereSegment = actual.getWhere();
if (whereSegment.isPresent() && null != expected.getWhere()) {
// if (whereSegment.isPresent()) {
if (whereSegment.isPresent()) {
assertNotNull(assertMessage.getText("Expected where assertion should exist: "), expected.getWhere());
WhereAssert.assertIs(assertMessage, whereSegment.get(), expected.getWhere(), sqlCaseType);
}
......
......@@ -19,18 +19,18 @@ package org.apache.shardingsphere.sql.parser.integrate.asserts.predicate;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.sql.parser.integrate.asserts.SQLStatementAssertMessage;
import org.apache.shardingsphere.sql.parser.integrate.asserts.SQLSegmentAssert;
import org.apache.shardingsphere.sql.parser.integrate.asserts.SQLStatementAssertMessage;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.impl.expr.complex.ExpectedCommonExpression;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.impl.expr.complex.ExpectedSubquery;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.impl.expr.simple.ExpectedLiteralExpression;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.impl.expr.simple.ExpectedParameterMarkerExpression;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.impl.owner.ExpectedTableOwner;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.impl.predicate.ExpectedAndPredicate;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.impl.predicate.ExpectedColumn;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.impl.predicate.ExpectedPredicate;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.impl.predicate.ExpectedWhere;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.impl.predicate.value.ExpectedPredicateCompareRightValue;
import org.apache.shardingsphere.sql.parser.integrate.jaxb.impl.owner.ExpectedTableOwner;
import org.apache.shardingsphere.sql.parser.sql.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.dml.expr.complex.CommonExpressionSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.dml.expr.complex.ComplexExpressionSegment;
......
......@@ -82,6 +82,8 @@ public final class SQLParserParameterizedTest {
}
SQLStatementAssertMessage assertMessage = new SQLStatementAssertMessage(sqlCaseId, sqlCaseType);
SQLStatement actual = SQLParseEngineFactory.getSQLParseEngine("H2".equals(databaseType) ? "MySQL" : databaseType).parse(sql, false);
SQLStatementAssert.assertIs(assertMessage, actual, expected, sqlCaseType);
if (!expected.isLongSQL()) {
SQLStatementAssert.assertIs(assertMessage, actual, expected, sqlCaseType);
}
}
}
......@@ -95,6 +95,8 @@ public final class VisitorParameterizedParsingTest {
ParseTree parseTree = SQLParserFactory.newInstance(databaseTypeName, sql).execute().getChild(0);
SQLStatementAssertMessage assertMessage = new SQLStatementAssertMessage(sqlCaseId, sqlCaseType);
SQLStatement actual = (SQLStatement) new SQLVisitorEngine(databaseTypeName, parseTree).parse();
SQLStatementAssert.assertIs(assertMessage, actual, expected, sqlCaseType);
if (!expected.isLongSQL()) {
SQLStatementAssert.assertIs(assertMessage, actual, expected, sqlCaseType);
}
}
}
......@@ -34,7 +34,7 @@
<aggregation-projection type="COUNT" alias="orders_count" inner-expression-start-index="12" start-index="7" stop-index="14" />
</projections>
</parser-result>
<parser-result sql-case-id="select_count_with_sub">
<tables>
<table name="t_order" start-index="37" stop-index="43" />
......@@ -42,8 +42,15 @@
<projections start-index="7" stop-index="30">
<aggregation-projection type="COUNT" alias="orders_count" inner-expression-start-index="12" start-index="7" stop-index="14" />
</projections>
<where parameters-count="0" parameter-marker-start-index="0" start-index="45" stop-index="64">
<and-predicate>
<predicate start-index="51" stop-index="64">
<column name="order_id" start-index="51" stop-index="58" />
</predicate>
</and-predicate>
</where>
</parser-result>
<parser-result sql-case-id="select_count_with_sub_with_whitespace">
<tables>
<table name="t_order" start-index="37" stop-index="43" />
......@@ -51,6 +58,13 @@
<projections start-index="7" stop-index="30">
<aggregation-projection type="COUNT" alias="orders_count" inner-expression-start-index="12" start-index="7" stop-index="14" />
</projections>
<where parameters-count="0" parameter-marker-start-index="0" start-index="45" stop-index="66">
<and-predicate>
<predicate start-index="51" stop-index="66">
<column name="order_id" start-index="51" stop-index="58" />
</predicate>
</and-predicate>
</where>
</parser-result>
<parser-result sql-case-id="select_max">
......@@ -88,6 +102,30 @@
<projections start-index="7" stop-index="29">
<aggregation-projection type="COUNT" inner-expression-start-index="12" alias="items_count" start-index="7" stop-index="14" />
</projections>
<where parameters-count="4" parameter-marker-start-index="0" start-index="62" stop-index="171" literal-stop-index="172">
<and-predicate>
<predicate start-index="68" stop-index="88">
<column name="user_id" start-index="68" stop-index="76">
<owner name="o" start-index="68" stop-index="68" />
</column>
</predicate>
<predicate start-index="94" stop-index="116">
<column name="order_id" start-index="94" stop-index="103">
<owner name="o" start-index="94" stop-index="94" />
</column>
</predicate>
<predicate start-index="122" stop-index="140">
<column name="user_id" start-index="122" stop-index="130">
<owner name="o" start-index="122" stop-index="122" />
</column>
</predicate>
<predicate start-index="146" stop-index="171" literal-stop-index="172">
<column name="order_id" start-index="146" stop-index="155">
<owner name="o" start-index="146" stop-index="146" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -110,6 +148,20 @@
<projections start-index="7" stop-index="29">
<aggregation-projection type="COUNT" inner-expression-start-index="12" alias="items_count" start-index="7" stop-index="14" />
</projections>
<where parameters-count="4" parameter-marker-start-index="0" start-index="119" stop-index="174" literal-stop-index="175">
<and-predicate>
<predicate start-index="125" stop-index="143">
<column name="user_id" start-index="125" stop-index="133">
<owner name="o" start-index="125" stop-index="125" />
</column>
</predicate>
<predicate start-index="149" stop-index="174" literal-stop-index="175">
<column name="order_id" start-index="149" stop-index="158">
<owner name="o" start-index="149" stop-index="149" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......
......@@ -49,6 +49,21 @@
<projections start-index="7" stop-index="7">
<shorthand-projection start-index="7" stop-index="7" />
</projections>
<where parameters-count="3" parameter-marker-start-index="0" start-index="29" stop-index="75" literal-stop-index="80">
<and-predicate>
<!-- FIXME cannot parse REGEXP -->
<!--<predicate start-index="35" stop-index="51" literal-stop-index="56">-->
<!--<column name="status" start-index="35" stop-index="51" literal-stop-index="56">-->
<!--<owner name="t" start-index="35" stop-index="35" />-->
<!--</column>-->
<!--</predicate>-->
<predicate start-index="57" stop-index="75" literal-start-index="62" literal-stop-index="80">
<column name="item_id" start-index="57" stop-index="65" literal-start-index="62" literal-stop-index="70">
<owner name="t" start-index="57" stop-index="57" literal-start-index="62" literal-stop-index="62" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="item_id" table-name="t_order_item" operator="IN">
......
......@@ -121,6 +121,20 @@
<projections start-index="7" stop-index="29">
<aggregation-projection type="COUNT" inner-expression-start-index="12" alias="items_count" start-index="7" stop-index="14" />
</projections>
<where parameters-count="4" parameter-marker-start-index="0" start-index="119" stop-index="174" literal-stop-index="175">
<and-predicate>
<predicate start-index="125" stop-index="143">
<column name="user_id" start-index="125" stop-index="133">
<owner name="o" start-index="125" stop-index="125" />
</column>
</predicate>
<predicate start-index="149" stop-index="174" literal-stop-index="175">
<column name="order_id" start-index="149" stop-index="158">
<owner name="o" start-index="149" stop-index="149" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -196,6 +210,13 @@
<expression-projection alias="creation_date" start-index="7" stop-index="45" />
<aggregation-projection type="COUNT" inner-expression-start-index="70" alias="c_number" start-index="65" stop-index="72" />
</projections>
<where parameters-count="2" parameter-marker-start-index="0" start-index="106" stop-index="130" literal-stop-index="135">
<and-predicate>
<predicate start-index="112" stop-index="129" literal-stop-index="135">
<column name="order_id" start-index="112" stop-index="119" />
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="order_id" table-name="t_order_item" operator="IN">
......
......@@ -22,6 +22,20 @@
<table name="t_order" alias="o" start-index="16" stop-index="22" />
<table name="t_order_item" alias="i" start-index="37" stop-index="48" />
</tables>
<projections start-index="7" stop-index="9">
<shorthand-projection start-index="7" stop-index="9">
<owner name="i" start-index="7" stop-index="7" />
</shorthand-projection>
</projections>
<where parameters-count="1" parameter-marker-start-index="0" start-index="79" stop-index="98" literal-stop-index="101">
<and-predicate>
<predicate start-index="85" stop-index="98" literal-stop-index="101">
<column name="order_id" start-index="85" stop-index="94">
<owner name="o" start-index="85" stop-index="85" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="order_id" table-name="t_order" operator="EQUAL">
......@@ -29,11 +43,6 @@
</condition>
</and-condition>
</sharding-conditions>
<projections start-index="7" stop-index="9">
<shorthand-projection start-index="7" stop-index="9">
<owner name="i" start-index="7" stop-index="7" />
</shorthand-projection>
</projections>
</parser-result>
<parser-result sql-case-id="select_inner_join_related_with_name" parameters="1000">
......@@ -46,6 +55,15 @@
<owner name="t_order_item" start-index="7" stop-index="18" />
</shorthand-projection>
</projections>
<where parameters-count="1" parameter-marker-start-index="0" start-index="97" stop-index="122" literal-stop-index="125">
<and-predicate>
<predicate start-index="103" stop-index="122" literal-stop-index="125">
<column name="order_id" start-index="103" stop-index="118">
<owner name="t_order" start-index="103" stop-index="109" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="order_id" table-name="t_order" operator="EQUAL">
......@@ -65,6 +83,15 @@
<owner name="i" start-index="7" stop-index="7" />
</shorthand-projection>
</projections>
<where parameters-count="1" parameter-marker-start-index="0" start-index="62" stop-index="81" literal-stop-index="84">
<and-predicate>
<predicate start-index="68" stop-index="81" literal-stop-index="84">
<column name="order_id" start-index="68" stop-index="77">
<owner name="o" start-index="68" stop-index="68" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="order_id" table-name="t_order" operator="EQUAL">
......
......@@ -24,6 +24,18 @@
<projections start-index="7" stop-index="7">
<shorthand-projection start-index="7" stop-index="7" />
</projections>
<where parameters-count="2" parameter-marker-start-index="0" start-index="22" stop-index="55">
<and-predicate>
<predicate start-index="28" stop-index="39">
<column name="order_id" start-index="28" stop-index="35" />
</predicate>
</and-predicate>
<and-predicate>
<predicate start-index="44" stop-index="55">
<column name="order_id" start-index="44" stop-index="51" />
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="order_id" table-name="t_order" operator="EQUAL">
......@@ -45,6 +57,18 @@
<projections start-index="7" stop-index="7">
<shorthand-projection start-index="7" stop-index="7" />
</projections>
<where parameters-count="2" parameter-marker-start-index="0" start-index="22" stop-index="54">
<and-predicate>
<predicate start-index="28" stop-index="39">
<column name="order_id" start-index="28" stop-index="35" />
</predicate>
</and-predicate>
<and-predicate>
<predicate start-index="44" stop-index="54">
<column name="user_id" start-index="44" stop-index="50" />
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="order_id" table-name="t_order" operator="EQUAL">
......@@ -66,6 +90,18 @@
<projections start-index="7" stop-index="7">
<shorthand-projection start-index="7" stop-index="7" />
</projections>
<where parameters-count="2" parameter-marker-start-index="0" start-index="22" stop-index="53" literal-stop-index="58">
<and-predicate>
<predicate start-index="28" stop-index="39">
<column name="order_id" start-index="28" stop-index="35" />
</predicate>
</and-predicate>
<and-predicate>
<predicate start-index="44" stop-index="53" literal-stop-index="58">
<column name="status" start-index="44" stop-index="49" />
</predicate>
</and-predicate>
</where>
<encrypt-conditions>
<condition column-name="status" table-name="t_order" operator="EQUAL">
<value index="1" literal="init" type="varchar" />
......@@ -80,6 +116,24 @@
<projections start-index="7" stop-index="7">
<shorthand-projection start-index="7" stop-index="7" />
</projections>
<where parameters-count="3" parameter-marker-start-index="0" start-index="22" stop-index="71" literal-stop-index="76">
<and-predicate>
<predicate start-index="29" stop-index="40">
<column name="order_id" start-index="29" stop-index="36" />
</predicate>
<predicate start-index="61" stop-index="71" literal-start-index="66" literal-stop-index="76">
<column name="user_id" start-index="61" stop-index="67" literal-start-index="66" literal-stop-index="72" />
</predicate>
</and-predicate>
<and-predicate>
<predicate start-index="45" stop-index="54" literal-stop-index="59">
<column name="status" start-index="45" stop-index="50" />
</predicate>
<predicate start-index="61" stop-index="71" literal-start-index="66" literal-stop-index="76">
<column name="user_id" start-index="61" stop-index="67" literal-start-index="66" literal-stop-index="72" />
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="order_id" table-name="t_order" operator="EQUAL">
......@@ -109,6 +163,52 @@
<projections start-index="7" stop-index="7">
<shorthand-projection start-index="7" stop-index="7" />
</projections>
<where parameters-count="5" parameter-marker-start-index="0" start-index="22" stop-index="113" literal-stop-index="118">
<and-predicate>
<predicate start-index="30" stop-index="39" literal-stop-index="44">
<column name="status" start-index="30" stop-index="35" />
</predicate>
<predicate start-index="46" stop-index="57" literal-start-index="51" literal-stop-index="62">
<column name="order_id" start-index="46" stop-index="53" literal-start-index="51" literal-stop-index="58" />
</predicate>
<predicate start-index="83" stop-index="93" literal-start-index="88" literal-stop-index="98">
<column name="user_id" start-index="83" stop-index="89" literal-start-index="88" literal-stop-index="94" />
</predicate>
</and-predicate>
<and-predicate>
<predicate start-index="30" stop-index="39" literal-stop-index="44">
<column name="status" start-index="30" stop-index="35" />
</predicate>
<predicate start-index="46" stop-index="57" literal-start-index="51" literal-stop-index="62">
<column name="order_id" start-index="46" stop-index="53" literal-start-index="51" literal-stop-index="58" />
</predicate>
<predicate start-index="99" stop-index="109" literal-start-index="104" literal-stop-index="114">
<column name="user_id" start-index="99" stop-index="105" literal-start-index="104" literal-stop-index="110" />
</predicate>
</and-predicate>
<and-predicate>
<predicate start-index="30" stop-index="39" literal-stop-index="44">
<column name="status" start-index="30" stop-index="35" />
</predicate>
<predicate start-index="63" stop-index="74" literal-start-index="68" literal-stop-index="79">
<column name="order_id" start-index="63" stop-index="70" literal-start-index="68" literal-stop-index="75" />
</predicate>
<predicate start-index="83" stop-index="93" literal-start-index="88" literal-stop-index="98">
<column name="user_id" start-index="83" stop-index="89" literal-start-index="88" literal-stop-index="94" />
</predicate>
</and-predicate>
<and-predicate>
<predicate start-index="30" stop-index="39" literal-stop-index="44">
<column name="status" start-index="30" stop-index="35" />
</predicate>
<predicate start-index="63" stop-index="74" literal-start-index="68" literal-stop-index="79">
<column name="order_id" start-index="63" stop-index="70" literal-start-index="68" literal-stop-index="75" />
</predicate>
<predicate start-index="99" stop-index="109" literal-start-index="104" literal-stop-index="114">
<column name="user_id" start-index="99" stop-index="105" literal-start-index="104" literal-stop-index="110" />
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="order_id" table-name="t_order" operator="EQUAL">
......@@ -160,6 +260,32 @@
<owner name="i" start-index="7" stop-index="7" />
</shorthand-projection>
</projections>
<where parameters-count="3" parameter-marker-start-index="0" start-index="99" stop-index="156">
<and-predicate>
<predicate start-index="106" stop-index="119">
<column name="order_id" start-index="106" stop-index="115">
<owner name="o" start-index="106" stop-index="106" />
</column>
</predicate>
<predicate start-index="144" stop-index="156">
<column name="user_id" start-index="144" stop-index="152">
<owner name="o" start-index="144" stop-index="144" />
</column>
</predicate>
</and-predicate>
<and-predicate>
<predicate start-index="124" stop-index="137">
<column name="order_id" start-index="124" stop-index="133">
<owner name="o" start-index="124" stop-index="124" />
</column>
</predicate>
<predicate start-index="144" stop-index="156">
<column name="user_id" start-index="144" stop-index="152">
<owner name="o" start-index="144" stop-index="144" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="order_id" table-name="t_order" operator="EQUAL">
......@@ -191,6 +317,42 @@
<owner name="i" start-index="7" stop-index="7" />
</shorthand-projection>
</projections>
<where parameters-count="4" parameter-marker-start-index="0" start-index="147" stop-index="221" literal-stop-index="226">
<and-predicate>
<predicate start-index="154" stop-index="167">
<column name="order_id" start-index="154" stop-index="163">
<owner name="o" start-index="154" stop-index="154" />
</column>
</predicate>
<predicate start-index="192" stop-index="204">
<column name="user_id" start-index="192" stop-index="200">
<owner name="o" start-index="192" stop-index="192" />
</column>
</predicate>
<predicate start-index="210" stop-index="221" literal-stop-index="226">
<column name="status" start-index="210" stop-index="217">
<owner name="o" start-index="210" stop-index="210" />
</column>
</predicate>
</and-predicate>
<and-predicate>
<predicate start-index="172" stop-index="185">
<column name="order_id" start-index="172" stop-index="181">
<owner name="o" start-index="172" stop-index="172" />
</column>
</predicate>
<predicate start-index="192" stop-index="204">
<column name="user_id" start-index="192" stop-index="200">
<owner name="o" start-index="192" stop-index="192" />
</column>
</predicate>
<predicate start-index="210" stop-index="221" literal-stop-index="226">
<column name="status" start-index="210" stop-index="217">
<owner name="o" start-index="210" stop-index="210" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="order_id" table-name="t_order" operator="EQUAL">
......
......@@ -40,6 +40,20 @@
<owner name="i" start-index="7" stop-index="7" />
</shorthand-projection>
</projections>
<where parameters-count="0" parameter-marker-start-index="0" start-index="42" stop-index="92">
<and-predicate>
<predicate start-index="48" stop-index="70">
<column name="order_id" start-index="48" stop-index="57">
<owner name="o" start-index="48" stop-index="48" />
</column>
</predicate>
<predicate start-index="76" stop-index="92">
<column name="status" start-index="76" stop-index="83">
<owner name="o" start-index="76" stop-index="76" />
</column>
</predicate>
</and-predicate>
</where>
<order-by-columns>
<order-by-column owner="o" name="order_id" order-direction="DESC" />
<order-by-column index="1" order-direction="ASC" />
......@@ -75,6 +89,20 @@
<owner name="i" start-index="7" stop-index="7" />
</shorthand-projection>
</projections>
<where parameters-count="0" parameter-marker-start-index="0" start-index="42" stop-index="92">
<and-predicate>
<predicate start-index="48" stop-index="70">
<column name="order_id" start-index="48" stop-index="57">
<owner name="o" start-index="48" stop-index="48" />
</column>
</predicate>
<predicate start-index="76" stop-index="92">
<column name="status" start-index="76" stop-index="83">
<owner name="o" start-index="76" stop-index="76" />
</column>
</predicate>
</and-predicate>
</where>
<order-by-columns>
<order-by-column owner="i" name="creation_date" order-direction="DESC" />
<order-by-column owner="o" name="order_id" order-direction="DESC" />
......
......@@ -27,6 +27,20 @@
<owner name="i" start-index="7" stop-index="7" />
</shorthand-projection>
</projections>
<where parameters-count="5" parameter-marker-start-index="0" start-index="99" stop-index="154" literal-stop-index="155">
<and-predicate>
<predicate start-index="105" stop-index="123">
<column name="user_id" start-index="105" stop-index="113">
<owner name="o" start-index="105" stop-index="105" />
</column>
</predicate>
<predicate start-index="129" stop-index="154" literal-stop-index="155">
<column name="order_id" start-index="129" stop-index="138">
<owner name="o" start-index="129" stop-index="129" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -55,6 +69,20 @@
<owner name="i" start-index="7" stop-index="7" />
</shorthand-projection>
</projections>
<where parameters-count="5" parameter-marker-start-index="0" start-index="99" stop-index="154" literal-stop-index="155">
<and-predicate>
<predicate start-index="105" stop-index="123">
<column name="user_id" start-index="105" stop-index="113">
<owner name="o" start-index="105" stop-index="105" />
</column>
</predicate>
<predicate start-index="129" stop-index="154" literal-stop-index="155">
<column name="order_id" start-index="129" stop-index="138">
<owner name="o" start-index="129" stop-index="129" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -83,6 +111,20 @@
<owner name="i" start-index="7" stop-index="7" />
</shorthand-projection>
</projections>
<where parameters-count="6" parameter-marker-start-index="0" start-index="103" stop-index="162" literal-stop-index="163">
<and-predicate>
<predicate start-index="109" stop-index="129">
<column name="user_id" start-delimiter="`" end-delimiter="`" start-index="109" stop-index="119">
<owner name="o" start-index="109" stop-index="109" />
</column>
</predicate>
<predicate start-index="135" stop-index="162" literal-stop-index="163">
<column name="order_id" start-delimiter="`" end-delimiter="`" start-index="135" stop-index="146">
<owner name="o" start-index="135" stop-index="135" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -112,6 +154,20 @@
<owner name="i" start-index="7" stop-index="7" />
</shorthand-projection>
</projections>
<where parameters-count="6" parameter-marker-start-index="0" start-index="103" stop-index="162" literal-stop-index="163">
<and-predicate>
<predicate start-index="109" stop-index="129">
<column name="user_id" start-delimiter="`" end-delimiter="`" start-index="109" stop-index="119">
<owner name="o" start-index="109" stop-index="109" />
</column>
</predicate>
<predicate start-index="135" stop-index="162" literal-stop-index="163">
<column name="order_id" start-delimiter="`" end-delimiter="`" start-index="135" stop-index="146">
<owner name="o" start-index="135" stop-index="135" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -153,6 +209,20 @@
<owner name="o" start-index="141" stop-index="141" />
</column-projection>
</projections>
<where parameters-count="5" parameter-marker-start-index="0" start-index="250" stop-index="305" literal-stop-index="306">
<and-predicate>
<predicate start-index="256" stop-index="274">
<column name="user_id" start-index="256" stop-index="264">
<owner name="o" start-index="256" stop-index="256" />
</column>
</predicate>
<predicate start-index="280" stop-index="305" literal-stop-index="306">
<column name="order_id" start-index="280" stop-index="289">
<owner name="o" start-index="280" stop-index="280" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -181,6 +251,20 @@
<owner name="i" start-index="7" stop-index="7" />
</shorthand-projection>
</projections>
<where parameters-count="6" parameter-marker-start-index="0" start-index="99" stop-index="154" literal-stop-index="155">
<and-predicate>
<predicate start-index="105" stop-index="123">
<column name="user_id" start-index="105" stop-index="113">
<owner name="o" start-index="105" stop-index="105" />
</column>
</predicate>
<predicate start-index="129" stop-index="154" literal-stop-index="155">
<column name="order_id" start-index="129" stop-index="138">
<owner name="o" start-index="129" stop-index="129" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -222,6 +306,16 @@
<owner name="o" start-index="141" stop-index="141" />
</column-projection>
</projections>
<where parameters-count="6" parameter-marker-start-index="0" start-index="315" stop-index="337" literal-start-index="316" literal-stop-index="338">
<and-predicate>
<!-- FIXME cannot parse subquery's predicate -->
<predicate start-index="322" stop-index="337" literal-start-index="323" literal-stop-index="338">
<column name="rownum_" start-index="322" stop-index="333" literal-start-index="323" literal-stop-index="334">
<owner name="row_" start-index="322" stop-index="325" literal-start-index="323" literal-stop-index="326" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -263,6 +357,16 @@
<owner name="o" start-index="141" stop-index="141" />
</column-projection>
</projections>
<where parameters-count="6" parameter-marker-start-index="0" start-index="315" stop-index="338" literal-start-index="316" literal-stop-index="339">
<and-predicate>
<!-- FIXME cannot parse subquery's predicate -->
<predicate start-index="322" stop-index="338" literal-start-index="323" literal-stop-index="339">
<column name="rownum_" start-index="322" stop-index="333" literal-start-index="323" literal-stop-index="334">
<owner name="row_" start-index="322" stop-index="325" literal-start-index="323" literal-stop-index="326" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -298,6 +402,24 @@
<owner name="order0_" start-index="114" stop-index="120" />
</column-projection>
</projections>
<where parameters-count="5" parameter-marker-start-index="0" start-index="253" stop-index="314" literal-stop-index="315">
<and-predicate>
<!-- FIXME cannot parse subquery's predicate -->
<!--<predicate start-index="253" stop-index="277">-->
<!--<column name="user_id" start-index="253" stop-index="267">-->
<!--<owner name="order0_" start-index="253" stop-index="253" />-->
<!--</column>-->
<!--</predicate>-->
<!--<predicate start-index="283" stop-index="314" literal-stop-index="315">-->
<!--<column name="order_id" start-index="283" stop-index="298">-->
<!--<owner name="order0_" start-index="283" stop-index="289" />-->
<!--</column>-->
<!--</predicate>-->
<predicate start-index="352" stop-index="362" literal-start-index="353" literal-stop-index="363">
<column name="rownum" start-index="352" stop-index="357" literal-start-index="353" literal-stop-index="358" />
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -332,6 +454,16 @@
<owner name="order0_" start-index="114" stop-index="120" />
</column-projection>
</projections>
<where parameters-count="6" parameter-marker-start-index="0" start-index="367" stop-index="385" literal-start-index="368" literal-stop-index="386">
<and-predicate>
<!-- FIXME cannot parse subquery's predicate -->
<predicate start-index="373" stop-index="385" literal-start-index="374" literal-stop-index="386">
<column name="rownum_" start-index="373" stop-index="381" literal-start-index="374" literal-stop-index="382">
<owner name="t" start-index="373" stop-index="373" literal-start-index="374" literal-stop-index="374" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -367,6 +499,16 @@
<owner name="order0_" start-index="114" stop-index="120" />
</column-projection>
</projections>
<where parameters-count="6" parameter-marker-start-index="0" start-index="367" stop-index="386" literal-start-index="368" literal-stop-index="387">
<and-predicate>
<!-- FIXME cannot parse subquery's predicate -->
<predicate start-index="373" stop-index="386" literal-start-index="374" literal-stop-index="387">
<column name="rownum_" start-index="373" stop-index="381" literal-start-index="374" literal-stop-index="382">
<owner name="t" start-index="373" stop-index="373" literal-start-index="374" literal-stop-index="374" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -393,6 +535,13 @@
<projections start-index="7" stop-index="7">
<shorthand-projection start-index="7" stop-index="7" />
</projections>
<where parameters-count="1" parameter-marker-start-index="0" start-index="22" stop-index="38" literal-stop-index="39">
<and-predicate>
<predicate start-index="28" stop-index="38" literal-stop-index="39">
<column name="ROWNUM" start-index="28" stop-index="33" />
</predicate>
</and-predicate>
</where>
<order-by-columns>
<order-by-column name="order_id" order-direction="ASC" />
</order-by-columns>
......
......@@ -27,6 +27,21 @@
<owner name="i" start-index="7" stop-index="7" />
</column-projection>
</projections>
<where parameters-count="6" parameter-marker-start-index="0" start-index="105" stop-index="160" literal-stop-index="161">
<and-predicate>
<predicate start-index="111" stop-index="129">
<column name="user_id" start-index="111" stop-index="119">
<owner name="o" start-index="111" stop-index="111" />
</column>
</predicate>
<predicate start-index="135" stop-index="160" literal-stop-index="161">
<column name="order_id" start-index="135" stop-index="144">
<owner name="o" start-index="135" stop-index="135" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -59,6 +74,20 @@
<owner name="i" start-index="7" stop-index="7" />
</column-projection>
</projections>
<where parameters-count="6" parameter-marker-start-index="0" start-index="105" stop-index="160" literal-stop-index="161">
<and-predicate>
<predicate start-index="111" stop-index="129">
<column name="user_id" start-index="111" stop-index="119">
<owner name="o" start-index="111" stop-index="111" />
</column>
</predicate>
<predicate start-index="135" stop-index="160" literal-stop-index="161">
<column name="order_id" start-index="135" stop-index="144">
<owner name="o" start-index="135" stop-index="135" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -103,6 +132,16 @@
<owner name="o" start-index="139" stop-index="139" />
</column-projection>
</projections>
<where parameters-count="6" parameter-marker-start-index="0" start-index="333" stop-index="354" literal-start-index="334" literal-stop-index="355">
<and-predicate>
<!-- FIXME cannot parse subquery's predicate -->
<predicate start-index="339" stop-index="354" literal-start-index="340" literal-stop-index="355">
<column name="rownum_" start-index="339" stop-index="350" literal-start-index="340" literal-stop-index="351">
<owner name="row_" start-index="339" stop-index="342" literal-start-index="340" literal-stop-index="343" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -147,6 +186,16 @@
<owner name="o" start-index="141" stop-index="141" />
</column-projection>
</projections>
<where parameters-count="6" parameter-marker-start-index="0" start-index="335" stop-index="356" literal-start-index="336" literal-stop-index="357">
<and-predicate>
<!-- FIXME cannot parse subquery's predicate -->
<predicate start-index="341" stop-index="356" literal-start-index="342" literal-stop-index="357">
<column name="rownum_" start-index="341" stop-index="352" literal-start-index="342" literal-stop-index="353">
<owner name="row_" start-index="341" stop-index="344" literal-start-index="342" literal-stop-index="345" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -191,6 +240,16 @@
<owner name="o" start-index="139" stop-index="139" />
</column-projection>
</projections>
<where parameters-count="6" parameter-marker-start-index="0" start-index="334" stop-index="355" literal-start-index="335" literal-stop-index="356">
<and-predicate>
<!-- FIXME cannot parse subquery's predicate -->
<predicate start-index="340" stop-index="355" literal-start-index="341" literal-stop-index="356">
<column name="rownum_" start-index="340" stop-index="351" literal-start-index="341" literal-stop-index="352">
<owner name="row_" start-index="340" stop-index="343" literal-start-index="341" literal-stop-index="344" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -235,6 +294,16 @@
<owner name="o" start-index="141" stop-index="141" />
</column-projection>
</projections>
<where parameters-count="6" parameter-marker-start-index="0" start-index="336" stop-index="357" literal-start-index="337" literal-stop-index="358">
<and-predicate>
<!-- FIXME cannot parse subquery's predicate -->
<predicate start-index="342" stop-index="357" literal-start-index="343" literal-stop-index="358">
<column name="rownum_" start-index="342" stop-index="353" literal-start-index="343" literal-stop-index="354">
<owner name="row_" start-index="342" stop-index="345" literal-start-index="343" literal-stop-index="346" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -273,6 +342,16 @@
<owner name="order0_" start-index="114" stop-index="120" />
</column-projection>
</projections>
<where parameters-count="6" parameter-marker-start-index="0" start-index="386" stop-index="404" literal-start-index="387" literal-stop-index="405">
<and-predicate>
<!-- FIXME cannot parse subquery's predicate -->
<predicate start-index="392" stop-index="404" literal-start-index="393" literal-stop-index="405">
<column name="rownum_" start-index="392" stop-index="400" literal-start-index="393" literal-stop-index="401">
<owner name="t" start-index="392" stop-index="392" literal-start-index="393" literal-stop-index="393" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......@@ -311,6 +390,16 @@
<owner name="order0_" start-index="114" stop-index="120" />
</column-projection>
</projections>
<where parameters-count="6" parameter-marker-start-index="0" start-index="386" stop-index="404" literal-start-index="387" literal-stop-index="405">
<and-predicate>
<!-- FIXME cannot parse subquery's predicate -->
<predicate start-index="392" stop-index="404" literal-start-index="393" literal-stop-index="405">
<column name="rownum_" start-index="392" stop-index="400" literal-start-index="393" literal-stop-index="401">
<owner name="t" start-index="392" stop-index="392" literal-start-index="393" literal-stop-index="393" />
</column>
</predicate>
</and-predicate>
</where>
<sharding-conditions>
<and-condition>
<condition column-name="user_id" table-name="t_order" operator="IN">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册