-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix mysql longblob wrong column type returned by proxy protocol
- Loading branch information
1 parent
bfde8d8
commit 8d80b59
Showing
10 changed files
with
224 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
test/e2e/sql/src/test/resources/cases/dql/e2e-dql-select-with-data-types.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ 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. | ||
--> | ||
|
||
<!-- SPEX ADDED: BEGIN --> | ||
<e2e-test-cases> | ||
<!--<test-case sql="SELECT * FROM t_data_type_binary WHERE id = ?" db-types="MySQL" scenario-types="passthrough"> | ||
<assertion parameters="1:int" expected-data-source-name="expected_dataset" /> | ||
</test-case>--> | ||
|
||
<test-case sql="SELECT * FROM t_data_type_varbinary WHERE id = ?" db-types="MySQL" scenario-types="passthrough"> | ||
<assertion parameters="1:int" expected-data-source-name="expected_dataset" /> | ||
</test-case> | ||
|
||
<test-case sql="SELECT * FROM t_data_type_longblob WHERE id = ?" db-types="MySQL" scenario-types="passthrough"> | ||
<assertion parameters="1:int" expected-data-source-name="expected_dataset" /> | ||
</test-case> | ||
</e2e-test-cases> | ||
<!-- SPEX ADDED: END --> |
81 changes: 81 additions & 0 deletions
81
...e2e/sql/src/test/resources/env/scenario/passthrough/data/actual/dataset/mysql/dataset.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<!-- | ||
~ 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 data-nodes="passthrough.t_data_type_integer"> | ||
<column name="id" type="numeric" /> | ||
<column name="col_bigint" type="numeric" /> | ||
<column name="col_int" type="numeric" /> | ||
<column name="col_mediumint" type="numeric" /> | ||
<column name="col_smallint" type="numeric" /> | ||
<column name="col_tinyint" type="numeric" /> | ||
</metadata> | ||
<metadata data-nodes="passthrough.t_data_type_integer_unsigned"> | ||
<column name="id" type="numeric" /> | ||
<column name="col_bigint_unsigned" type="decimal" /> | ||
<column name="col_int_unsigned" type="numeric" /> | ||
<column name="col_mediumint_unsigned" type="numeric" /> | ||
<column name="col_smallint_unsigned" type="numeric" /> | ||
<column name="col_tinyint_unsigned" type="numeric" /> | ||
</metadata> | ||
<metadata data-nodes="passthrough.t_data_type_floating_point"> | ||
<column name="id" type="numeric" /> | ||
<column name="col_float" type="numeric" /> | ||
<column name="col_double" type="numeric" /> | ||
</metadata> | ||
<metadata data-nodes="passthrough.t_with_generated_id"> | ||
<column name="id" type="numeric" /> | ||
<column name="val" type="varchar" /> | ||
</metadata> | ||
<metadata data-nodes="passthrough.t_data_type_money"> | ||
<column name="id" type="numeric" /> | ||
<column name="val" type="cast#money" /> | ||
</metadata> | ||
<metadata data-nodes="passthrough.t_data_type_bytea"> | ||
<column name="id" type="numeric" /> | ||
<column name="val" type="varchar" /> | ||
</metadata> | ||
<metadata data-nodes="passthrough.t_data_type_uuid"> | ||
<column name="id" type="numeric" /> | ||
<column name="val" type="varchar" /> | ||
</metadata> | ||
<metadata data-nodes="passthrough.t_data_type_date"> | ||
<column name="id" type="numeric" /> | ||
<column name="creation_date" type="Date" /> | ||
<column name="update_date" type="datetime" /> | ||
</metadata> | ||
<metadata data-nodes="passthrough.t_data_type_binary"> | ||
<column name="id" type="numeric" /> | ||
<column name="val" type="binary" /> | ||
</metadata> | ||
<metadata data-nodes="passthrough.t_data_type_varbinary"> | ||
<column name="id" type="numeric" /> | ||
<column name="val" type="varbinary" /> | ||
</metadata> | ||
<metadata data-nodes="passthrough.t_data_type_longblob"> | ||
<column name="id" type="numeric" /> | ||
<column name="val" type="longblob" /> | ||
</metadata> | ||
<row data-node="passthrough.t_data_type_integer_unsigned" values="1001, 18446744073709551615, 4294967295, 16777215, 65535, 255" /> | ||
<row data-node="passthrough.t_data_type_integer_unsigned" values="1002, 0, 0, 0, 0, 0" /> | ||
<row data-node="passthrough.t_data_type_money" values="1001, 123" /> | ||
<row data-node="passthrough.t_data_type_money" values="1002, 456" /> | ||
<row data-node="passthrough.t_data_type_date" values="1, 2017-08-08, 2017-08-08 00:00:00" /> | ||
<row data-node="passthrough.t_data_type_binary" values="1, '123'" /> | ||
<row data-node="passthrough.t_data_type_varbinary" values="1, '123'" /> | ||
<row data-node="passthrough.t_data_type_longblob" values="1, '123'" /> | ||
</dataset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...e/sql/src/test/resources/env/scenario/passthrough/data/expected/dataset/mysql/dataset.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<!-- | ||
~ 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 data-nodes="expected_dataset.t_data_type_integer"> | ||
<column name="id" type="numeric" /> | ||
<column name="col_bigint" type="numeric" /> | ||
<column name="col_int" type="numeric" /> | ||
<column name="col_mediumint" type="numeric" /> | ||
<column name="col_smallint" type="numeric" /> | ||
<column name="col_tinyint" type="numeric" /> | ||
</metadata> | ||
<metadata data-nodes="expected_dataset.t_data_type_integer_unsigned"> | ||
<column name="id" type="numeric" /> | ||
<column name="col_bigint_unsigned" type="decimal" /> | ||
<column name="col_int_unsigned" type="numeric" /> | ||
<column name="col_mediumint_unsigned" type="numeric" /> | ||
<column name="col_smallint_unsigned" type="numeric" /> | ||
<column name="col_tinyint_unsigned" type="numeric" /> | ||
</metadata> | ||
<metadata data-nodes="expected_dataset.t_data_type_floating_point"> | ||
<column name="id" type="numeric" /> | ||
<column name="col_float" type="numeric" /> | ||
<column name="col_double" type="numeric" /> | ||
</metadata> | ||
<metadata data-nodes="expected_dataset.t_with_generated_id"> | ||
<column name="id" type="numeric" /> | ||
<column name="val" type="varchar" /> | ||
</metadata> | ||
<metadata data-nodes="expected_dataset.t_data_type_money"> | ||
<column name="id" type="numeric" /> | ||
<column name="val" type="cast#money" /> | ||
</metadata> | ||
<metadata data-nodes="expected_dataset.t_data_type_bytea"> | ||
<column name="id" type="numeric" /> | ||
<column name="val" type="varchar" /> | ||
</metadata> | ||
<metadata data-nodes="expected_dataset.t_data_type_uuid"> | ||
<column name="id" type="numeric" /> | ||
<column name="val" type="varchar" /> | ||
</metadata> | ||
<metadata data-nodes="expected_dataset.t_data_type_date"> | ||
<column name="id" type="numeric" /> | ||
<column name="creation_date" type="Date" /> | ||
<column name="update_date" type="datetime" /> | ||
</metadata> | ||
<metadata data-nodes="expected_dataset.t_data_type_binary"> | ||
<column name="id" type="numeric" /> | ||
<column name="val" type="binary" /> | ||
</metadata> | ||
<metadata data-nodes="expected_dataset.t_data_type_varbinary"> | ||
<column name="id" type="numeric" /> | ||
<column name="val" type="varbinary" /> | ||
</metadata> | ||
<metadata data-nodes="expected_dataset.t_data_type_longblob"> | ||
<column name="id" type="numeric" /> | ||
<column name="val" type="longblob" /> | ||
</metadata> | ||
<row data-node="expected_dataset.t_data_type_integer_unsigned" values="1001, 18446744073709551615, 4294967295, 16777215, 65535, 255" /> | ||
<row data-node="expected_dataset.t_data_type_integer_unsigned" values="1002, 0, 0, 0, 0, 0" /> | ||
<row data-node="expected_dataset.t_data_type_money" values="1001, 123" /> | ||
<row data-node="expected_dataset.t_data_type_money" values="1002, 456" /> | ||
<row data-node="expected_dataset.t_data_type_date" values="1, 2017-08-08, 2017-08-08 00:00:00" /> | ||
<row data-node="expected_dataset.t_data_type_binary" values="1, '123'" /> | ||
<row data-node="expected_dataset.t_data_type_varbinary" values="1, '123'" /> | ||
<row data-node="expected_dataset.t_data_type_longblob" values="1, '123'" /> | ||
</dataset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters