Skip to content

Commit

Permalink
For issue #540.
Browse files Browse the repository at this point in the history
  • Loading branch information
haocao committed Jan 16, 2018
1 parent 6e6b044 commit 325d2d7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,12 @@
<data parameter="1,9,1000,1909" expected="select_aggregate/SelectCountWithBindingTable_1.xml" />
</sharding-rule>
</sql>
<!-- TODO fix this -->
<!--
<sql id="assertSelectAliasWithKeyword">
<sharding-rule value="tbl">
<data parameter="100000" expected="select/SelectAliasWithKeyword.xml" />
</sharding-rule>
</sql>
-->
</sqls>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<dataset>
<t_order_item password="100000" />
</dataset>
14 changes: 14 additions & 0 deletions sharding-jdbc-core/src/test/resources/parser/select.xml
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,18 @@
<aggregation-select-item inner-expression="(*)" aggregation-type="COUNT" alias="items_count"/>
</aggregation-select-items>
</assert>
<!-- TODO fix this -->
<!--
<assert id="assertSelectAliasWithKeyword" parameters="1">
<tables>
<table name="t_order_item" />
</tables>
<table-tokens>
<table-token begin-position="14" original-literals="t_order_item" />
</table-tokens>
<order-by-columns>
<order-by-column name="item_id" order-by-type="ASC" />
</order-by-columns>
</assert>
-->
</asserts>
1 change: 1 addition & 0 deletions sharding-jdbc-core/src/test/resources/sql/dql/select.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
<sql id="assertSelectWithUpperCaseBindingTableAndConfigTable" value="SELECT i.*,c.status c_status FROM T_ORDER o JOIN T_order_item i ON o.user_id = i.user_id AND o.order_id = i.order_id JOIN t_config c ON o.status = c.status WHERE o.user_id IN (%s, %s) AND o.order_id BETWEEN %s AND %s AND c.status = %s ORDER BY i.item_id" />
<sql id="assertSelectCountWithBindingTable" value="SELECT COUNT(*) AS items_count FROM t_order o, t_order_item i WHERE o.user_id = i.user_id AND o.order_id = i.order_id AND o.user_id IN (%s, %s) AND o.order_id BETWEEN %s AND %s" />
<sql id="assertSelectCountWithBindingTableWithJoin" value="SELECT COUNT(*) AS items_count FROM t_order o JOIN t_order_item i ON o.user_id = i.user_id AND o.order_id = i.order_id WHERE o.user_id IN (%s, %s) AND o.order_id BETWEEN %s AND %s" />
<sql id="assertSelectAliasWithKeyword" value="SELECT item.item_id password FROM t_order_item item where item.item_id = %s " type="H2,MySQL"/>
</sqls>

0 comments on commit 325d2d7

Please sign in to comment.