Skip to content

Commit 0848873

Browse files
Clare Zheng (Shanghai Wicresoft Co Ltd)Clare Zheng (Shanghai Wicresoft Co Ltd)
authored andcommitted
Update best practices
1 parent 3da5a3e commit 0848873

File tree

1 file changed

+5
-34
lines changed

1 file changed

+5
-34
lines changed

articles/data-factory/connector-mysql.md

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -305,15 +305,12 @@ When copying data from MySQL, the following mappings are used from MySQL data ty
305305
| `time` |`TimeSpan` |`TimeSpan` |
306306
| `timestamp` |`Datetime` |`Datetime` |
307307
| `tinyblob` |`Byte[]` |`Byte[]` |
308-
| `tinyint` |`SByte` |`Int16` |
308+
| `tinyint` |`SByte` <br/> (tinyint(1) is mapped to Boolean) |`Int16` |
309309
| `tinyint unsigned` |`Int16` |`Int16` |
310310
| `tinytext` |`String` |`String` |
311311
| `varchar` |`String` |`String` |
312312
| `year` |`Int` |`Int` |
313313

314-
>[!NOTE]
315-
>Storing bit(1) as Boolean in the legacy version was improved in the recommended version. If you still want to have Boolean value by using the recommended version, use tinybit(1) data type.
316-
317314
## Lookup activity properties
318315

319316
To learn details about the properties, check [Lookup activity](control-flow-lookup-activity.md).
@@ -330,39 +327,13 @@ Here are steps that help you upgrade your MySQL connector:
330327

331328
### Best practices for MySQL connector recommended version
332329

333-
This section introduces some best practices for MySQL connector recommended version.
330+
This section introduces best practices for MySQL connector recommended version.
334331

335332
#### Cannot load SSL key
336333

337-
If you are using MySQL connector recommended version with SSL Key as a connection property, you might hit the following issues:
338-
- `Could not load the client key from your_pem_file`
339-
- `Unrecognized PEM header: -----BEGIN PRIVATE KEY-----`
340-
341-
The reason for these issues is the recommended version cannot decrypt the PCKS#8 format. You need to convert the PEM format to PCKS#1.
342-
343-
#### Treat tiny as Boolean
344-
345-
The recommended version treats tinyint(1) as Boolean type by default, which is by design. For more information, see this [article](https://dev.mysql.com/doc/refman/8.0/en/numeric-type-syntax.html).
346-
347-
To let the connector return tiny as numeric, set `treatTinyAsBoolean=false` in the connection properties.
348-
349-
#### Treat char(36) as GUID
350-
351-
The recommended version will treat Char(36) as GUID type by default for better performance.
352-
353-
The connector treats Char(36) fields as GUIDs for easier database handling. This treatment simplifies operations such as inserting, updating, and retrieving GUID values, ensuring they are consistently managed as GUID objects in the application code instead of plain strings. This behavior is particularly useful in scenarios where GUIDs are used as primary keys or unique identifiers and provides better performance.
354-
355-
You can also change this behavior by setting `guidFormat=none` in connection property.
356-
357-
#### Cannot read zero or invalid date
358-
359-
The recommended version cannot read zero or invalid date value. It is by default.
360-
361-
MySQL permits you to store a "zero" value of '0000-00-00' as a "dummy date." In some cases, this is more convenient than using NULL values, and uses less data and index space. To disallow '0000-00-00', enable the [NO_ZERO_DATE](https://dev.mysql.com/doc/refman/8.4/en/sql-mode.html#sqlmode_no_zero_date) mode. For more information, see this [article](https://dev.mysql.com/doc/refman/8.4/en/date-and-time-types.html).
362-
363-
For zero date value, you can set `convertZeroDateTime=true` and `allowZeroDateTime=true`to return DateTime.MinValue (1/1/0001 12:00:00 AM).
364-
365-
For invalid date value, you can modify your SQL to wrap the column as String type.
334+
- **Symptoms**: If you are using MySQL connector recommended version with SSL Key as a connection property, you may meet the following error message: `Could not load the client key from your_pem_file: Unrecognized PEM header: -----BEGIN PRIVATE KEY-----`
335+
- **Cause**: The recommended version cannot decrypt the PCKS#8 format.
336+
- **Recommendation**: Convert the PEM format to PCKS#1.
366337

367338
## Differences between the recommended and the legacy driver version
368339

0 commit comments

Comments
 (0)