Jump to content
dreerr

MySQL 8.0.17 datetime error

Recommended Posts

Dear Community,

Since I upgraded my local installation of MySQL to 8.0.17 (stable) I get all kinds of errors in the frontend of a installation.

My selector is

$pages->find("template=show,date_show_to=,sort=-date_show_from")

 and I get the error

SQLSTATE[HY000]: General error: 1525 Incorrect DATETIME value: ''

so it is somehow not possible anymore to search for empty datetime fields. My my.cnf mode

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,NO_ENGINE_SUBSTITUTION

But I already tried with 

sql_mode=STRICT_TRANS_TABLES,ALLOW_INVALID_DATES,NO_ENGINE_SUBSTITUTION

 

Any ideas? 

Share this post


Link to post
Share on other sites
3 hours ago, dreerr said:

Since I upgraded my local installation of MySQL to 8.0.17 (stable) I get all kinds of errors in the frontend of a installation.

It's a breaking change in MySQL 8.0.16 that Oracle developers are refusing to list as such, as documented here.

I guess Ryan will have to adapt the fieldtype's getMatchQuery code to keep things compatible. I have taken the liberty and opened an issue since this is going to bite me too soon.

In the mean time, you could try replacing the line in question in FieldtypeDatetime::getMatchQuery, changing it from

			else $value = '';

to

			else $value = '0000-00-00 00:00:00';

and see if that works.

  • Like 6

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...