Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For #3032, add missing mysql test cases for select escape. #3042

Merged
merged 1 commit into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<dataset>
<metadata>
<column name="status" />
</metadata>
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
</dataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<dataset>
<metadata>
<column name="status" />
</metadata>
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
</dataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<dataset>
<metadata>
<column name="status" />
</metadata>
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
<row values="init_slave" />
</dataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<dataset>
<metadata>
<column name="status" />
</metadata>
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
<row values="init" />
</dataset>
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,23 @@
<dql-test-case sql-case-id="select_with_double_quotes">
<assertion parameters="100001:int" expected-data-file="select_not_equal_with_single_table.xml" />
</dql-test-case>


<dql-test-case sql-case-id="select_escape_with_single_quota">
<assertion expected-data-file="empty_order.xml" />
</dql-test-case>

<dql-test-case sql-case-id="select_escape_with_double_quota">
<assertion expected-data-file="empty_order.xml" />
</dql-test-case>

<dql-test-case sql-case-id="select_alias_as_single_quote_string">
<assertion expected-data-file="select_alias_as_single_quote_string.xml" />
</dql-test-case>

<dql-test-case sql-case-id="select_alias_as_string_double_quote">
<assertion expected-data-file="select_alias_as_single_quote_string.xml" />
</dql-test-case>

<dql-test-case sql-case-id="select_distinct_with_single_column">
<assertion expected-data-file="select_distinct_with_single_column.xml" />
</dql-test-case>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
<sql-case id="select_with_double_quotes" value="SELECT * FROM &quot;t_order_item&quot; WHERE &quot;item_id&quot; != ? ORDER BY &quot;item_id&quot;" db-types="PostgreSQL" />
<sql-case id="select_escape_with_single_quota" value="SELECT * FROM t_order where status='\''" db-types="MySQL" />
<sql-case id="select_escape_with_double_quota" value="SELECT * FROM t_order where status=&quot;\&quot;&quot;" db-types="MySQL" />
<sql-case id="select_alias_as_single_quote_string" value="SELECT status as 'status' FROM t_order" />
<sql-case id="select_alias_as_string_double_quote" value="SELECT status as &quot;status&quot; FROM t_order" />
<sql-case id="select_alias_as_single_quote_string" value="SELECT status as 'status' FROM t_order" db-types="MySQL" />
<sql-case id="select_alias_as_string_double_quote" value="SELECT status as &quot;status&quot; FROM t_order" db-types="MySQL" />
</sql-cases>