On Monday 22 November 2004 04:15 pm, Santino wrote: I can confirm it anyway: I think we have a bug.. Unless someone else see something, might want to take this to bugs.mysql.com
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 578 to server version: 4.1.7-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> DROP DATABASE IF EXISTS bug; Query OK, 0 rows affected, 1 warning (0.09 sec) mysql> create database bug; Query OK, 1 row affected (0.29 sec) mysql> mysql> use bug; Database changed mysql> mysql> CREATE TABLE AULE ( -> AUL_ID int(11) NOT NULL auto_increment, -> PRIMARY KEY (AUL_ID) -> ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Query OK, 0 rows affected (0.11 sec) mysql> mysql> CREATE TABLE OCCUPAZIONI ( -> OCC_ID int(11) NOT NULL auto_increment, -> OCC_ID_AUL int(11) NOT NULL, -> OCC_DATA date, -> PRIMARY KEY (OCC_ID) -> ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Query OK, 0 rows affected (0.04 sec) mysql> mysql> INSERT INTO AULE VALUES (1); Query OK, 1 row affected (0.31 sec) mysql> INSERT INTO AULE VALUES (2); Query OK, 1 row affected (0.00 sec) mysql> INSERT INTO AULE VALUES (3); Query OK, 1 row affected (0.00 sec) mysql> mysql> INSERT INTO OCCUPAZIONI VALUES (1, 1, '2004-11-10'); Query OK, 1 row affected (0.05 sec) mysql> select AUL_ID, OCC_ID from AULE left join OCCUPAZIONI on -> OCC_ID_AUL=AUL_ID and OCC_DATA='2004-11-10' -> where OCC_ID is null; +--------+--------+ | AUL_ID | OCC_ID | +--------+--------+ | 2 | NULL | | 3 | NULL | +--------+--------+ 2 rows in set (0.06 sec) mysql> alter table OCCUPAZIONI -> add KEY OCC_ID_AUL (OCC_ID_AUL); Query OK, 1 row affected (0.15 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> select AUL_ID, OCC_ID from AULE left join OCCUPAZIONI on -> OCC_ID_AUL=AUL_ID and OCC_DATA='2004-11-10' -> where OCC_ID is null; Empty set (0.03 sec) mysql>
pgpwBjAhIxG9H.pgp
Description: PGP signature