|
现在我有一张表定义的格式为:
CREATE TABLE `tl` (
`pn` varchar(20) default NULL,
`lt` char(3) default NULL,
`vc` char(3) default NULL,
`tl` varchar(10) NOT NULL default '',
`ls` varchar(4) default NULL,
`kd` date NOT NULL default '0000-00-00',
`kt` time default NULL,
`wl` varchar(20) NOT NULL default '',
PRIMARY KEY (`tl`),
KEY `wl` (`wl`),
KEY `tl` (`tl`),
KEY `kd` (`kd`)
) TYPE=MyISAM PACK_KEYS=1
1.用这张表运行于mysql4.0上然后运行如下sql语句:
INSERT INTO `tl` (`pn`, `lt`, `vc`, `tl`, `ls`, `kd`, `kt`, `wl`) VALUES
('100354644A','P','N','FC508872','96','-2006-09-25-','00:00:11','333B3'),
('100354644A','P','N','FC508871','96','-2006-09-25-','00:00:11','333B3');
之后查看kd字段的内容为显示为正常的2006-09-25
2.用这张表运行于mysql4.1.8上然后运行相同的sql语句:
INSERT INTO `tl` (`pn`, `lt`, `vc`, `tl`, `ls`, `kd`, `kt`, `wl`) VALUES
('100354644A','P','N','FC508872','96','-2006-09-25-','00:00:11','333B3'),
('100354644A','P','N','FC508871','96','-2006-09-25-','00:00:11','333B3');
之后查看kd字段的内容显示为'null'
这个问题已经困惑了我几个月了请哪们高高手可以帮我解决一下的(前提是kd字段上传的就是这个内容'-2006-09-25-'为什么mysql4.0可以识别的.而mysql4.1以用mysql5.1就不可以识别的呢??? |
|