mysql:14274
From: Kazuhiro Yoshida <Kazuhiro Yoshida <moriq@xxxxxxxxxx>>
Date: Tue, 30 Oct 2007 01:56:38 +0900
Subject: [mysql 14274] MySQL 5.0.45 (win32) NULLがあるときのdate()
moriqです。こんばんは。
MySQL 5.0.45 (win32) のバグぽい現象に遭遇しました。
C:\>mysql -u root test
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 75
Server version: 5.0.45-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> drop table if exists t;
Query OK, 0 rows affected (0.01 sec)
mysql> create table t (at datetime);
Query OK, 0 rows affected (0.13 sec)
mysql> insert into t (at) values (null);
Query OK, 1 row affected (0.03 sec)
mysql> insert into t (at) values ('2007-10-13 11:00:00');
Query OK, 1 row affected (0.05 sec)
mysql> select * from t where date(at)='2007-10-13';
Empty set (0.00 sec) # why???
datetime型のカラム (at) に NULL があるとき、
条件節の date() がうまく動かないみたいです。
再現しますでしょうか。
-> 14274 2007-10-30 01:56 [Kazuhiro Yoshida <mo] MySQL 5.0.45 (win32) NULLがあるときのdate() 14275 2007-10-30 13:46 ┗[HIRATSUKA Sadao <hir] 14276 2007-10-30 15:50 ┣[HIRATSUKA Sadao <hir] 14278 2007-10-30 16:57 ┃┗[Kazuhiro Yoshida <mo] 14279 2007-10-30 17:22 ┃ ┗[HIRATSUKA Sadao <hir] 14280 2007-10-30 17:56 ┃ ┗["tarou kawauso" <kaw] 14277 2007-10-30 16:55 ┗["Yasuda, Hiroyuki" <]