Skip to content

Commit

Permalink
Resume some commented test cases (#4171)
Browse files Browse the repository at this point in the history
* resume committed test case for alter_table_with_exist_index

* resume committed test case for insert_on_duplicate_key_update_with_table_identifier

* resume committed test case for insert_with_batch_and_without_generate_key_column
  • Loading branch information
terrymanu committed Feb 5, 2020
1 parent 6fe9eb0 commit 5d383d2
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 25 deletions.
Expand Up @@ -119,11 +119,11 @@
<assertion parameters="1:int, 1:int, 1:int, 2:int, 2:int, 2:int" expected-data-file="batch_insert_with_generate_key_column.xml" />
</dml-test-case>

<dml-test-case sql-case-id="insert_with_batch_and_without_generate_key_column">
<assertion sharding-rule-type="dbtbl_with_masterslave" parameters="1:int, 1:int, 2:int, 2:int" expected-data-file="batch_insert_without_generate_key_column.xml" />
<!-- TODO add gen column on create table -->
<!--<assertion parameters="1:int, 1:int, 2:int, 2:int" expected-data-file="batch_insert_without_generate_key_column.xml" />-->
</dml-test-case>
<!--<dml-test-case sql-case-id="insert_with_batch_and_without_generate_key_column">-->
<!--<assertion sharding-rule-type="dbtbl_with_masterslave" parameters="1:int, 1:int, 2:int, 2:int" expected-data-file="batch_insert_without_generate_key_column.xml" />-->
<!--&lt;!&ndash; TODO add gen column on create table &ndash;&gt;-->
<!--&lt;!&ndash;<assertion parameters="1:int, 1:int, 2:int, 2:int" expected-data-file="batch_insert_without_generate_key_column.xml" />&ndash;&gt;-->
<!--</dml-test-case>-->

<dml-test-case sql-case-id="update_without_alias">
<assertion parameters="update:String, 1000:int, 10:int" expected-data-file="update.xml" />
Expand Down
Expand Up @@ -76,9 +76,7 @@
<sql-case id="alter_table_rename_constraints" value="ALTER TABLE t_order RENAME CONSTRAINT order_index_bak TO order_index" db-types="PostgreSQL" />
<sql-case id="alter_table_rename_table" value="ALTER TABLE t_order RENAME to t_order1" db-types="PostgreSQL" />
<sql-case id="alter_table_rename_column" value="ALTER TABLE t_order RENAME COLUMN user_id to user_id1" db-types="PostgreSQL" />
<!--
<sql-case id="create_table_with_exist_index" value="ALTER TABLE t_order ADD PRIMARY KEY USING INDEX order_index" db-types="PostgreSQL" />
-->
<sql-case id="alter_table_with_exist_index" value="ALTER TABLE t_order ADD PRIMARY KEY USING INDEX order_index" db-types="PostgreSQL" />
<sql-case id="alter_table_with_bracket" value="ALTER TABLE [t_order] REBUILD" db-types="SQLServer" />
<sql-case id="alter_table_add_columns_sqlserver" value="ALTER TABLE t_order ADD column4 VARCHAR(10), column5 VARCHAR(10), column6 VARCHAR(10)" db-types="SQLServer" />
<sql-case id="alter_table_drop_columns_sqlserver" value="ALTER TABLE t_order DROP COLUMN user_id, column5" db-types="SQLServer" />
Expand Down
Expand Up @@ -38,11 +38,11 @@
<sql-case id="insert_with_batch_and_irregular_parameters" value="INSERT INTO t_order (order_id, user_id, status) VALUES (?, 1, 'insert'), (?, ?, ?)" />
<!--<sql-case id="insert_with_batch_and_composite_expression" value="INSERT INTO t_order (order_id, user_id, status) VALUES (?, ?, SUBSTR(?, 1)), (?, ?, SUBSTR(?, 1))" db-types="H2,MySQL" />-->
<sql-case id="insert_with_batch_and_with_generate_key_column" value="INSERT INTO t_order_item(item_id, order_id, user_id, status, creation_date) values (?, ?, ?, 'insert', '2017-08-08'), (?, ?, ?, 'insert', '2017-08-08')" />
<!--<sql-case id="insert_with_batch_and_without_generate_key_column" value="INSERT INTO t_order_item(order_id, user_id, status, creation_date) values (?, ?, 'insert', '2017-08-08'), (?, ?, 'insert', '2017-08-08')" />-->
<sql-case id="insert_with_batch_and_without_generate_key_column" value="INSERT INTO t_order_item(order_id, user_id, status, creation_date) values (?, ?, 'insert', '2017-08-08'), (?, ?, 'insert', '2017-08-08')" />
<sql-case id="insert_on_duplicate_key_update" value="INSERT INTO t_order (order_id, user_id, status) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE status = VALUES(status)" db-types="MySQL" />
<sql-case id="insert_on_duplicate_key_update_with_complicated_expression" value="INSERT INTO emp(order_id,emp_id,age,salary) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE salary = VALUES(salary)+VALUES(salary)*0.2" db-types="MySQL"/>
<sql-case id="insert_with_multiple_values" value="INSERT INTO t_order (order_id, user_id, status) VALUES (1, 1, 'insert'), (2, 2, 'insert2')" db-types="MySQL" />
<!--<sql-case id="insert_on_duplicate_key_update_with_table_identifier" value="INSERT INTO t_order (t_order.order_id, t_order.user_id, t_order.status) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE t_order.status = VALUES(t_order.status)" db-types="MySQL" />-->
<sql-case id="insert_on_duplicate_key_update_with_table_identifier" value="INSERT INTO t_order (t_order.order_id, t_order.user_id, t_order.status) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE t_order.status = VALUES(t_order.status)" db-types="MySQL" />
<sql-case id="insert_with_geography" value="INSERT INTO t_order(user_id, order_id, start_point,rule) VALUES (?, ?, ST_GeographyFromText('SRID=4326;POINT(100 200)'), ?::jsonb)" db-types="PostgreSQL" />
<sql-case id="insert_with_one_auto_increment_column" value="INSERT INTO t_auto_increment_table VALUES()" db-types="MySQL" />
<sql-case id="insert_with_double_value" value="INSERT INTO t_double_test(col1) VALUES(1.22)" db-types="MySQL" />
Expand Down
Expand Up @@ -22,10 +22,6 @@
<alter-index sql-case-id="alter_index_with_space" />
<alter-index sql-case-id="alter_index_with_quota" />

<!--<alter-index sql-case-id="create_table_with_exist_index">-->
<!--<table name="t_order" start-index="12" stop-index="18" />-->
<!--</alter-index>-->

<alter-index sql-case-id="alter_index_rebuild">
<table name="t_order" start-index="27" stop-index="33" />
</alter-index>
Expand Down
Expand Up @@ -331,6 +331,10 @@
<table name="t_order" start-index="12" stop-index="18" />
</alter-table>

<alter-table sql-case-id="alter_table_with_exist_index">
<table name="t_order" start-index="12" stop-index="18" />
</alter-table>

<alter-table sql-case-id="alter_table_with_bracket">
<table name="t_order" start-delimiter="[" end-delimiter="]" start-index="12" stop-index="20" />
</alter-table>
Expand Down
Expand Up @@ -500,14 +500,36 @@
</set>
</insert>

<!--<insert sql-case-id="insert_on_duplicate_key_update_with_table_identifier" parameters="1, 1, 'init'">-->
<!--<table name="t_order" start-index="12" stop-index="18" />-->
<!--<table name="t_order" start-index="21" stop-index="27" />-->
<!--<table name="t_order" start-index="39" stop-index="45" />-->
<!--<table name="t_order" start-index="56" stop-index="62" />-->
<!--<table name="t_order" start-index="113" stop-index="119" />-->
<!--<table name="t_order" start-index="137" stop-index="143" />-->
<!--</insert>-->
<insert sql-case-id="insert_on_duplicate_key_update_with_table_identifier" parameters="1, 1, 'init'">
<table name="t_order" start-index="12" stop-index="18" />
<columns start-index="20" stop-index="70">
<column name="order_id" start-index="21" stop-index="36">
<owner name="t_order" start-index="21" stop-index="27" />
</column>
<column name="user_id" start-index="39" stop-index="53">
<owner name="t_order" start-index="39" stop-index="45" />
</column>
<column name="status" start-index="56" stop-index="69">
<owner name="t_order" start-index="56" stop-index="62" />
</column>
</columns>
<values>
<value>
<assignment-value>
<parameter-marker-expression value="0" />
<literal-expression value="1" />
</assignment-value>
<assignment-value>
<parameter-marker-expression value="1" />
<literal-expression value="1" />
</assignment-value>
<assignment-value>
<parameter-marker-expression value="2" />
<literal-expression value="init" />
</assignment-value>
</value>
</values>
</insert>

<insert sql-case-id="insert_with_batch" parameters="1000, 10, 'init', 1100, 11, 'init'">
<table name="t_order" start-index="12" stop-index="18" />
Expand Down Expand Up @@ -642,9 +664,49 @@
</values>
</insert>

<!--<insert sql-case-id="insert_with_batch_and_without_generate_key_column" parameters="1000, 10, 1001, 10">-->
<!--<table name="t_order_item" start-index="12" stop-index="23" />-->
<!--</insert>-->
<insert sql-case-id="insert_with_batch_and_without_generate_key_column" parameters="1000, 10, 1001, 10">
<table name="t_order_item" start-index="12" stop-index="23" />
<columns start-index="24" stop-index="65">
<column name="order_id" start-index="25" stop-index="32" />
<column name="user_id" start-index="35" stop-index="41" />
<column name="status" start-index="44" stop-index="49" />
<column name="creation_date" start-index="52" stop-index="64" />
</columns>
<values>
<value>
<assignment-value>
<parameter-marker-expression value="0" />
<literal-expression value="1000" />
</assignment-value>
<assignment-value>
<parameter-marker-expression value="1" />
<literal-expression value="10" />
</assignment-value>
<assignment-value>
<literal-expression value="insert" />
</assignment-value>
<assignment-value>
<literal-expression value="2017-08-08" />
</assignment-value>
</value>
<value>
<assignment-value>
<parameter-marker-expression value="2" />
<literal-expression value="1001" />
</assignment-value>
<assignment-value>
<parameter-marker-expression value="3" />
<literal-expression value="10" />
</assignment-value>
<assignment-value>
<literal-expression value="insert" />
</assignment-value>
<assignment-value>
<literal-expression value="2017-08-08" />
</assignment-value>
</value>
</values>
</insert>

<insert sql-case-id="insert_with_geography" parameters="7, 200, '{&quot;rule&quot;:&quot;null&quot;}'">
<table name="t_order" start-index="12" stop-index="18" />
Expand Down

0 comments on commit 5d383d2

Please sign in to comment.