Bug #79587 "UNIX_TIMESTAMP(count(a))" is expected to return 0, not NULL
Submitted: 10 Dec 2015 7:40 Modified: 2 Dec 2019 22:14
Reporter: Su Dylan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.7.8, 5.7.9, 5.6.27, 5.5.48 OS:Any
Assigned to: CPU Architecture:Any

[10 Dec 2015 7:40] Su Dylan
Description:
Output:
=======
mysql> drop table if exists sb;
Query OK, 0 rows affected (0.01 sec)

mysql> create table sb(a bigint);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into sb values(1);
Query OK, 1 row affected (0.00 sec)

STAMP(1),UNmysql> select UNIX_TIMESTAMP(1),UNIX_TIMESTAMP(count(a)) from sb;
+-------------------+--------------------------+
| UNIX_TIMESTAMP(1) | UNIX_TIMESTAMP(count(a)) |
+-------------------+--------------------------+
|                 0 |                     NULL |
+-------------------+--------------------------+
1 row in set, 2 warnings (0.00 sec)

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.7.8-rc  |
+-----------+
1 row in set (0.00 sec)

Problem:
========
"UNIX_TIMESTAMP(count(a))" is expected to return 0, not NULL

How to repeat:

drop table if exists sb;
create table sb(a bigint);
insert into sb values(1);
select UNIX_TIMESTAMP(1),UNIX_TIMESTAMP(count(a)) from sb; 

Suggested fix:
"UNIX_TIMESTAMP(count(a))" is expected to return 0, not NULL
[10 Dec 2015 7:56] MySQL Verification Team
Hello Su Dylan,

Thank you for the report and test case.

Thanks,
Umesh
[2 Dec 2019 22:14] Roy Lyseng
Posted by developer:
 
Fixed in 8.0.18