MySQL Forums
Forum List  »  French

Re: WHERE Date = '' MySQL 8
Posted by: Peter Brawley
Date: July 29, 2019 10:17AM

select version();
+-----------+
| version() |
+-----------+
| 8.0.16    |
+-----------+
use test;
drop table if exists t;
create table t(d date);
set @@sql_mode='allow_invalid_dates';
select @@sql_mode;
+---------------------+
| @@sql_mode          |
+---------------------+
| ALLOW_INVALID_DATES |
+---------------------+
insert into t values('');
select d from t;                                        -- NOTE NO ERROR
+------------+
| d          |
+------------+
| 0000-00-00 |
+------------+
set @@sql_mode='allow_invalid_dates,strict_all_tables'; -- NOTE ERROR
select @@sql_mode;
insert into t values('');
Error: Incorrect date value: '' for column 'd' at row 1

Options: ReplyQuote


Subject
Views
Written By
Posted
1076
July 26, 2019 07:30AM
462
July 26, 2019 10:20AM
441
July 29, 2019 02:03AM
Re: WHERE Date = '' MySQL 8
478
July 29, 2019 10:17AM
462
July 30, 2019 01:59AM
525
July 28, 2019 01:35PM
471
July 29, 2019 01:56AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.