MySQL Forums
Forum List  »  French

Re: WHERE Date = '' MySQL 8
Posted by: Emmanuel CARVIN
Date: July 30, 2019 01:59AM

Hi Peter,

Thanks for your answer, but this not our real problem. See below :

mysql> SELECT version();
+-----------+
| version() |
+-----------+
| 8.0.17 |
+-----------+
1 row in set (0.00 sec)

mysql> CREATE DATABASE test;
Query OK, 1 row affected (0.17 sec)

mysql> USE test;
Database changed
mysql> create table t(d date);
Query OK, 0 rows affected (0.47 sec)

mysql> set @@sql_mode='allow_invalid_dates';
Query OK, 0 rows affected (0.00 sec)

mysql> select @@sql_mode;
+---------------------+
| @@sql_mode |
+---------------------+
| ALLOW_INVALID_DATES |
+---------------------+
1 row in set (0.00 sec)

mysql> insert into t values('');
Query OK, 1 row affected, 1 warning (0.07 sec)

mysql> select d from t;
+------------+
| d |
+------------+
| 0000-00-00 |
+------------+
1 row in set (0.00 sec)

mysql> SELECT * FROM t WHERE d = ''; -- This is our real problem. In our software we have some request like this one
ERROR 1525 (HY000): Incorrect DATE value: ''
mysql>

Options: ReplyQuote


Subject
Views
Written By
Posted
458
July 26, 2019 07:30AM
198
July 26, 2019 10:20AM
193
July 29, 2019 02:03AM
210
July 29, 2019 10:17AM
Re: WHERE Date = '' MySQL 8
191
July 30, 2019 01:59AM
238
July 28, 2019 01:35PM
211
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.