"datetime >= coalesce(c1(NULL))" doesn't return expected NULL

Description

Output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 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:

1 2 3 4 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.

Environment

None

Status

Assignee

Alexander Barkov

Reporter

Dylan Su

Labels

None

External issue ID

None

External issue ID

None

Fix versions

Affects versions

10.0
10.1.10
10.1
5.5
5.3.13

Priority

Critical