Suppose we have a master table:
create table master (a int primary key, b text) engine=innodb;
and we create a slave table like this:
create table slave (x int references master(x), y text) engine=innodb;
insert into slave (x,y) values (1,'abc');
There's nothing in the master table, but it doesn't fail. Why? Because MySQL silently accepts column level foreign key references without actually creating them.
We have to create the slave table like this:
create table slave (x int, y text, foreign key (x) references master(a)) engine=innodb;
Then, the insert above will properly fail because the foreign key has actually been created.
Note that if you do not declare innodb and myisam is the default type, that too will fail.
Silent failures are one of the "features" in mysql. And one of the reasons I don't use it for serious database work. It's too easy to make a mistake, get incoherent data, then spend a weekend trying to fix it.