Skip to content

[4.x] [MySQL] Decode zero DATETIME(n) text values as null - #1801

Merged
tsegismont merged 1 commit into
4.xfrom
backport/1771-to-4.x
Nov 13, 2026
Merged

tsegismont merged 1 commit into
4.xfrom
backport/1771-to-4.x

Conversation

@tsegismont

Copy link
Copy Markdown
Member

Backport of #1771 to 4.x
Cherry-picked commit: af6936f

* Decode zero DATETIME(n) text values as null

A simple query reading a zero DATETIME or TIMESTAMP with fractional
seconds failed to parse '0000-00-00 00:00:00.000000' and dropped the
row. The binary protocol already returns null for it.

Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>
Assisted-by: Anthropic Claude (claude-opus-5-5)

* Compare zero dates as strings

Declare the decoded text as a String in both zero-date checks, so no
conversion call is needed.

Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>
Assisted-by: Anthropic Claude (claude-fable-5-2)

---------

Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>
(cherry picked from commit af6936f)
Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
@tsegismont
tsegismont merged commit 4fa201f into 4.x Nov 13, 2026
18 checks passed
@tsegismont
tsegismont deleted the backport/1771-to-4.x branch November 13, 2026 10:11
@tsegismont tsegismont added this to the 4.5.37 milestone Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants