Description:
Have a table with following statement:
CREATE TABLE `jobnoteslog` (
`submittime` datetime NOT NULL default '0000-00-00 00:00:00',
`clientname` varchar(20) NOT NULL,
`jobname` varchar(40) NOT NULL default '',
`notetime` datetime NOT NULL default '0000-00-00 00:00:00',
`username` varchar(20) NOT NULL default '',
`note` varchar(200) NOT NULL default '',
`modtime` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`submittime`,`clientname`,`jobname`,`notetime`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
When I execute the query "select submittime+0 from jobnoteslog", it returns:
submittime+0
---------------------
20060405162152.000000
20060409230004.000000
20060410080004.000000
20060410103013.000000
20060410142348.000000
20060410150003.000000
20060410150003.000000
20060410172941.000000
20060410172941.000000
20060410172941.000000
20060410172941.000000
Why the extra 0s? Is it normal?
How to repeat:
Create the table and insert data using:
insert into `jobnoteslog` (`submittime`,`clientname`,`jobname`,`notetime`,`username`,`note`,`modtime`) values ('2006-04-05 16:21:52','company a','job 1','2006-04-05 17:13:24','bob','note','2006-04-05 17:13:24'),('2006-04-09 23:00:04','company i','job 1','2006-04-10 17:43:06','bob','note','2006-04-10 17:43:06'),('2006-04-10 08:00:04','company n','job 1','2006-04-10 17:40:06','bob','note','2006-04-10 17:40:06'),('2006-04-10 10:30:13','company p','job 1','2006-04-10 17:41:50','bob','note','2006-04-10 17:41:50'),('2006-04-10 14:23:48','test case','job 1','2006-04-10 17:39:59','bob','note','2006-04-10 17:39:59'),('2006-04-10 15:00:03','test case','job 2','2006-04-10 17:39:05','bob','note','2006-04-10 17:39:05'),('2006-04-10 15:00:03','test cast','job 2','2006-04-10 17:39:48','bob','note','2006-04-10 17:39:48'),('2006-04-10 17:29:41','company s','job 3','2006-04-10 17:44:13','bob','note','2006-04-10 17:44:13'),('2006-04-10 17:29:41','company s','job 3','2006-04-10 17:44:18','bob','note','2006-04-10 17:44:18'),('2006-04-10 17:29:41','company s','job 3','2006-04-10 17:44:23','bob','note','2006-04-10 17:44:23'),('2006-04-10 17:29:41','company s','job 3','2006-04-10 17:50:50','bob','note','2006-04-10 17:50:50');
and execute the query.
Suggested fix:
None.