On 4/18/16, Clemens Ladisch <clemens at ladisch.de> wrote:
> t18970237136 at web.de wrote:
>>>> after updating to 1.0.100.0 which uses SQLite 3.12.1, we are getting the
>>>> following error
>>>>
>>>> SQLite error (1): AUTOINCREMENT is only allowed on an INTEGER PRIMARY
>>>> KEY
>>
>> The problem is ... the "[" and "]" in this syntax:
>> CREATE TABLE Customer (
>>     [ID] [INTEGER]  NOT NULL  PRIMARY KEY  AUTOINCREMENT
>> );
>
> Quoting an indentifier prevents the database from interpreting it as a
> keyword.
>
> Arguably, the old SQLite version did this wrong in this case.

Backwards compatibility is very important and so this is definitely a
(serious) bug in 3.12.0 and 3.12.1.  The current 3.12.2 release
candidate (https://www.sqlite.org/src/timeline?c=92dc59fd) fixes the
problem (https://www.sqlite.org/src/info/7d7525cb01b68) and is in
testing now.  There will be a release soon.

Even though SQLite has always treated datatype names as identifiers,
this is not something that was documented or tested (though it is
tested now!) and not something that the developers were aware of prior
to today.  Hence this behavior change managed to slip through our
release process unnoticed.

-- 
D. Richard Hipp
drh at sqlite.org

Reply via email to