MySQLs' "FOREIGN KEYS¨

From: Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
To: pgsql-advocacy(at)postgresql(dot)org
Subject: MySQLs' "FOREIGN KEYS¨
Date: 2003-11-07 16:50:56
Message-ID: 3FABCD70.1030009@trade-india.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy


MySQL does not thinks 0 to be a valid integer data .
Although 0 is not present in master table
it allows inserting in a referencing table
as though 0 == NULL . This is really funny (dangerous)

mysql> alter table slave add foreign key (id2) references master(id);
Query OK, 6 rows affected (0.00 sec)
Records: 6 Duplicates: 0 Warnings: 0

mysql> select * from master;
Empty set (0.00 sec)

mysql>

mysql> select * from slave;
+------+
| id2 |
+------+
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
| 0 |
+------+
6 rows in set (0.00 sec)

Responses

Browse pgsql-advocacy by date

  From Date Subject
Next Message Alvaro Herrera 2003-11-07 17:36:59 Re: Changes to Contributor List
Previous Message Bruce Momjian 2003-11-07 16:49:22 Re: PHB?