Subject | Compound foreign key & null value bug? |
---|---|
Author | Rick Debay |
Post date | 2012-10-24T14:49:32Z |
I'm modifying a foreign key from one column to two.
I dropped the original foreign key from the child table, populated the
new columns, and then created the new key.
I forgot to populate the new column in the child table, so all the
relationships looked like this:
Child Parent
----- ------
Col1:null -> Col1:A
Col2:B -> Col2:B
The new foreign keys were created without any errors. Since (null,B)
doesn't match anything, shouldn't the creation have failed?
I dropped the original foreign key from the child table, populated the
new columns, and then created the new key.
I forgot to populate the new column in the child table, so all the
relationships looked like this:
Child Parent
----- ------
Col1:null -> Col1:A
Col2:B -> Col2:B
The new foreign keys were created without any errors. Since (null,B)
doesn't match anything, shouldn't the creation have failed?