SQLite Forum

Error not given when referencing something that doesn't exist
Login
SQLite version 3.36.0 2021-06-18 18:36:39
------------------------------------------------------------
PRAGMA foreign_keys = ON;

create table Owner(
    name text primary key,
    address text
);
create table Pet(
    pet_name text primary key,
    pet_species text,
    pet_DOB text,
    owner_name,
    foreign key (owner_name) references Owner(owner_name) 
);
------------------------------------------------------------

If I am not missing something...
This should give an error saying that the table Owner does not contain owner_name.

What actually happens:
No error is given.

When inserting values:
------------------------------------------------------------
insert into Pet(pet_name, pet_species, pet_DOB, owner_name)
   ...> values ("Rufus", "dog", "12/10/2017", "Jim");
Error: foreign key mismatch - "Pet" referencing "Owner"
------------------------------------------------------------

When inserting in SQLite version 3.34.0 2020-12-01 16:14:00:
No error is given.

Is this a bug that has been missed or maybe an intended feature that had a bug that was fixed?