Don't foreign keys need to be explicitly indexed? Respectfully, Ligaya Turmelle
"saiph" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > hi list, > > i'm studing foreign keys but my sql code does not react as > would imagine when i insert inconsistent data. > > i.e. > > create database urls; > use urls; > > create table caths > ( > name varchar(7) primary key > ) type = innodb; > > create table urls > ( > name varchar(10) primary key, > home varchar(30) unique, > cath varchar(7), > constraint fk foreign key(cath) references caths(name) > on update cascade on delete set null > ) type = innodb; > > load data local infile "caths.lst" into table caths; > load data local infile "urls.lst" into table urls; > > why it it possible to insert urls such as: > mysql mysql.com dev-null > > when dev-null in not a value of the attribute caths.name? > > > thanks. > > > -- > >here are more things in heaven and earth, > horatio, than are dreamt of in your philosophy. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]