Re: '0000-00-00' is an invalid date

From: bill <william_at_TechServSys.com>
Date: Sun, 4 Feb 2018 15:27:40 -0500
Message-ID: <p57qbt$17pj$1_at_gioia.aioe.org>


[Quoted] On 2/4/2018 10:52 AM, Peter H. Coffin wrote:
> On Sun, 4 Feb 2018 07:55:36 -0500, bill wrote:

>> I can SELECT * FROM `episodes` where `ending` = '0000-00-00'
>> without error, but
>> update`episodes`  set `ending` = NULL
>> where `ending` = '0000-00-00'
>> gives me the error.

>
> Two routes:
>
> a) Turn zero dates on in your SQL Mode then turn them back off
> again when you've fixed this. (If you want them off -- leaving them on
> will PROBABLY get you the behavior you were expecting in the beginning.
> But it's your database, so you're the one that has to live with any
> unexpected consequences of a permanent mode change now.)
>
It appears that in the OS upgrade I went from 5.5.59 to 5.7.21 which changed the mode so that NO_ZERO_DATE AND NO_ZERO_IN_DATE were set.

As you suggested I want to set the mode to turn off NO_ZERO_DATE, but can't see how.
doing SET GLOBAL sql_mode ='' would probably cause lots of changes I don't want. How does one set just one mode off?

Thanks

-bill Received on Sun Feb 04 2018 - 21:27:40 CET

Original text of this message