[MDEV-9413] "datetime >= coalesce(c1(NULL))" doesn't return expected NULL Created: 2016-01-14  Updated: 2016-04-20  Resolved: 2016-04-20

Status: Closed
Project: MariaDB Server
Component/s: Temporal Types
Affects Version/s: 10.1.10, 5.3.13, 5.5, 10.0, 10.1
Fix Version/s: 5.5.49

Type: Bug Priority: Critical
Reporter: Dylan Su Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Sprint: 10.0.25

 Description   

Output:

mysql> create table t1(c1 timestamp(6) null default null);
Query OK, 0 rows affected (0.01 sec)
 
mysql> insert into t1 values(NULL);
Query OK, 1 row affected (0.00 sec)
 
mysql> select c1, '2016-06-13 20:00:00.000003' >= COALESCE( c1 ) from t1;
+------+------------------------------------------------+
| c1   | '2016-06-13 20:00:00.000003' >= COALESCE( c1 ) |
+------+------------------------------------------------+
| NULL |                                              1 |
+------+------------------------------------------------+
1 row in set (0.00 sec)
 
mysql>
mysql> select version();
+-----------------+
| version()       |
+-----------------+
| 10.1.10-MariaDB |
+-----------------+
1 row in set (0.00 sec)
 

Recreate:

 
drop table if exists t1;
create table t1(c1 timestamp(6) null default null);
insert into t1 values(NULL);
select c1, '2016-06-13 20:00:00.000003' >= COALESCE( c1 ) from t1;
 
 

Problem:
NULL is expected.



 Comments   
Comment by Elena Stepanova [ 2016-01-15 ]

Thanks for the report and the test case.

Not reproducible with MySQL 5.5, 5.6, 5.7.

Comment by Alexander Barkov [ 2016-04-20 ]

The patch for MDEV-9521 fixed this problem as well.

Generated at Thu Feb 08 07:34:29 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.