SQLite Forum

column check constraint typeof(col) = 'integer' fails if col has declared type text
Login
Hi,
after update from 3.29.0 3.32.3 I found the following change in behaviour:

    create table keyvalue (                                                          
        k text not null primary key,                                                 
        v text check (k != 'Something' or typeof(v) = 'integer')                                         
    );    

In 3.29.0

    insert into keyvalue(k, v) values ('Something', 10);

succeeds but in 3.23.3 it fails with 

    "CHECK constraint failed: keyvalue"

If one removes the "text" type declaration in v:

    create table keyvalue (                                                          
        k text not null primary key,                                                 
        v check (k != 'Something'   or typeof(v) = 'integer')                                         
    );    

the insert statement succeeds in 3.32.3, too.

Best regards

Frank