On 10/31/15, Donald Griggs <dfgriggs at gmail.com> wrote:
>
> I imagine this doesn't fully solve your problem, but I noted that:
>
> 1.  Your example database does NOTt pass
>    PRAGMA   INTEGRITY_CHECK;
> When using 3.9.1 command line utility.
>
> 2. Using 3.8.10.2, it DOES pass.
>

Very interesting.

The schema syntax in the example database is incorrect.  It uses
single-quotes to quote identifier names, where it should be using
double-quotes.  In other words, it says things like:

     ... PRIMARY KEY('ID_KFEATURE') ...

When the correct syntax is:

     ... PRIMARY KEY("ID_KFEATURE") ...

SQLite has historically tolerated the incorrect feature.  A decade
ago, I thought it would be a cool feature to have a more "forgiving"
syntax.  I now realize that was a mistake and I call this a
mis-feature.  But it is there and so we have to support it moving
forward.  Even so, you shouldn't be using it!

With the introduction of indexes on expressions, SQLite is now
(sometimes but not consistently) interpreting

      ... PRIMARY KEY('ID_KFEATURE') ...

as an index on a string constant.  SQLite is incorrect in this.  It
should know better.  It's a bug and we will fix it.

On the other hand, the *real* problem is that you are using
single-quotes to quote identifier names when you should be using
double-quotes.  Please fix your SQL and the problem will disappear.

Likely the problem will also be fixed by the next official SQLite release.

-- 
D. Richard Hipp
drh at sqlite.org

Reply via email to