My Oracle Support Banner

Problem ERROR 1525 (HY000): Incorrect DATETIME value: Post MySQL8 Upgrade (Doc ID 2725151.1)

Last updated on APRIL 23, 2023

Applies to:

MySQL Server - Version 8.0 and later
Information in this document applies to any platform.


When comparing DATE values with constant strings MySQL returns error - ERROR 1525 (HY000): Incorrect DATETIME value: '' and this is an expected behavior since the version MySQL 8.0.16 or later release, which is explained in this article: Query Fails On Date Comparison "ERROR 1525 (HY000): Incorrect DATE value" (Doc ID 2536781.1).

However, this is not ideal in certain situations such as an application is restricted to use only constant string values (e.g.'' in a nullable field) for a date field comparison, and that situation requires a workaround solution.

An example query below has a field comparison with '' which creates an error message with a warning (e.g. in version MySQL 8.0.21).


Upgraded to MySQL 8.0.16 (or later release)


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.