Skip to content

mysqlconnector unable to process the date like: 2025-01-00 in MariaDB #1573

@LinusLiuMS

Description

@LinusLiuMS

Software versions
MySqlConnector version: 2.2.7
Server type (MySQL, MariaDB, Aurora, etc.) and version: mariaDB 11.4
.NET version: 4.7.2
(Optional) ORM NuGet packages and versions:

Describe the bug
In the MariaDB server, we have table with column as date type. And we have inserted data like: 2025-01-00 as value for the date column,
++ in mariadb client tool: like HeidiSQL, we can read the data without any issue.
++ But when using Azure Data Factory which is using MySQLconnector, it is failing with error as below:
Type=System.FormatException,Message=Couldn't interpret value as a valid DateTime: l\u0007\u0001\u0000,Source=MySqlConnector,''Type=System.ArgumentOutOfRangeException,Message=Year, Month, and Day parameters describe an un-representable DateTime.

Exception
Full exception message and call stack (if applicable)
at MySqlConnector.Core.BinaryRow.ReadDateTime(ReadOnlySpan`1 value) in /_/src/MySqlConnector/Core/BinaryRow.cs:line 193,'","FailureInitiator":"Source"},"MsgId":null,"ExceptionType":null,"Source":null,"StackTrace":null,"InnerEventInfos":[]}\r\n
Code sample

/* A concise code sample to reproduce the bug */

Expected behavior
It may pass the invalid value as null but will not throw exception which caused ADF job to fail.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for answerNeeds more information from the bug reporter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions