Description:
Hi all,
i have a table: t_pdat which i get from my production table by:
mysql> create table t_pdat as select lbefudat, zst from pdat;
+----------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+----------+------+-----+---------+-------+
| lbefudat | datetime | YES | | NULL | |
| zst | datetime | NO | | | |
+----------+----------+------+-----+---------+-------+
When i do a "select count(*)" i get 0 rows which is -not- correct.
mysql> select count(*) from t_pdat where date(lbefudat) = date('2007-04-27');
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (2,87 sec)
Proof:
mysql> select count(*) from t_pdat where date_format(lbefudat, '%Y-%m-%d') = '2007-04-27';
+----------+
| count(*) |
+----------+
| 588 |
+----------+
1 row in set (3,02 sec)
then i do a
drop table t_pdat1;
create table t_pdat1 as select * from t_pdat where lbefudat is null;
Query OK, 1334912 rows affected (24,55 sec)
Records: 1334912 Duplicates: 0 Warnings: 0
delete from t_pdat where lbefudat is null;
Query OK, 1334912 rows affected (13,83 sec)
select count(*) from t_pdat where date(lbefudat) = date('2007-04-27');
+----------+
| count(*) |
+----------+
| 588 |
+----------+
1 row in set (1,38 sec)
insert into t_pdat select * from t_pdat1;
Query OK, 1334912 rows affected (19,83 sec)
Records: 1334912 Duplicates: 0 Warnings: 0
mysql>
mysql> select count(*) from t_pdat where date(lbefudat) = date('2007-04-27');
+----------+
| count(*) |
+----------+
| 588 |
+----------+
Any clues to this strange behaviour or is this a bug?
kind regards,
Toni
How to repeat:
I tried to make a testcase with data but i cannot reproduce thirs error.
Sometimes it is working correct and sometimes it show the error obove.
Description: Hi all, i have a table: t_pdat which i get from my production table by: mysql> create table t_pdat as select lbefudat, zst from pdat; +----------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------+----------+------+-----+---------+-------+ | lbefudat | datetime | YES | | NULL | | | zst | datetime | NO | | | | +----------+----------+------+-----+---------+-------+ When i do a "select count(*)" i get 0 rows which is -not- correct. mysql> select count(*) from t_pdat where date(lbefudat) = date('2007-04-27'); +----------+ | count(*) | +----------+ | 0 | +----------+ 1 row in set (2,87 sec) Proof: mysql> select count(*) from t_pdat where date_format(lbefudat, '%Y-%m-%d') = '2007-04-27'; +----------+ | count(*) | +----------+ | 588 | +----------+ 1 row in set (3,02 sec) then i do a drop table t_pdat1; create table t_pdat1 as select * from t_pdat where lbefudat is null; Query OK, 1334912 rows affected (24,55 sec) Records: 1334912 Duplicates: 0 Warnings: 0 delete from t_pdat where lbefudat is null; Query OK, 1334912 rows affected (13,83 sec) select count(*) from t_pdat where date(lbefudat) = date('2007-04-27'); +----------+ | count(*) | +----------+ | 588 | +----------+ 1 row in set (1,38 sec) insert into t_pdat select * from t_pdat1; Query OK, 1334912 rows affected (19,83 sec) Records: 1334912 Duplicates: 0 Warnings: 0 mysql> mysql> select count(*) from t_pdat where date(lbefudat) = date('2007-04-27'); +----------+ | count(*) | +----------+ | 588 | +----------+ Any clues to this strange behaviour or is this a bug? kind regards, Toni How to repeat: I tried to make a testcase with data but i cannot reproduce thirs error. Sometimes it is working correct and sometimes it show the error obove.