Skip to content

Commit

Permalink
Merge 6cc7286 into 876f734
Browse files Browse the repository at this point in the history
  • Loading branch information
tuohai666 committed Aug 9, 2019
2 parents 876f734 + 6cc7286 commit a3d0426
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 137 deletions.
Expand Up @@ -17,30 +17,6 @@
-->

<parser-result-sets>
<parser-result sql-case-id="select_sub_query_with_single_table" parameters="1, 2">
<tables>
<table name="t_order" alias="o" />
</tables>
<tokens>
<table-token start-index="33" table-name="t_order" length="7" />
</tokens>
<sharding-conditions>
<and-condition>
<condition column-name="order_id" table-name="t_order" operator="IN">
<value index="0" literal="1" type="int" />
<value index="1" literal="2" type="int" />
</condition>
</and-condition>
</sharding-conditions>
<select-items start-index="24" stop-index="26">
<shorthand-select-items>
<shorthand-select-item start-index="24" stop-index="26" text="o.*">
<table-segment start-index="24" stop-index="24" name="o" />
</shorthand-select-item>
</shorthand-select-items>
</select-items>
</parser-result>

<!-- TODO cannot pass,add later
<parser-result sql-case-id="select_sub_query_with_multiple_tables" parameters="1, 2">
<tables>
Expand All @@ -60,6 +36,7 @@
</parser-result>
-->

<!-- TODO do not support ORDER BY or ORDER BY in subquery for now, add later
<parser-result sql-case-id="select_sub_query_with_order_by">
<tables>
<table name="t_order"/>
Expand Down Expand Up @@ -96,4 +73,5 @@
<group-by-column name="order_id" order-direction="ASC" />
</group-by-columns>
</parser-result>
-->
</parser-result-sets>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Expand Up @@ -378,21 +378,19 @@
<assertion parameters="1000:int" expected-data-file="select_inner_join.xml" />
</dql-test-case>

<dql-test-case sql-case-id="select_sub_query_with_single_table">
<assertion parameters="1000:int, 1001:int" expected-data-file="select_sub_query_with_single_table.xml" />
</dql-test-case>

<!--<dql-test-case sql-case-id="select_sub_query_with_multiple_tables">-->
<!--<assertion parameters="1000:int, 1001:int" expected-data-file="select_sub_query_with_multiple_tables.xml" />-->
<!--</dql-test-case>-->


<!-- TODO do not support ORDER BY or ORDER BY in subquery for now, add later
<dql-test-case sql-case-id="select_sub_query_with_order_by">
<assertion expected-data-file="select_sub_query_with_order_by.xml" />
</dql-test-case>
<dql-test-case sql-case-id="select_sub_query_with_group_by">
<assertion expected-data-file="select_sub_query_with_group_by.xml" />
</dql-test-case>
-->

<dql-test-case sql-case-id="select_with_double_quotes">
<assertion parameters="100001:int" expected-data-file="select_not_equal_with_single_table.xml" />
Expand Down
Expand Up @@ -17,10 +17,11 @@
-->

<sql-cases>
<sql-case id="select_sub_query_with_single_table" value="SELECT t.* FROM (SELECT o.* FROM t_order o WHERE o.order_id IN (?, ?)) t ORDER BY t.order_id" db-types="MySQL,PostgreSQL,SQLServer,Oracle" />
<!-- TODO cannot pass,add later
<!-- TODO cannot pass,add later
<sql-case id="select_sub_query_with_multiple_tables" value="SELECT t.* FROM (SELECT i.* FROM t_order o, t_order_item i WHERE o.order_id = i.order_id and o.order_id IN (?, ?)) t ORDER BY t.item_id" db-types="SQLServer,Oracle" />
-->
<sql-case id="select_sub_query_with_order_by" value="SELECT COUNT(1) as orders_count FROM (SELECT * FROM t_order ORDER BY order_id desc) t" db-types="MySQL,PostgreSQL,Oracle" />
<sql-case id="select_sub_query_with_group_by" value="SELECT COUNT(1) as order_items_count FROM (SELECT order_id FROM t_order_item GROUP BY order_id) t" db-types="MySQL,PostgreSQL,Oracle" />
<!-- TODO do not support ORDER BY or ORDER BY in subquery for now, add later
<sql-case id="select_sub_query_with_order_by" value="SELECT COUNT(1) as orders_count FROM (SELECT * FROM t_order ORDER BY order_id desc) t" db-types="H2,MySQL,PostgreSQL,Oracle" />
<sql-case id="select_sub_query_with_group_by" value="SELECT COUNT(1) as order_items_count FROM (SELECT order_id FROM t_order_item GROUP BY order_id) t" db-types="H2,MySQL,PostgreSQL,Oracle" />
-->
</sql-cases>

0 comments on commit a3d0426

Please sign in to comment.