Comments - UNIX_TIMESTAMP

5 years, 11 months ago l Allen

select from a table is still 0

select request_time  from exec_log where id=11391900003;
+---------------------+
| request_time        |
+---------------------+
| 0000-00-00 00:00:00 |
+---------------------+
select UNIX_TIMESTAMP(request_time)  from exec_log where id=11391900003;
+------------------------------+
| UNIX_TIMESTAMP(request_time) |
+------------------------------+
|                            0 |
+------------------------------+


| exec_log | CREATE TABLE `exec_log` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `client_ip` int(10) unsigned NOT NULL,
  `request_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `status` int(10) unsigned NOT NULL DEFAULT '0',
  `succ_count` int(10) unsigned NOT NULL DEFAULT '0',
  `first_touch_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `client_ip` (`client_ip`),
  KEY `succ_count_btree` (`succ_count`) USING BTREE,
  KEY `first_touch_time_tree` (`first_touch_time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=11391900004 DEFAULT CHARSET=latin1 |

But select from view is NULL.

select last_fetch_time from clients_info_logic where ip='1.1.1.6';
+---------------------+
| last_fetch_time     |
+---------------------+
| 0000-00-00 00:00:00 |
+---------------------+
select UNIX_TIMESTAMP(last_fetch_time) from clients_info_logic where ip='1.1.1.6';
+---------------------------------+
| UNIX_TIMESTAMP(last_fetch_time) |
+---------------------------------+
|                            NULL |
+---------------------------------+
 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.