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

mysql-source:tinyint-unsigned should not be identified as boolean #18956

Merged
merged 8 commits into from
Nov 14, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@
- name: MySQL
sourceDefinitionId: 435bb9a5-7887-4809-aa58-28c27df0d7ad
dockerRepository: airbyte/source-mysql
dockerImageTag: 1.0.12
dockerImageTag: 1.0.13
documentationUrl: https://docs.airbyte.com/integrations/sources/mysql
icon: mysql.svg
sourceType: database
Expand Down
20 changes: 1 addition & 19 deletions airbyte-config/init/src/main/resources/seed/source_specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8341,7 +8341,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-mysql:1.0.12"
- dockerImage: "airbyte/source-mysql:1.0.13"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/mysql"
connectionSpecification:
Expand Down Expand Up @@ -8424,9 +8424,6 @@
mode:
type: "string"
const: "preferred"
enum:
- "preferred"
default: "preferred"
order: 0
- title: "required"
description: "Require SSL mode."
Expand All @@ -8436,9 +8433,6 @@
mode:
type: "string"
const: "required"
enum:
- "required"
default: "required"
order: 0
- title: "Verify CA"
description: "Verify CA SSL mode."
Expand All @@ -8449,9 +8443,6 @@
mode:
type: "string"
const: "verify_ca"
enum:
- "verify_ca"
default: "verify_ca"
order: 0
ca_certificate:
type: "string"
Expand Down Expand Up @@ -8494,9 +8485,6 @@
mode:
type: "string"
const: "verify_identity"
enum:
- "verify_identity"
default: "verify_identity"
order: 0
ca_certificate:
type: "string"
Expand Down Expand Up @@ -8545,9 +8533,6 @@
method:
type: "string"
const: "STANDARD"
enum:
- "STANDARD"
default: "STANDARD"
order: 0
- title: "Logical Replication (CDC)"
description: "CDC uses the Binlog to detect inserts, updates, and deletes.\
Expand All @@ -8558,9 +8543,6 @@
method:
type: "string"
const: "CDC"
enum:
- "CDC"
default: "CDC"
order: 0
initial_waiting_seconds:
type: "integer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ ENV APPLICATION source-mysql-strict-encrypt

COPY --from=build /airbyte /airbyte

LABEL io.airbyte.version=1.0.12
LABEL io.airbyte.version=1.0.13

LABEL io.airbyte.name=airbyte/source-mysql-strict-encrypt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@
"mode": {
"type": "string",
"const": "preferred",
"enum": ["preferred"],
"default": "preferred",
"order": 0
}
}
Expand All @@ -75,8 +73,6 @@
"mode": {
"type": "string",
"const": "required",
"enum": ["required"],
"default": "required",
"order": 0
}
}
Expand All @@ -89,8 +85,6 @@
"mode": {
"type": "string",
"const": "verify_ca",
"enum": ["verify_ca"],
"default": "verify_ca",
"order": 0
},
"ca_certificate": {
Expand Down Expand Up @@ -134,8 +128,6 @@
"mode": {
"type": "string",
"const": "verify_identity",
"enum": ["verify_identity"],
"default": "verify_identity",
"order": 0
},
"ca_certificate": {
Expand Down Expand Up @@ -187,8 +179,6 @@
"method": {
"type": "string",
"const": "STANDARD",
"enum": ["STANDARD"],
"default": "STANDARD",
"order": 0
}
}
Expand All @@ -201,8 +191,6 @@
"method": {
"type": "string",
"const": "CDC",
"enum": ["CDC"],
"default": "CDC",
"order": 0
},
"initial_waiting_seconds": {
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-mysql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ ENV APPLICATION source-mysql

COPY --from=build /airbyte /airbyte

LABEL io.airbyte.version=1.0.12
LABEL io.airbyte.version=1.0.13

LABEL io.airbyte.name=airbyte/source-mysql
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,15 @@ public void setJsonField(final ResultSet resultSet, final int colIndex, final Ob
}
}
case BOOLEAN -> putBoolean(json, columnName, resultSet, colIndex);
case TINYINT, TINYINT_UNSIGNED -> {
case TINYINT -> {
if (field.getLength() == 1L) {
// TINYINT(1) is boolean
putBoolean(json, columnName, resultSet, colIndex);
} else {
putShortInt(json, columnName, resultSet, colIndex);
}
}
case TINYINT_UNSIGNED -> putShortInt(json, columnName, resultSet, colIndex);
case SMALLINT, SMALLINT_UNSIGNED, MEDIUMINT, MEDIUMINT_UNSIGNED -> putInteger(json, columnName, resultSet, colIndex);
case INT, INT_UNSIGNED -> {
if (field.isUnsigned()) {
Expand Down Expand Up @@ -184,7 +185,7 @@ public MysqlType getFieldType(final JsonNode field) {

switch (literalType) {
// BIT(1) and TINYINT(1) are interpreted as boolean
case BIT, TINYINT, TINYINT_UNSIGNED -> {
case BIT, TINYINT -> {
if (columnSize == 1) {
return MysqlType.BOOLEAN;
}
Expand Down
5 changes: 3 additions & 2 deletions docs/integrations/sources/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ WHERE actor_definition_id ='435bb9a5-7887-4809-aa58-28c27df0d7ad' AND (configura
## Changelog
| Version | Date | Pull Request | Subject |
|:--------|:-----------|:-----------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------|
| 1.0.12 | 2022-11-07 | [19025](https://github.com/airbytehq/airbyte/pull/19025) | Stop enforce SSL if ssl mode is disabled |
| 1.0.11 | 2022-11-03 | [18851](https://github.com/airbytehq/airbyte/pull/18851) | Fix bug with unencrypted CDC connections |
| 1.0.13 | 2022-11-14 | [18956](https://github.com/airbytehq/airbyte/pull/18956) | Clean up Tinyint Unsigned data type identification |
| 1.0.12 | 2022-11-07 | [19025](https://github.com/airbytehq/airbyte/pull/19025) | Stop enforce SSL if ssl mode is disabled |
| 1.0.11 | 2022-11-03 | [18851](https://github.com/airbytehq/airbyte/pull/18851) | Fix bug with unencrypted CDC connections |
| 1.0.10 | 2022-11-02 | [18619](https://github.com/airbytehq/airbyte/pull/18619) | Fix bug with handling Tinyint(1) Unsigned values as boolean |
| 1.0.9 | 2022-10-31 | [18538](https://github.com/airbytehq/airbyte/pull/18538) | Encode database name |
| 1.0.8 | 2022-10-25 | [18383](https://github.com/airbytehq/airbyte/pull/18383) | Better SSH error handling + messages |
Expand Down