Skip to content

Commit 5d2011d

Browse files
mysql-source:tinyint-unsigned should not be identified as boolean (#18956)
* mysql-source:tinyint-unsigned should not be identified as boolean * upgrade version * fix encrypted spec * auto-bump connector version Co-authored-by: Octavia Squidington III <[email protected]>
1 parent 30d2621 commit 5d2011d

File tree

7 files changed

+10
-38
lines changed

7 files changed

+10
-38
lines changed

airbyte-config/init/src/main/resources/seed/source_definitions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@
919919
- name: MySQL
920920
sourceDefinitionId: 435bb9a5-7887-4809-aa58-28c27df0d7ad
921921
dockerRepository: airbyte/source-mysql
922-
dockerImageTag: 1.0.12
922+
dockerImageTag: 1.0.13
923923
documentationUrl: https://docs.airbyte.com/integrations/sources/mysql
924924
icon: mysql.svg
925925
sourceType: database

airbyte-config/init/src/main/resources/seed/source_specs.yaml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8361,7 +8361,7 @@
83618361
supportsNormalization: false
83628362
supportsDBT: false
83638363
supported_destination_sync_modes: []
8364-
- dockerImage: "airbyte/source-mysql:1.0.12"
8364+
- dockerImage: "airbyte/source-mysql:1.0.13"
83658365
spec:
83668366
documentationUrl: "https://docs.airbyte.com/integrations/sources/mysql"
83678367
connectionSpecification:
@@ -8444,9 +8444,6 @@
84448444
mode:
84458445
type: "string"
84468446
const: "preferred"
8447-
enum:
8448-
- "preferred"
8449-
default: "preferred"
84508447
order: 0
84518448
- title: "required"
84528449
description: "Require SSL mode."
@@ -8456,9 +8453,6 @@
84568453
mode:
84578454
type: "string"
84588455
const: "required"
8459-
enum:
8460-
- "required"
8461-
default: "required"
84628456
order: 0
84638457
- title: "Verify CA"
84648458
description: "Verify CA SSL mode."
@@ -8469,9 +8463,6 @@
84698463
mode:
84708464
type: "string"
84718465
const: "verify_ca"
8472-
enum:
8473-
- "verify_ca"
8474-
default: "verify_ca"
84758466
order: 0
84768467
ca_certificate:
84778468
type: "string"
@@ -8514,9 +8505,6 @@
85148505
mode:
85158506
type: "string"
85168507
const: "verify_identity"
8517-
enum:
8518-
- "verify_identity"
8519-
default: "verify_identity"
85208508
order: 0
85218509
ca_certificate:
85228510
type: "string"
@@ -8565,9 +8553,6 @@
85658553
method:
85668554
type: "string"
85678555
const: "STANDARD"
8568-
enum:
8569-
- "STANDARD"
8570-
default: "STANDARD"
85718556
order: 0
85728557
- title: "Logical Replication (CDC)"
85738558
description: "CDC uses the Binlog to detect inserts, updates, and deletes.\
@@ -8578,9 +8563,6 @@
85788563
method:
85798564
type: "string"
85808565
const: "CDC"
8581-
enum:
8582-
- "CDC"
8583-
default: "CDC"
85848566
order: 0
85858567
initial_waiting_seconds:
85868568
type: "integer"

airbyte-integrations/connectors/source-mysql-strict-encrypt/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ ENV APPLICATION source-mysql-strict-encrypt
1616

1717
COPY --from=build /airbyte /airbyte
1818

19-
LABEL io.airbyte.version=1.0.12
19+
LABEL io.airbyte.version=1.0.13
2020

2121
LABEL io.airbyte.name=airbyte/source-mysql-strict-encrypt

airbyte-integrations/connectors/source-mysql-strict-encrypt/src/test/resources/expected_spec.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161
"mode": {
6262
"type": "string",
6363
"const": "preferred",
64-
"enum": ["preferred"],
65-
"default": "preferred",
6664
"order": 0
6765
}
6866
}
@@ -75,8 +73,6 @@
7573
"mode": {
7674
"type": "string",
7775
"const": "required",
78-
"enum": ["required"],
79-
"default": "required",
8076
"order": 0
8177
}
8278
}
@@ -89,8 +85,6 @@
8985
"mode": {
9086
"type": "string",
9187
"const": "verify_ca",
92-
"enum": ["verify_ca"],
93-
"default": "verify_ca",
9488
"order": 0
9589
},
9690
"ca_certificate": {
@@ -134,8 +128,6 @@
134128
"mode": {
135129
"type": "string",
136130
"const": "verify_identity",
137-
"enum": ["verify_identity"],
138-
"default": "verify_identity",
139131
"order": 0
140132
},
141133
"ca_certificate": {
@@ -187,8 +179,6 @@
187179
"method": {
188180
"type": "string",
189181
"const": "STANDARD",
190-
"enum": ["STANDARD"],
191-
"default": "STANDARD",
192182
"order": 0
193183
}
194184
}
@@ -201,8 +191,6 @@
201191
"method": {
202192
"type": "string",
203193
"const": "CDC",
204-
"enum": ["CDC"],
205-
"default": "CDC",
206194
"order": 0
207195
},
208196
"initial_waiting_seconds": {

airbyte-integrations/connectors/source-mysql/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ ENV APPLICATION source-mysql
1616

1717
COPY --from=build /airbyte /airbyte
1818

19-
LABEL io.airbyte.version=1.0.12
19+
LABEL io.airbyte.version=1.0.13
2020

2121
LABEL io.airbyte.name=airbyte/source-mysql

airbyte-integrations/connectors/source-mysql/src/main/java/io/airbyte/integrations/source/mysql/MySqlSourceOperations.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,15 @@ public void setJsonField(final ResultSet resultSet, final int colIndex, final Ob
8989
}
9090
}
9191
case BOOLEAN -> putBoolean(json, columnName, resultSet, colIndex);
92-
case TINYINT, TINYINT_UNSIGNED -> {
92+
case TINYINT -> {
9393
if (field.getLength() == 1L) {
9494
// TINYINT(1) is boolean
9595
putBoolean(json, columnName, resultSet, colIndex);
9696
} else {
9797
putShortInt(json, columnName, resultSet, colIndex);
9898
}
9999
}
100+
case TINYINT_UNSIGNED -> putShortInt(json, columnName, resultSet, colIndex);
100101
case SMALLINT, SMALLINT_UNSIGNED, MEDIUMINT, MEDIUMINT_UNSIGNED -> putInteger(json, columnName, resultSet, colIndex);
101102
case INT, INT_UNSIGNED -> {
102103
if (field.isUnsigned()) {
@@ -184,7 +185,7 @@ public MysqlType getFieldType(final JsonNode field) {
184185

185186
switch (literalType) {
186187
// BIT(1) and TINYINT(1) are interpreted as boolean
187-
case BIT, TINYINT, TINYINT_UNSIGNED -> {
188+
case BIT, TINYINT -> {
188189
if (columnSize == 1) {
189190
return MysqlType.BOOLEAN;
190191
}

docs/integrations/sources/mysql.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@ WHERE actor_definition_id ='435bb9a5-7887-4809-aa58-28c27df0d7ad' AND (configura
252252
## Changelog
253253
| Version | Date | Pull Request | Subject |
254254
|:--------|:-----------|:-----------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------|
255-
| 1.0.12 | 2022-11-07 | [19025](https://github.com/airbytehq/airbyte/pull/19025) | Stop enforce SSL if ssl mode is disabled |
256-
| 1.0.11 | 2022-11-03 | [18851](https://github.com/airbytehq/airbyte/pull/18851) | Fix bug with unencrypted CDC connections |
255+
| 1.0.13 | 2022-11-14 | [18956](https://github.com/airbytehq/airbyte/pull/18956) | Clean up Tinyint Unsigned data type identification |
256+
| 1.0.12 | 2022-11-07 | [19025](https://github.com/airbytehq/airbyte/pull/19025) | Stop enforce SSL if ssl mode is disabled |
257+
| 1.0.11 | 2022-11-03 | [18851](https://github.com/airbytehq/airbyte/pull/18851) | Fix bug with unencrypted CDC connections |
257258
| 1.0.10 | 2022-11-02 | [18619](https://github.com/airbytehq/airbyte/pull/18619) | Fix bug with handling Tinyint(1) Unsigned values as boolean |
258259
| 1.0.9 | 2022-10-31 | [18538](https://github.com/airbytehq/airbyte/pull/18538) | Encode database name |
259260
| 1.0.8 | 2022-10-25 | [18383](https://github.com/airbytehq/airbyte/pull/18383) | Better SSH error handling + messages |

0 commit comments

Comments
 (0)