lwtdev commented on a change in pull request #8604:
URL: https://github.com/apache/shardingsphere/pull/8604#discussion_r543295657
##########
File path:
shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/case/dml/select-pagination-group-by-order-by.xml
##########
@@ -128,991 +166,1364 @@
</from>
<projections start-index="7" stop-index="15">
<column-projection name="user_id" start-index="7" stop-index="15">
- <owner name="i" start-index="7" stop-index="7" />
+ <owner name="i" start-index="7" stop-index="7"/>
</column-projection>
</projections>
<where start-index="105" stop-index="160" literal-stop-index="161">
- <and-predicate>
- <predicate start-index="111" stop-index="129">
- <column-left-value name="user_id" start-index="111"
stop-index="119">
- <owner name="o" start-index="111" stop-index="111" />
- </column-left-value>
- <in-right-value>
- <parameter-marker-expression value="0"
start-index="125" stop-index="125" />
- <parameter-marker-expression value="1"
start-index="128" stop-index="128" />
- <literal-expression value="1" start-index="125"
stop-index="125" />
- <literal-expression value="2" start-index="128"
stop-index="128" />
- </in-right-value>
- </predicate>
- <predicate start-index="135" stop-index="160"
literal-stop-index="161">
- <column-left-value name="order_id" start-index="135"
stop-index="144">
- <owner name="o" start-index="135" stop-index="135" />
- </column-left-value>
- <between-right-value>
- <between-parameter-marker-expression value="2"
start-index="154" stop-index="154" />
- <between-literal-expression value="9"
start-index="154" stop-index="154" />
- <and-parameter-marker-expression value="3"
start-index="160" stop-index="160" />
- <and-literal-expression value="10" start-index="160"
stop-index="161" />
- </between-right-value>
- </predicate>
- </and-predicate>
+ <expr>
+ <binary-operation-expression start-index="111" stop-index="160"
+ literal-stop-index="161">
+ <left>
+ <in-expression start-index="111" stop-index="129">
+ <not>false</not>
+ <left>
+ <column name="user_id" start-index="111"
stop-index="119">
+ <owner name="o" start-index="111"
stop-index="111"/>
+ </column>
+ </left>
+ <right>
+ <list-expression start-index="124"
stop-index="129">
+ <items>
+ <literal-expression value="1"
start-index="125"
+ stop-index="125"/>
+ <parameter-marker-expression value="0"
start-index="125"
+
stop-index="125"/>
+ </items>
+ <items>
+ <literal-expression value="2"
start-index="128"
+ stop-index="128"/>
+ <parameter-marker-expression value="1"
start-index="128"
+
stop-index="128"/>
+ </items>
+ </list-expression>
+ </right>
+ </in-expression>
+ </left>
+ <operator>AND</operator>
+ <right>
+ <between-expression start-index="135" stop-index="160"
+ literal-stop-index="161">
+ <not>false</not>
+ <left>
+ <column name="order_id" start-index="135"
stop-index="144">
+ <owner name="o" start-index="135"
stop-index="135"/>
+ </column>
+ </left>
+ <between-expr>
+ <literal-expression value="9"
start-index="154" stop-index="154"/>
+ <parameter-marker-expression value="2"
start-index="154"
+ stop-index="154"/>
+ </between-expr>
+ <and-expr>
+ <literal-expression value="10"
start-index="160" stop-index="161"/>
+ <parameter-marker-expression value="3"
start-index="160"
+ stop-index="160"/>
+ </and-expr>
+ </between-expression>
+ </right>
+ </binary-operation-expression>
+ </expr>
</where>
<group-by>
- <column-item name="user_id" start-index="171" stop-index="179"
literal-start-index="172" literal-stop-index="180">
- <owner name="i" start-index="171" stop-index="171"
literal-start-index="172" literal-stop-index="172" />
+ <column-item name="user_id" start-index="171" stop-index="179"
literal-start-index="172"
+ literal-stop-index="180">
+ <owner name="i" start-index="171" stop-index="171"
literal-start-index="172"
+ literal-stop-index="172"/>
</column-item>
</group-by>
<order-by>
- <column-item name="item_id" order-direction="DESC"
start-index="190" stop-index="198" literal-start-index="191"
literal-stop-index="199">
- <owner name="i" start-index="190" stop-index="190"
literal-start-index="191" literal-stop-index="191" />
+ <column-item name="item_id" order-direction="DESC"
start-index="190" stop-index="198"
+ literal-start-index="191" literal-stop-index="199">
+ <owner name="i" start-index="190" stop-index="190"
literal-start-index="191"
+ literal-stop-index="191"/>
</column-item>
</order-by>
- <limit start-index="205" stop-index="214" literal-start-index="206"
literal-stop-index="215">
- <offset value="5" parameter-index="4" start-index="211"
stop-index="211" literal-start-index="212" literal-stop-index="212" />
- <row-count value="3" parameter-index="5" start-index="214"
stop-index="214" literal-start-index="215" literal-stop-index="215" />
+ <limit start-index="205" stop-index="214" literal-start-index="206"
+ literal-stop-index="215">
+ <offset value="5" parameter-index="4" start-index="211"
stop-index="211"
+ literal-start-index="212" literal-stop-index="212"/>
+ <row-count value="3" parameter-index="5" start-index="214"
stop-index="214"
+ literal-start-index="215" literal-stop-index="215"/>
</limit>
</select>
- <select sql-case-id="select_pagination_with_top_and_group_by_and_order_by"
parameters="3, 1, 2, 9, 10, 6">
+ <select sql-case-id="select_pagination_with_top_and_group_by_and_order_by"
+ parameters="3, 1, 2, 9, 10, 6">
<projections start-index="7" stop-index="7">
- <shorthand-projection start-index="7" stop-index="7" />
+ <shorthand-projection start-index="7" stop-index="7"/>
</projections>
<from>
<subquery-table alias="row_">
<subquery>
<select>
<projections start-index="22" stop-index="158">
<top-projection alias="rownum_" start-index="22"
stop-index="70">
- <top-value value="3" parameter-index="0"
start-index="26" stop-index="26" />
+ <top-value value="3" parameter-index="0"
start-index="26"
+ stop-index="26"/>
</top-projection>
<column-projection name="item_id" start-index="84"
stop-index="92">
- <owner name="i" start-index="84"
stop-index="84" />
+ <owner name="i" start-index="84"
stop-index="84"/>
</column-projection>
- <column-projection name="order_id"
alias="order_id" start-index="95" stop-index="104">
- <owner name="o" start-index="95"
stop-index="95" />
+ <column-projection name="order_id"
alias="order_id" start-index="95"
+ stop-index="104">
+ <owner name="o" start-index="95"
stop-index="95"/>
</column-projection>
- <column-projection name="status" alias="status"
start-index="119" stop-index="126">
- <owner name="o" start-index="119"
stop-index="119" />
+ <column-projection name="status" alias="status"
start-index="119"
+ stop-index="126">
+ <owner name="o" start-index="119"
stop-index="119"/>
</column-projection>
- <column-projection name="user_id" alias="user_id"
start-index="139" stop-index="147">
- <owner name="o" start-index="139"
stop-index="139" />
+ <column-projection name="user_id" alias="user_id"
start-index="139"
+ stop-index="147">
+ <owner name="o" start-index="139"
stop-index="139"/>
</column-projection>
</projections>
<from>
<join-table>
<left>
- <simple-table start-index="165"
stop-index="173" name="t_order" alias="o" />
+ <simple-table start-index="165"
stop-index="173" name="t_order"
+ alias="o"/>
</left>
<right>
- <simple-table start-index="180"
stop-index="193" name="t_order_item" alias="i" />
+ <simple-table start-index="180"
stop-index="193"
+ name="t_order_item"
alias="i"/>
</right>
<joinSpecification>
<and-predicate>
<predicate start-index="198"
stop-index="218">
- <column-left-value name="user_id"
start-index="198" stop-index="206">
- <owner name="o"
start-index="198" stop-index="198" />
+ <column-left-value name="user_id"
start-index="198"
+
stop-index="206">
+ <owner name="o"
start-index="198" stop-index="198"/>
</column-left-value>
- <column-right-value name="user_id"
start-index="210" stop-index="218">
- <owner name="i"
start-index="210" stop-index="210" />
+ <column-right-value name="user_id"
start-index="210"
+
stop-index="218">
+ <owner name="i"
start-index="210" stop-index="210"/>
</column-right-value>
</predicate>
<predicate start-index="224"
stop-index="246">
- <column-left-value name="order_id"
start-index="224" stop-index="233">
- <owner name="o"
start-index="224" stop-index="224" />
+ <column-left-value name="order_id"
start-index="224"
+
stop-index="233">
+ <owner name="o"
start-index="224" stop-index="224"/>
</column-left-value>
- <column-right-value
name="order_id" start-index="237" stop-index="246">
- <owner name="i"
start-index="237" stop-index="237" />
+ <column-right-value
name="order_id" start-index="237"
+
stop-index="246">
+ <owner name="i"
start-index="237" stop-index="237"/>
</column-right-value>
</predicate>
</and-predicate>
</joinSpecification>
</join-table>
</from>
<where start-index="248" stop-index="303"
literal-stop-index="304">
- <and-predicate>
- <predicate start-index="254" stop-index="272">
- <column-left-value name="user_id"
start-index="254" stop-index="262">
- <owner name="o" start-index="254"
stop-index="254" />
- </column-left-value>
- <in-right-value>
- <parameter-marker-expression value="1"
start-index="268" stop-index="268" />
- <parameter-marker-expression value="2"
start-index="271" stop-index="271" />
- <literal-expression value="1"
start-index="268" stop-index="268" />
- <literal-expression value="2"
start-index="271" stop-index="271" />
- </in-right-value>
- </predicate>
- <predicate start-index="278" stop-index="303"
literal-stop-index="304">
- <column-left-value name="order_id"
start-index="278" stop-index="287">
- <owner name="o" start-index="278"
stop-index="278" />
- </column-left-value>
- <between-right-value>
- <between-parameter-marker-expression
value="3" start-index="297" stop-index="297" />
- <and-parameter-marker-expression
value="4" start-index="303" stop-index="303" />
- <between-literal-expression value="9"
start-index="297" stop-index="297" />
- <and-literal-expression value="10"
start-index="303" stop-index="304" />
- </between-right-value>
- </predicate>
- </and-predicate>
+ <expr>
+ <binary-operation-expression start-index="254"
stop-index="303" literal-stop-index="304">
+ <left>
+ <in-expression start-index="254"
stop-index="272">
+ <not>false</not>
+ <left>
+ <column name="user_id"
start-index="254" stop-index="262">
+ <owner name="o"
start-index="254" stop-index="254" />
+ </column>
+ </left>
+ <right>
+ <list-expression
start-index="267" stop-index="272">
+ <items>
+ <literal-expression
value="1" start-index="268" stop-index="268" />
+
<parameter-marker-expression value="1" start-index="268" stop-index="268" />
+ </items>
+ <items>
+ <literal-expression
value="2" start-index="271" stop-index="271" />
+
<parameter-marker-expression value="2" start-index="271" stop-index="271" />
+ </items>
+ </list-expression>
+ </right>
+ </in-expression>
+ </left>
+ <operator>AND</operator>
+ <right>
+ <between-expression start-index="278"
stop-index="303" literal-stop-index="304">
+ <not>false</not>
+ <left>
+ <column name="order_id"
start-index="278" stop-index="287">
+ <owner name="o"
start-index="278" stop-index="278" />
+ </column>
+ </left>
+ <between-expr>
+ <literal-expression value="9"
start-index="297" stop-index="297" />
+ <parameter-marker-expression
value="3" start-index="297" stop-index="297" />
+ </between-expr>
+ <and-expr>
+ <literal-expression value="10"
start-index="303" stop-index="304" />
+ <parameter-marker-expression
value="4" start-index="303" stop-index="303" />
+ </and-expr>
+ </between-expression>
+ </right>
+ </binary-operation-expression>
+ </expr>
</where>
<group-by>
- <column-item name="item_id" start-index="314"
stop-index="322" literal-start-index="315" literal-stop-index="323">
- <owner name="i" start-index="314"
stop-index="314" literal-start-index="315" literal-stop-index="315" />
+ <column-item name="item_id" start-index="314"
stop-index="322"
+ literal-start-index="315"
literal-stop-index="323">
+ <owner name="i" start-index="314"
stop-index="314"
+ literal-start-index="315"
literal-stop-index="315"/>
</column-item>
</group-by>
</select>
</subquery>
</subquery-table>
</from>
<where start-index="333" stop-index="354" literal-start-index="334"
literal-stop-index="355">
- <and-predicate>
- <predicate start-index="339" stop-index="354"
literal-start-index="340" literal-stop-index="355">
- <column-left-value start-index="339" stop-index="350"
literal-start-index="340" literal-stop-index="351" name="rownum_">
- <owner start-index="339" stop-index="342"
literal-start-index="340" literal-stop-index="343" name="row_" />
- </column-left-value>
- <operator type=">" />
- <compare-right-value>
- <parameter-marker-expression start-index="354"
stop-index="354" value="5" />
- <literal-expression start-index="355" stop-index="355"
value="6" />
- </compare-right-value>
- </predicate>
- </and-predicate>
+ <expr>
+ <binary-operation-expression start-index="339"
stop-index="354" literal-start-index="340" literal-stop-index="355">
+ <left>
+ <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>
+ </left>
+ <operator>></operator>
+ <right>
+ <literal-expression value="6" start-index="355"
stop-index="355" />
+ <parameter-marker-expression value="5"
start-index="354" stop-index="354" />
+ </right>
+ </binary-operation-expression>
+ </expr>
</where>
</select>
- <select
sql-case-id="select_pagination_with_top_percent_with_ties_and_group_by_and_order_by"
parameters="3, 1, 2, 9, 10, 6">
+ <select
sql-case-id="select_pagination_with_top_percent_with_ties_and_group_by_and_order_by"
+ parameters="3, 1, 2, 9, 10, 6">
<projections start-index="7" stop-index="7">
- <shorthand-projection start-index="7" stop-index="7" />
+ <shorthand-projection start-index="7" stop-index="7"/>
</projections>
<from>
<subquery-table alias="row_">
<subquery>
<select>
<projections start-index="22" stop-index="176">
<top-projection alias="rownum_" start-index="22"
stop-index="88">
- <top-value value="3" parameter-index="0"
start-index="26" stop-index="26" />
+ <top-value value="3" parameter-index="0"
start-index="26"
+ stop-index="26"/>
</top-projection>
<column-projection name="item_id"
start-index="102" stop-index="110">
- <owner name="i" start-index="102"
stop-index="102" />
+ <owner name="i" start-index="102"
stop-index="102"/>
</column-projection>
- <column-projection name="order_id"
alias="order_id" start-index="113" stop-index="122">
- <owner name="o" start-index="113"
stop-index="113" />
+ <column-projection name="order_id"
alias="order_id" start-index="113"
+ stop-index="122">
+ <owner name="o" start-index="113"
stop-index="113"/>
</column-projection>
- <column-projection name="status" alias="status"
start-index="137" stop-index="144">
- <owner name="o" start-index="137"
stop-index="137" />
+ <column-projection name="status" alias="status"
start-index="137"
+ stop-index="144">
+ <owner name="o" start-index="137"
stop-index="137"/>
</column-projection>
- <column-projection name="user_id" alias="user_id"
start-index="157" stop-index="165">
- <owner name="o" start-index="157"
stop-index="157" />
+ <column-projection name="user_id" alias="user_id"
start-index="157"
+ stop-index="165">
+ <owner name="o" start-index="157"
stop-index="157"/>
</column-projection>
</projections>
<from>
<join-table>
<left>
- <simple-table start-index="183"
stop-index="191" name="t_order" alias="o" />
+ <simple-table start-index="183"
stop-index="191" name="t_order"
+ alias="o"/>
</left>
<right>
- <simple-table start-index="198"
stop-index="211" name="t_order_item" alias="i" />
+ <simple-table start-index="198"
stop-index="211"
+ name="t_order_item"
alias="i"/>
</right>
<joinSpecification>
<and-predicate>
<predicate start-index="216"
stop-index="236">
- <column-left-value name="user_id"
start-index="216" stop-index="224">
- <owner name="o"
start-index="216" stop-index="216" />
+ <column-left-value name="user_id"
start-index="216"
+
stop-index="224">
+ <owner name="o"
start-index="216" stop-index="216"/>
</column-left-value>
- <column-right-value name="user_id"
start-index="228" stop-index="236">
- <owner name="i"
start-index="228" stop-index="228" />
+ <column-right-value name="user_id"
start-index="228"
+
stop-index="236">
+ <owner name="i"
start-index="228" stop-index="228"/>
</column-right-value>
</predicate>
<predicate start-index="242"
stop-index="264">
- <column-left-value name="order_id"
start-index="242" stop-index="251">
- <owner name="o"
start-index="242" stop-index="242" />
+ <column-left-value name="order_id"
start-index="242"
+
stop-index="251">
+ <owner name="o"
start-index="242" stop-index="242"/>
</column-left-value>
- <column-right-value
name="order_id" start-index="255" stop-index="264">
- <owner name="i"
start-index="255" stop-index="255" />
+ <column-right-value
name="order_id" start-index="255"
+
stop-index="264">
+ <owner name="i"
start-index="255" stop-index="255"/>
</column-right-value>
</predicate>
</and-predicate>
</joinSpecification>
</join-table>
</from>
<where start-index="266" stop-index="321"
literal-stop-index="322">
- <and-predicate>
- <predicate start-index="272" stop-index="290">
- <column-left-value name="user_id"
start-index="272" stop-index="280">
- <owner name="o" start-index="272"
stop-index="272" />
- </column-left-value>
- <in-right-value>
- <parameter-marker-expression value="1"
start-index="286" stop-index="286" />
- <parameter-marker-expression value="2"
start-index="289" stop-index="289" />
- <literal-expression value="1"
start-index="286" stop-index="286" />
- <literal-expression value="2"
start-index="289" stop-index="289" />
- </in-right-value>
- </predicate>
- <predicate start-index="296" stop-index="321"
literal-stop-index="322">
- <column-left-value name="order_id"
start-index="296" stop-index="305">
- <owner name="o" start-index="296"
stop-index="296" />
- </column-left-value>
- <between-right-value>
- <between-parameter-marker-expression
value="3" start-index="315" stop-index="315" />
- <and-parameter-marker-expression
value="4" start-index="321" stop-index="321" />
- <between-literal-expression value="9"
start-index="315" stop-index="315" />
- <and-literal-expression value="10"
start-index="321" stop-index="322" />
- </between-right-value>
- </predicate>
- </and-predicate>
+ <expr>
+ <binary-operation-expression start-index="272"
stop-index="321" literal-stop-index="322">
+ <left>
+ <in-expression start-index="272"
stop-index="290">
+ <not>false</not>
+ <left>
+ <column name="user_id"
start-index="272" stop-index="280">
+ <owner name="o"
start-index="272" stop-index="272" />
+ </column>
+ </left>
+ <right>
+ <list-expression
start-index="285" stop-index="290">
+ <items>
+ <literal-expression
value="1" start-index="286" stop-index="286" />
+
<parameter-marker-expression value="1" start-index="286" stop-index="286" />
+ </items>
+ <items>
+ <literal-expression
value="2" start-index="289" stop-index="289" />
+
<parameter-marker-expression value="2" start-index="289" stop-index="289" />
+ </items>
+ </list-expression>
+ </right>
+ </in-expression>
+ </left>
+ <operator>AND</operator>
+ <right>
+ <between-expression start-index="296"
stop-index="321" literal-stop-index="322">
+ <not>false</not>
+ <left>
+ <column name="order_id"
start-index="296" stop-index="305">
+ <owner name="o"
start-index="296" stop-index="296" />
+ </column>
+ </left>
+ <between-expr>
+ <literal-expression value="9"
start-index="315" stop-index="315" />
+ <parameter-marker-expression
value="3" start-index="315" stop-index="315" />
+ </between-expr>
+ <and-expr>
+ <literal-expression value="10"
start-index="321" stop-index="322" />
+ <parameter-marker-expression
value="4" start-index="321" stop-index="321" />
+ </and-expr>
+ </between-expression>
+ </right>
+ </binary-operation-expression>
+ </expr>
</where>
<group-by>
- <column-item name="item_id" start-index="332"
stop-index="340" literal-start-index="333" literal-stop-index="341">
- <owner name="i" start-index="332"
stop-index="332" literal-start-index="333" literal-stop-index="333" />
+ <column-item name="item_id" start-index="332"
stop-index="340"
+ literal-start-index="333"
literal-stop-index="341">
+ <owner name="i" start-index="332"
stop-index="332"
+ literal-start-index="333"
literal-stop-index="333"/>
</column-item>
</group-by>
</select>
</subquery>
</subquery-table>
</from>
<where start-index="351" stop-index="372" literal-start-index="352"
literal-stop-index="373">
- <and-predicate>
- <predicate start-index="357" stop-index="372"
literal-start-index="358" literal-stop-index="373">
- <column-left-value start-index="357" stop-index="368"
literal-start-index="358" literal-stop-index="369" name="rownum_">
- <owner start-index="357" stop-index="360"
literal-start-index="358" literal-stop-index="361" name="row_" />
- </column-left-value>
- <operator type=">" />
- <compare-right-value>
- <parameter-marker-expression start-index="372"
stop-index="372" value="5" />
- <literal-expression start-index="373" stop-index="373"
value="6" />
- </compare-right-value>
- </predicate>
- </and-predicate>
+ <expr>
+ <binary-operation-expression start-index="357"
stop-index="372" literal-start-index="358" literal-stop-index="373">
+ <left>
+ <column name="rownum_" start-index="357"
stop-index="368" literal-start-index="358" literal-stop-index="369">
+ <owner name="row_" start-index="357"
stop-index="360" literal-start-index="358" literal-stop-index="361" />
+ </column>
+ </left>
+ <operator>></operator>
+ <right>
+ <literal-expression value="6" start-index="373"
stop-index="373" />
+ <parameter-marker-expression value="5"
start-index="372" stop-index="372" />
+ </right>
+ </binary-operation-expression>
+ </expr>
</where>
</select>
- <select
sql-case-id="select_pagination_with_top_and_group_by_and_order_by_and_parentheses"
parameters="3, 1, 2, 9, 10, 6">
+ <select
sql-case-id="select_pagination_with_top_and_group_by_and_order_by_and_parentheses"
+ parameters="3, 1, 2, 9, 10, 6">
<projections start-index="7" stop-index="7">
- <shorthand-projection start-index="7" stop-index="7" />
+ <shorthand-projection start-index="7" stop-index="7"/>
</projections>
<from>
<subquery-table alias="row_">
<subquery>
<select>
<projections start-index="22" stop-index="160">
<top-projection alias="rownum_" start-index="22"
stop-index="72">
- <top-value value="3" parameter-index="0"
start-index="27" stop-index="27" />
+ <top-value value="3" parameter-index="0"
start-index="27"
+ stop-index="27"/>
</top-projection>
<column-projection name="item_id" start-index="86"
stop-index="94">
- <owner name="i" start-index="86"
stop-index="86" />
+ <owner name="i" start-index="86"
stop-index="86"/>
</column-projection>
- <column-projection name="order_id"
alias="order_id" start-index="97" stop-index="106">
- <owner name="o" start-index="97"
stop-index="97" />
+ <column-projection name="order_id"
alias="order_id" start-index="97"
+ stop-index="106">
+ <owner name="o" start-index="97"
stop-index="97"/>
</column-projection>
- <column-projection name="status" alias="status"
start-index="121" stop-index="128">
- <owner name="o" start-index="121"
stop-index="121" />
+ <column-projection name="status" alias="status"
start-index="121"
+ stop-index="128">
+ <owner name="o" start-index="121"
stop-index="121"/>
</column-projection>
- <column-projection name="user_id" alias="user_id"
start-index="141" stop-index="149">
- <owner name="o" start-index="141"
stop-index="141" />
+ <column-projection name="user_id" alias="user_id"
start-index="141"
+ stop-index="149">
+ <owner name="o" start-index="141"
stop-index="141"/>
</column-projection>
</projections>
<from>
<join-table>
<left>
- <simple-table start-index="167"
stop-index="175" name="t_order" alias="o" />
+ <simple-table start-index="167"
stop-index="175" name="t_order"
+ alias="o"/>
</left>
<right>
- <simple-table start-index="182"
stop-index="195" name="t_order_item" alias="i" />
+ <simple-table start-index="182"
stop-index="195"
+ name="t_order_item"
alias="i"/>
</right>
<joinSpecification>
<and-predicate>
<predicate start-index="200"
stop-index="220">
- <column-left-value name="user_id"
start-index="200" stop-index="208">
- <owner name="o"
start-index="200" stop-index="200" />
+ <column-left-value name="user_id"
start-index="200"
+
stop-index="208">
+ <owner name="o"
start-index="200" stop-index="200"/>
</column-left-value>
- <column-right-value name="user_id"
start-index="212" stop-index="220">
- <owner name="i"
start-index="212" stop-index="212" />
+ <column-right-value name="user_id"
start-index="212"
+
stop-index="220">
+ <owner name="i"
start-index="212" stop-index="212"/>
</column-right-value>
</predicate>
<predicate start-index="226"
stop-index="248">
- <column-left-value name="order_id"
start-index="226" stop-index="235">
- <owner name="o"
start-index="226" stop-index="226" />
+ <column-left-value name="order_id"
start-index="226"
+
stop-index="235">
+ <owner name="o"
start-index="226" stop-index="226"/>
</column-left-value>
- <column-right-value
name="order_id" start-index="239" stop-index="248">
- <owner name="i"
start-index="239" stop-index="239" />
+ <column-right-value
name="order_id" start-index="239"
+
stop-index="248">
+ <owner name="i"
start-index="239" stop-index="239"/>
</column-right-value>
</predicate>
</and-predicate>
</joinSpecification>
</join-table>
</from>
<where start-index="250" stop-index="305"
literal-stop-index="306">
- <and-predicate>
- <predicate start-index="256" stop-index="274">
- <column-left-value name="user_id"
start-index="256" stop-index="264">
- <owner name="o" start-index="256"
stop-index="256" />
- </column-left-value>
- <in-right-value>
- <parameter-marker-expression value="1"
start-index="270" stop-index="270" />
- <parameter-marker-expression value="2"
start-index="273" stop-index="273" />
- <literal-expression value="1"
start-index="270" stop-index="270" />
- <literal-expression value="2"
start-index="273" stop-index="273" />
- </in-right-value>
- </predicate>
- <predicate start-index="280" stop-index="305"
literal-stop-index="306">
- <column-left-value name="order_id"
start-index="280" stop-index="289">
- <owner name="o" start-index="280"
stop-index="280" />
- </column-left-value>
- <between-right-value>
- <between-parameter-marker-expression
value="3" start-index="299" stop-index="299" />
- <and-parameter-marker-expression
value="4" start-index="305" stop-index="305" />
- <between-literal-expression value="9"
start-index="299" stop-index="299" />
- <and-literal-expression value="10"
start-index="305" stop-index="306" />
- </between-right-value>
- </predicate>
- </and-predicate>
+ <expr>
+ <binary-operation-expression start-index="256"
stop-index="305" literal-stop-index="306">
+ <left>
+ <in-expression start-index="256"
stop-index="274">
+ <not>false</not>
+ <left>
+ <column name="user_id"
start-index="256" stop-index="264">
+ <owner name="o"
start-index="256" stop-index="256" />
+ </column>
+ </left>
+ <right>
+ <list-expression
start-index="269" stop-index="274">
+ <items>
+ <literal-expression
value="1" start-index="270" stop-index="270" />
+
<parameter-marker-expression value="1" start-index="270" stop-index="270" />
+ </items>
+ <items>
+ <literal-expression
value="2" start-index="273" stop-index="273" />
+
<parameter-marker-expression value="2" start-index="273" stop-index="273" />
+ </items>
+ </list-expression>
+ </right>
+ </in-expression>
+ </left>
+ <operator>AND</operator>
+ <right>
+ <between-expression start-index="280"
stop-index="305" literal-stop-index="306">
+ <not>false</not>
+ <left>
+ <column name="order_id"
start-index="280" stop-index="289">
+ <owner name="o"
start-index="280" stop-index="280" />
+ </column>
+ </left>
+ <between-expr>
+ <literal-expression value="9"
start-index="299" stop-index="299" />
+ <parameter-marker-expression
value="3" start-index="299" stop-index="299" />
+ </between-expr>
+ <and-expr>
+ <literal-expression value="10"
start-index="305" stop-index="306" />
+ <parameter-marker-expression
value="4" start-index="305" stop-index="305" />
+ </and-expr>
+ </between-expression>
+ </right>
+ </binary-operation-expression>
+ </expr>
</where>
<group-by>
- <column-item name="item_id" start-index="316"
stop-index="324" literal-start-index="317" literal-stop-index="325">
- <owner name="i" start-index="316"
stop-index="316" literal-start-index="317" literal-stop-index="317" />
+ <column-item name="item_id" start-index="316"
stop-index="324"
+ literal-start-index="317"
literal-stop-index="325">
+ <owner name="i" start-index="316"
stop-index="316"
+ literal-start-index="317"
literal-stop-index="317"/>
</column-item>
</group-by>
</select>
</subquery>
</subquery-table>
</from>
<where start-index="335" stop-index="356" literal-start-index="336"
literal-stop-index="357">
- <and-predicate>
- <predicate start-index="341" stop-index="356"
literal-start-index="342" literal-stop-index="357">
- <column-left-value start-index="341" stop-index="352"
literal-start-index="342" literal-stop-index="353" name="rownum_">
- <owner start-index="341" stop-index="344"
literal-start-index="342" literal-stop-index="345" name="row_" />
- </column-left-value>
- <operator type=">" />
- <compare-right-value>
- <parameter-marker-expression start-index="356"
stop-index="356" value="5" />
- <literal-expression start-index="357" stop-index="357"
value="6" />
- </compare-right-value>
- </predicate>
- </and-predicate>
+ <expr>
+ <binary-operation-expression start-index="341"
stop-index="356" literal-start-index="342" literal-stop-index="357">
+ <left>
+ <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>
+ </left>
+ <operator>></operator>
+ <right>
+ <literal-expression value="6" start-index="357"
stop-index="357" />
+ <parameter-marker-expression value="5"
start-index="356" stop-index="356" />
+ </right>
+ </binary-operation-expression>
+ </expr>
</where>
</select>
- <select
sql-case-id="select_pagination_with_top_percent_with_ties_and_group_by_and_order_by_and_parentheses"
parameters="3, 1, 2, 9, 10, 6">
+ <select
sql-case-id="select_pagination_with_top_percent_with_ties_and_group_by_and_order_by_and_parentheses"
+ parameters="3, 1, 2, 9, 10, 6">
<projections start-index="7" stop-index="7">
- <shorthand-projection start-index="7" stop-index="7" />
+ <shorthand-projection start-index="7" stop-index="7"/>
</projections>
<from>
<subquery-table alias="row_">
<subquery>
<select>
<projections start-index="22" stop-index="178">
<top-projection alias="rownum_" start-index="22"
stop-index="90">
- <top-value value="3" parameter-index="0"
start-index="27" stop-index="27" />
+ <top-value value="3" parameter-index="0"
start-index="27"
+ stop-index="27"/>
</top-projection>
<column-projection name="item_id"
start-index="104" stop-index="112">
- <owner name="i" start-index="104"
stop-index="104" />
+ <owner name="i" start-index="104"
stop-index="104"/>
</column-projection>
- <column-projection name="order_id"
alias="order_id" start-index="115" stop-index="124">
- <owner name="o" start-index="115"
stop-index="115" />
+ <column-projection name="order_id"
alias="order_id" start-index="115"
+ stop-index="124">
+ <owner name="o" start-index="115"
stop-index="115"/>
</column-projection>
- <column-projection name="status" alias="status"
start-index="139" stop-index="146">
- <owner name="o" start-index="139"
stop-index="139" />
+ <column-projection name="status" alias="status"
start-index="139"
+ stop-index="146">
+ <owner name="o" start-index="139"
stop-index="139"/>
</column-projection>
- <column-projection name="user_id" alias="user_id"
start-index="159" stop-index="167">
- <owner name="o" start-index="159"
stop-index="159" />
+ <column-projection name="user_id" alias="user_id"
start-index="159"
+ stop-index="167">
+ <owner name="o" start-index="159"
stop-index="159"/>
</column-projection>
</projections>
<from>
<join-table>
<left>
- <simple-table start-index="185"
stop-index="193" name="t_order" alias="o" />
+ <simple-table start-index="185"
stop-index="193" name="t_order"
+ alias="o"/>
</left>
<right>
- <simple-table start-index="200"
stop-index="213" name="t_order_item" alias="i" />
+ <simple-table start-index="200"
stop-index="213"
+ name="t_order_item"
alias="i"/>
</right>
<joinSpecification>
<and-predicate>
<predicate start-index="218"
stop-index="238">
- <column-left-value name="user_id"
start-index="218" stop-index="226">
- <owner name="o"
start-index="218" stop-index="218" />
+ <column-left-value name="user_id"
start-index="218"
+
stop-index="226">
+ <owner name="o"
start-index="218" stop-index="218"/>
</column-left-value>
- <column-right-value name="user_id"
start-index="230" stop-index="238">
- <owner name="i"
start-index="230" stop-index="230" />
+ <column-right-value name="user_id"
start-index="230"
+
stop-index="238">
+ <owner name="i"
start-index="230" stop-index="230"/>
</column-right-value>
</predicate>
<predicate start-index="244"
stop-index="266">
- <column-left-value name="order_id"
start-index="244" stop-index="253">
- <owner name="o"
start-index="244" stop-index="244" />
+ <column-left-value name="order_id"
start-index="244"
+
stop-index="253">
+ <owner name="o"
start-index="244" stop-index="244"/>
</column-left-value>
- <column-right-value
name="order_id" start-index="257" stop-index="266">
- <owner name="i"
start-index="257" stop-index="257" />
+ <column-right-value
name="order_id" start-index="257"
+
stop-index="266">
+ <owner name="i"
start-index="257" stop-index="257"/>
</column-right-value>
</predicate>
</and-predicate>
</joinSpecification>
</join-table>
</from>
<where start-index="268" stop-index="323"
literal-stop-index="324">
- <and-predicate>
- <predicate start-index="274" stop-index="292">
- <column-left-value name="user_id"
start-index="274" stop-index="282">
- <owner name="o" start-index="274"
stop-index="274" />
- </column-left-value>
- <in-right-value>
- <parameter-marker-expression value="1"
start-index="288" stop-index="288" />
- <parameter-marker-expression value="2"
start-index="291" stop-index="291" />
- <literal-expression value="1"
start-index="288" stop-index="288" />
- <literal-expression value="2"
start-index="291" stop-index="291" />
- </in-right-value>
- </predicate>
- <predicate start-index="298" stop-index="323"
literal-stop-index="324">
- <column-left-value name="order_id"
start-index="298" stop-index="307">
- <owner name="o" start-index="298"
stop-index="298" />
- </column-left-value>
- <between-right-value>
- <between-parameter-marker-expression
value="3" start-index="317" stop-index="317" />
- <and-parameter-marker-expression
value="4" start-index="323" stop-index="323" />
- <between-literal-expression value="9"
start-index="317" stop-index="317" />
- <and-literal-expression value="10"
start-index="323" stop-index="324" />
- </between-right-value>
- </predicate>
- </and-predicate>
+ <expr>
+ <binary-operation-expression start-index="274"
stop-index="323" literal-stop-index="324">
+ <left>
+ <in-expression start-index="274"
stop-index="292">
+ <not>false</not>
+ <left>
+ <column name="user_id"
start-index="274" stop-index="282">
+ <owner name="o"
start-index="274" stop-index="274" />
+ </column>
+ </left>
+ <right>
+ <list-expression
start-index="287" stop-index="292">
+ <items>
+ <literal-expression
value="1" start-index="288" stop-index="288" />
+
<parameter-marker-expression value="1" start-index="288" stop-index="288" />
+ </items>
+ <items>
+ <literal-expression
value="2" start-index="291" stop-index="291" />
+
<parameter-marker-expression value="2" start-index="291" stop-index="291" />
+ </items>
+ </list-expression>
+ </right>
+ </in-expression>
+ </left>
+ <operator>AND</operator>
+ <right>
+ <between-expression start-index="298"
stop-index="323" literal-stop-index="324">
+ <not>false</not>
+ <left>
+ <column name="order_id"
start-index="298" stop-index="307">
+ <owner name="o"
start-index="298" stop-index="298" />
+ </column>
+ </left>
+ <between-expr>
+ <literal-expression value="9"
start-index="317" stop-index="317" />
+ <parameter-marker-expression
value="3" start-index="317" stop-index="317" />
+ </between-expr>
+ <and-expr>
+ <literal-expression value="10"
start-index="323" stop-index="324" />
+ <parameter-marker-expression
value="4" start-index="323" stop-index="323" />
+ </and-expr>
+ </between-expression>
+ </right>
+ </binary-operation-expression>
+ </expr>
</where>
<group-by>
- <column-item name="item_id" start-index="334"
stop-index="342" literal-start-index="335" literal-stop-index="343">
- <owner name="i" start-index="334"
stop-index="334" literal-start-index="335" literal-stop-index="335" />
+ <column-item name="item_id" start-index="334"
stop-index="342"
+ literal-start-index="335"
literal-stop-index="343">
+ <owner name="i" start-index="334"
stop-index="334"
+ literal-start-index="335"
literal-stop-index="335"/>
</column-item>
</group-by>
</select>
</subquery>
</subquery-table>
</from>
<where start-index="353" stop-index="374" literal-start-index="354"
literal-stop-index="375">
- <and-predicate>
- <predicate start-index="359" stop-index="374"
literal-start-index="360" literal-stop-index="375">
- <column-left-value start-index="359" stop-index="370"
literal-start-index="360" literal-stop-index="371" name="rownum_">
- <owner start-index="359" stop-index="362"
literal-start-index="360" literal-stop-index="363" name="row_" />
- </column-left-value>
- <operator type=">" />
- <compare-right-value>
- <parameter-marker-expression start-index="374"
stop-index="374" value="5" />
- <literal-expression start-index="375" stop-index="375"
value="6" />
- </compare-right-value>
- </predicate>
- </and-predicate>
+ <expr>
+ <binary-operation-expression start-index="359"
stop-index="374" literal-start-index="360" literal-stop-index="375">
+ <left>
+ <column name="rownum_" start-index="359"
stop-index="370" literal-start-index="360" literal-stop-index="371">
+ <owner name="row_" start-index="359"
stop-index="362" literal-start-index="360" literal-stop-index="363" />
+ </column>
+ </left>
+ <operator>></operator>
+ <right>
+ <literal-expression value="6" start-index="375"
stop-index="375" />
+ <parameter-marker-expression value="5"
start-index="374" stop-index="374" />
+ </right>
+ </binary-operation-expression>
+ </expr>
</where>
</select>
- <select
sql-case-id="select_pagination_with_top_and_diff_group_by_and_order_by"
parameters="3, 1, 2, 9, 10, 6">
+ <select
sql-case-id="select_pagination_with_top_and_diff_group_by_and_order_by"
+ parameters="3, 1, 2, 9, 10, 6">
<projections start-index="7" stop-index="7">
- <shorthand-projection start-index="7" stop-index="7" />
+ <shorthand-projection start-index="7" stop-index="7"/>
</projections>
<from>
<subquery-table alias="row_">
<subquery>
<select>
<projections start-index="22" stop-index="158">
<top-projection alias="rownum_" start-index="22"
stop-index="70">
- <top-value value="3" parameter-index="0"
start-index="26" stop-index="26" />
+ <top-value value="3" parameter-index="0"
start-index="26"
+ stop-index="26"/>
</top-projection>
<column-projection name="item_id" start-index="84"
stop-index="92">
- <owner name="i" start-index="84"
stop-index="84" />
+ <owner name="i" start-index="84"
stop-index="84"/>
</column-projection>
- <column-projection name="order_id"
alias="order_id" start-index="95" stop-index="104">
- <owner name="o" start-index="95"
stop-index="95" />
+ <column-projection name="order_id"
alias="order_id" start-index="95"
+ stop-index="104">
+ <owner name="o" start-index="95"
stop-index="95"/>
</column-projection>
- <column-projection name="status" alias="status"
start-index="119" stop-index="126">
- <owner name="o" start-index="119"
stop-index="119" />
+ <column-projection name="status" alias="status"
start-index="119"
+ stop-index="126">
+ <owner name="o" start-index="119"
stop-index="119"/>
</column-projection>
- <column-projection name="user_id" alias="user_id"
start-index="139" stop-index="147">
- <owner name="o" start-index="139"
stop-index="139" />
+ <column-projection name="user_id" alias="user_id"
start-index="139"
+ stop-index="147">
+ <owner name="o" start-index="139"
stop-index="139"/>
</column-projection>
</projections>
<from>
<join-table>
<left>
- <simple-table start-index="165"
stop-index="173" name="t_order" alias="o" />
+ <simple-table start-index="165"
stop-index="173" name="t_order"
+ alias="o"/>
</left>
<right>
- <simple-table start-index="180"
stop-index="193" name="t_order_item" alias="i" />
+ <simple-table start-index="180"
stop-index="193"
+ name="t_order_item"
alias="i"/>
</right>
<joinSpecification>
<and-predicate>
<predicate start-index="198"
stop-index="218">
- <column-left-value name="user_id"
start-index="198" stop-index="206">
- <owner name="o"
start-index="198" stop-index="198" />
+ <column-left-value name="user_id"
start-index="198"
+
stop-index="206">
+ <owner name="o"
start-index="198" stop-index="198"/>
</column-left-value>
- <column-right-value name="user_id"
start-index="210" stop-index="218">
- <owner name="i"
start-index="210" stop-index="210" />
+ <column-right-value name="user_id"
start-index="210"
+
stop-index="218">
+ <owner name="i"
start-index="210" stop-index="210"/>
</column-right-value>
</predicate>
<predicate start-index="224"
stop-index="246">
- <column-left-value name="order_id"
start-index="224" stop-index="233">
- <owner name="o"
start-index="224" stop-index="224" />
+ <column-left-value name="order_id"
start-index="224"
+
stop-index="233">
+ <owner name="o"
start-index="224" stop-index="224"/>
</column-left-value>
- <column-right-value
name="order_id" start-index="237" stop-index="246">
- <owner name="i"
start-index="237" stop-index="237" />
+ <column-right-value
name="order_id" start-index="237"
+
stop-index="246">
+ <owner name="i"
start-index="237" stop-index="237"/>
</column-right-value>
</predicate>
</and-predicate>
</joinSpecification>
</join-table>
</from>
<where start-index="248" stop-index="303"
literal-stop-index="304">
- <and-predicate>
- <predicate start-index="254" stop-index="272">
- <column-left-value name="user_id"
start-index="254" stop-index="262">
- <owner name="o" start-index="254"
stop-index="254" />
- </column-left-value>
- <in-right-value>
- <parameter-marker-expression value="1"
start-index="268" stop-index="268" />
- <parameter-marker-expression value="2"
start-index="271" stop-index="271" />
- <literal-expression value="1"
start-index="268" stop-index="268" />
- <literal-expression value="2"
start-index="271" stop-index="271" />
- </in-right-value>
- </predicate>
- <predicate start-index="278" stop-index="303"
literal-stop-index="304">
- <column-left-value name="order_id"
start-index="278" stop-index="287">
- <owner name="o" start-index="278"
stop-index="278" />
- </column-left-value>
- <between-right-value>
- <between-parameter-marker-expression
value="3" start-index="297" stop-index="297" />
- <and-parameter-marker-expression
value="4" start-index="303" stop-index="303" />
- <between-literal-expression value="9"
start-index="297" stop-index="297" />
- <and-literal-expression value="10"
start-index="303" stop-index="304" />
- </between-right-value>
- </predicate>
- </and-predicate>
+ <expr>
+ <binary-operation-expression start-index="254"
stop-index="303" literal-stop-index="304">
+ <left>
+ <in-expression start-index="254"
stop-index="272">
+ <not>false</not>
+ <left>
+ <column name="user_id"
start-index="254" stop-index="262">
+ <owner name="o"
start-index="254" stop-index="254" />
+ </column>
+ </left>
+ <right>
+ <list-expression
start-index="267" stop-index="272">
+ <items>
+ <literal-expression
value="1" start-index="268" stop-index="268" />
+
<parameter-marker-expression value="1" start-index="268" stop-index="268" />
+ </items>
+ <items>
+ <literal-expression
value="2" start-index="271" stop-index="271" />
+
<parameter-marker-expression value="2" start-index="271" stop-index="271" />
+ </items>
+ </list-expression>
+ </right>
+ </in-expression>
+ </left>
+ <operator>AND</operator>
+ <right>
+ <between-expression start-index="278"
stop-index="303" literal-stop-index="304">
+ <not>false</not>
+ <left>
+ <column name="order_id"
start-index="278" stop-index="287">
+ <owner name="o"
start-index="278" stop-index="278" />
+ </column>
+ </left>
+ <between-expr>
+ <literal-expression value="9"
start-index="297" stop-index="297" />
+ <parameter-marker-expression
value="3" start-index="297" stop-index="297" />
+ </between-expr>
+ <and-expr>
+ <literal-expression value="10"
start-index="303" stop-index="304" />
+ <parameter-marker-expression
value="4" start-index="303" stop-index="303" />
+ </and-expr>
+ </between-expression>
+ </right>
+ </binary-operation-expression>
+ </expr>
</where>
<group-by>
- <column-item name="user_id" start-index="314"
stop-index="322" literal-start-index="315" literal-stop-index="323">
- <owner name="i" start-index="314"
stop-index="314" literal-start-index="315" literal-stop-index="315" />
+ <column-item name="user_id" start-index="314"
stop-index="322"
+ literal-start-index="315"
literal-stop-index="323">
+ <owner name="i" start-index="314"
stop-index="314"
+ literal-start-index="315"
literal-stop-index="315"/>
</column-item>
</group-by>
</select>
</subquery>
</subquery-table>
</from>
<where start-index="333" stop-index="354" literal-start-index="334"
literal-stop-index="355">
- <and-predicate>
- <predicate start-index="339" stop-index="354"
literal-start-index="340" literal-stop-index="355">
- <column-left-value start-index="339" stop-index="350"
literal-start-index="340" literal-stop-index="351" name="rownum_">
- <owner start-index="339" stop-index="342"
literal-start-index="340" literal-stop-index="343" name="row_" />
- </column-left-value>
- <operator type=">" />
- <compare-right-value>
- <parameter-marker-expression start-index="354"
stop-index="354" value="5" />
- <literal-expression start-index="355" stop-index="355"
value="6" />
- </compare-right-value>
- </predicate>
- </and-predicate>
+ <expr>
+ <binary-operation-expression start-index="339"
stop-index="354" literal-start-index="340" literal-stop-index="355">
+ <left>
+ <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>
+ </left>
+ <operator>></operator>
+ <right>
+ <literal-expression value="6" start-index="355"
stop-index="355" />
+ <parameter-marker-expression value="5"
start-index="354" stop-index="354" />
+ </right>
+ </binary-operation-expression>
+ </expr>
</where>
</select>
- <select
sql-case-id="select_pagination_with_top_percent_with_ties_and_diff_group_by_and_order_by"
parameters="3, 1, 2, 9, 10, 6">
+ <select
sql-case-id="select_pagination_with_top_percent_with_ties_and_diff_group_by_and_order_by"
+ parameters="3, 1, 2, 9, 10, 6">
<projections start-index="7" stop-index="7">
- <shorthand-projection start-index="7" stop-index="7" />
+ <shorthand-projection start-index="7" stop-index="7"/>
</projections>
<from>
<subquery-table alias="row_">
<subquery>
<select>
<projections start-index="22" stop-index="176">
<top-projection alias="rownum_" start-index="22"
stop-index="88">
- <top-value value="3" parameter-index="0"
start-index="26" stop-index="26" />
+ <top-value value="3" parameter-index="0"
start-index="26"
+ stop-index="26"/>
</top-projection>
<column-projection name="item_id"
start-index="102" stop-index="110">
- <owner name="i" start-index="102"
stop-index="102" />
+ <owner name="i" start-index="102"
stop-index="102"/>
</column-projection>
- <column-projection name="order_id"
alias="order_id" start-index="113" stop-index="122">
- <owner name="o" start-index="113"
stop-index="113" />
+ <column-projection name="order_id"
alias="order_id" start-index="113"
+ stop-index="122">
+ <owner name="o" start-index="113"
stop-index="113"/>
</column-projection>
- <column-projection name="status" alias="status"
start-index="137" stop-index="144">
- <owner name="o" start-index="137"
stop-index="137" />
+ <column-projection name="status" alias="status"
start-index="137"
+ stop-index="144">
+ <owner name="o" start-index="137"
stop-index="137"/>
</column-projection>
- <column-projection name="user_id" alias="user_id"
start-index="157" stop-index="165">
- <owner name="o" start-index="157"
stop-index="157" />
+ <column-projection name="user_id" alias="user_id"
start-index="157"
+ stop-index="165">
+ <owner name="o" start-index="157"
stop-index="157"/>
</column-projection>
</projections>
<from>
<join-table>
<left>
- <simple-table start-index="183"
stop-index="191" name="t_order" alias="o" />
+ <simple-table start-index="183"
stop-index="191" name="t_order"
+ alias="o"/>
</left>
<right>
- <simple-table start-index="198"
stop-index="211" name="t_order_item" alias="i" />
+ <simple-table start-index="198"
stop-index="211"
+ name="t_order_item"
alias="i"/>
</right>
<joinSpecification>
<and-predicate>
<predicate start-index="216"
stop-index="236">
- <column-left-value name="user_id"
start-index="216" stop-index="224">
- <owner name="o"
start-index="216" stop-index="216" />
+ <column-left-value name="user_id"
start-index="216"
+
stop-index="224">
+ <owner name="o"
start-index="216" stop-index="216"/>
</column-left-value>
- <column-right-value name="user_id"
start-index="228" stop-index="236">
- <owner name="i"
start-index="228" stop-index="228" />
+ <column-right-value name="user_id"
start-index="228"
+
stop-index="236">
+ <owner name="i"
start-index="228" stop-index="228"/>
</column-right-value>
</predicate>
<predicate start-index="242"
stop-index="264">
- <column-left-value name="order_id"
start-index="242" stop-index="251">
- <owner name="o"
start-index="242" stop-index="242" />
+ <column-left-value name="order_id"
start-index="242"
+
stop-index="251">
+ <owner name="o"
start-index="242" stop-index="242"/>
</column-left-value>
- <column-right-value
name="order_id" start-index="255" stop-index="264">
- <owner name="i"
start-index="255" stop-index="255" />
+ <column-right-value
name="order_id" start-index="255"
+
stop-index="264">
+ <owner name="i"
start-index="255" stop-index="255"/>
</column-right-value>
</predicate>
</and-predicate>
</joinSpecification>
</join-table>
</from>
<where start-index="266" stop-index="321"
literal-stop-index="322">
- <and-predicate>
- <predicate start-index="272" stop-index="290">
- <column-left-value name="user_id"
start-index="272" stop-index="280">
- <owner name="o" start-index="272"
stop-index="272" />
- </column-left-value>
- <in-right-value>
- <parameter-marker-expression value="1"
start-index="286" stop-index="286" />
- <parameter-marker-expression value="2"
start-index="289" stop-index="289" />
- <literal-expression value="1"
start-index="286" stop-index="286" />
- <literal-expression value="2"
start-index="289" stop-index="289" />
- </in-right-value>
- </predicate>
- <predicate start-index="296" stop-index="321"
literal-stop-index="322">
- <column-left-value name="order_id"
start-index="296" stop-index="305">
- <owner name="o" start-index="296"
stop-index="296" />
- </column-left-value>
- <between-right-value>
- <between-parameter-marker-expression
value="3" start-index="315" stop-index="315" />
- <and-parameter-marker-expression
value="4" start-index="321" stop-index="321" />
- <between-literal-expression value="9"
start-index="315" stop-index="315" />
- <and-literal-expression value="10"
start-index="321" stop-index="322" />
- </between-right-value>
- </predicate>
- </and-predicate>
+ <expr>
+ <binary-operation-expression start-index="272"
stop-index="321" literal-stop-index="322">
+ <left>
+ <in-expression start-index="272"
stop-index="290">
+ <not>false</not>
+ <left>
+ <column name="user_id"
start-index="272" stop-index="280">
+ <owner name="o"
start-index="272" stop-index="272" />
+ </column>
+ </left>
+ <right>
+ <list-expression
start-index="285" stop-index="290">
+ <items>
+ <literal-expression
value="1" start-index="286" stop-index="286" />
+
<parameter-marker-expression value="1" start-index="286" stop-index="286" />
+ </items>
+ <items>
+ <literal-expression
value="2" start-index="289" stop-index="289" />
+
<parameter-marker-expression value="2" start-index="289" stop-index="289" />
+ </items>
+ </list-expression>
+ </right>
+ </in-expression>
+ </left>
+ <operator>AND</operator>
+ <right>
+ <between-expression start-index="296"
stop-index="321" literal-stop-index="322">
+ <not>false</not>
+ <left>
+ <column name="order_id"
start-index="296" stop-index="305">
+ <owner name="o"
start-index="296" stop-index="296" />
+ </column>
+ </left>
+ <between-expr>
+ <literal-expression value="9"
start-index="315" stop-index="315" />
+ <parameter-marker-expression
value="3" start-index="315" stop-index="315" />
+ </between-expr>
+ <and-expr>
+ <literal-expression value="10"
start-index="321" stop-index="322" />
+ <parameter-marker-expression
value="4" start-index="321" stop-index="321" />
+ </and-expr>
+ </between-expression>
+ </right>
+ </binary-operation-expression>
+ </expr>
</where>
<group-by>
- <column-item name="user_id" start-index="332"
stop-index="340" literal-start-index="333" literal-stop-index="341">
- <owner name="i" start-index="332"
stop-index="332" literal-start-index="333" literal-stop-index="333" />
+ <column-item name="user_id" start-index="332"
stop-index="340"
+ literal-start-index="333"
literal-stop-index="341">
+ <owner name="i" start-index="332"
stop-index="332"
+ literal-start-index="333"
literal-stop-index="333"/>
</column-item>
</group-by>
</select>
</subquery>
</subquery-table>
</from>
<where start-index="351" stop-index="372" literal-start-index="352"
literal-stop-index="373">
- <and-predicate>
- <predicate start-index="357" stop-index="372"
literal-start-index="358" literal-stop-index="373">
- <column-left-value start-index="357" stop-index="368"
literal-start-index="358" literal-stop-index="369" name="rownum_">
- <owner start-index="357" stop-index="360"
literal-start-index="358" literal-stop-index="361" name="row_" />
- </column-left-value>
- <operator type=">" />
- <compare-right-value>
- <parameter-marker-expression start-index="372"
stop-index="372" value="5" />
- <literal-expression start-index="373" stop-index="373"
value="6" />
- </compare-right-value>
- </predicate>
- </and-predicate>
+ <expr>
+ <binary-operation-expression start-index="357"
stop-index="372" literal-start-index="358" literal-stop-index="373">
+ <left>
+ <column name="rownum_" start-index="357"
stop-index="368" literal-start-index="358" literal-stop-index="369">
+ <owner name="row_" start-index="357"
stop-index="360" literal-start-index="358" literal-stop-index="361" />
+ </column>
+ </left>
+ <operator>></operator>
+ <right>
+ <literal-expression value="6" start-index="373"
stop-index="373" />
+ <parameter-marker-expression value="5"
start-index="372" stop-index="372" />
+ </right>
+ </binary-operation-expression>
+ </expr>
</where>
</select>
- <select
sql-case-id="select_pagination_with_top_and_diff_group_by_and_order_by_and_parentheses"
parameters="3, 1, 2, 9, 10, 6">
+ <select
sql-case-id="select_pagination_with_top_and_diff_group_by_and_order_by_and_parentheses"
+ parameters="3, 1, 2, 9, 10, 6">
<projections start-index="7" stop-index="7">
- <shorthand-projection start-index="7" stop-index="7" />
+ <shorthand-projection start-index="7" stop-index="7"/>
</projections>
<from>
<subquery-table alias="row_">
<subquery>
<select>
<projections start-index="22" stop-index="160">
<top-projection alias="rownum_" start-index="22"
stop-index="72">
- <top-value value="3" parameter-index="0"
start-index="27" stop-index="27" />
+ <top-value value="3" parameter-index="0"
start-index="27"
+ stop-index="27"/>
Review comment:
@jingshanglu OK, I will reformat them.
##########
File path:
shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/segment/expression/ExpressionAssert.java
##########
@@ -65,7 +87,7 @@ public static void assertParameterMarkerExpression(final
SQLCaseAssertContext as
*/
public static void assertLiteralExpression(final SQLCaseAssertContext
assertContext,
final LiteralExpressionSegment
actual, final ExpectedLiteralExpression expected) {
- assertNotNull(assertContext.getText("Expected literal expression
should exist."));
+ assertNotNull(assertContext.getText("Expected literal expression
should exist."), expected);
Review comment:
@jingshanglu OK, I will modify it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]