On 17 Aug 2015, at 4:50pm, Olivier Barthelemy <barthelemy at geovariances.com> 
wrote:

>> SQLite has no such type
> 
> I see nothing in Qt code that converts BOOLEAN in NUMERIC or anything else.
> The statement is passed as is to sqlite.

SQLite is interpreting BOOLEAN as NUMERIC.  See the last line of the table in 
section 2.2 of

<https://www.sqlite.org/datatype3.html>

This is in most cases the right thing to do, since BOOLEAN values stored by 
most SQL programming are really the numbers 0 and 1.  However your CHECK 
constraints treat the values as if they're strings:

> storage_implicit = 'true' OR
> storage_implicit = 'false'

and if the values are understood as NUMERIC, neither of those string 
comparisons will ever by true, so all INSERT commands will fail their 
constraint checks.

> On previously created sqlite files, when i open then in sqlite manager
> addon of Firefox, the field is still displayed as BOOLEAN

FireFox is showing you the command that was used to create the table.  This is 
an (unfortunate ?) aspect of how SQLite works: it stores the creation string 
rather than details of how it was understood.

Simon.

Reply via email to