Ubuntu server 7.10中的mysql 5.0.45 在 linux 下 值为NULL 的日期的 BUG

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
alvin2ye
帖子: 6
注册时间: 2008-03-13 22:28

Ubuntu server 7.10中的mysql 5.0.45 在 linux 下 值为NULL 的日期的 BUG

#1

帖子 alvin2ye » 2008-09-12 9:07

代码: 全选

CREATE TABLE `t1` (
  `id` int(11) NOT NULL auto_increment,
  `balance_dt` datetime default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

INSERT INTO `t1` VALUES ('1', null);
INSERT INTO `t1` VALUES ('2', '2008-01-13 15:48:19');
INSERT INTO `t1` VALUES ('3', '2008-01-15 15:48:19');
INSERT INTO `t1` VALUES ('4', null);
在 ubuntu 下
版本号: Server version: 5.0.45-Debian_1ubuntu3.3-log Debian etch distribution

代码: 全选

select * from t1 where date(balance_dt) >= date('2007-1-14');
Empty set (0.00 sec)
居然找不到, 请教高手, 这是为什么, 是否改一个参数就可以解决这个问题

代码: 全选

select * from t1 where balance_dt is not null and date(balance_dt) >= date('2007-1-14');
+----+---------------------+
| id | balance_dt          |
+----+---------------------+
|  2 | 2008-01-13 15:48:19 |
|  3 | 2008-01-15 15:48:19 |
+----+---------------------+
2 rows in set (0.00 sec)
在mysql 管方网站已经找到这个BUG
http://bugs.mysql.com/bug.php?id=32291

不知道各位高手有什么解决方案, 另外, Ubuntu server 版应该是很稳定的版本才对, 为什么这个Bug 是 2007 年的, 但是现在预装的 mysql 版本还没被这个BUG. 简直不可思议
winstars
帖子: 131
注册时间: 2006-09-07 16:02

#2

帖子 winstars » 2008-09-13 16:02

这个bug已经很久了
alvin2ye
帖子: 6
注册时间: 2008-03-13 22:28

#3

帖子 alvin2ye » 2008-09-13 17:47

是的,

回帖请看贴, 我已经说明了 2007
回复