Stephan Beal wrote:
> On Fri, Mar 28, 2014 at 1:50 PM, Simon Slavin <slav...@bigfraud.org> wrote:
>> But this is not a documented specification for SQLite.  It is allowed to
>> use any integer which is currently unused.  I have no idea whether it's
>> allowed to use negative integers.
>
> This is not a definitive answer but is possibly a hint: fossil
> (primarily/originally authored by DRH) relies very much on the fact that
> record IDs (auto-incremented) have values greater than 0. Based on that, my
> strong assumption is that autoinc will never produce a negative value.

sqlite> create table t(x integer primary key);
sqlite> insert into t values(-100);
sqlite> insert into t default values;
sqlite> select * from t;
-100
-99
sqlite> create table u(x integer primary key autoincrement);
sqlite> insert into u values(-100);
sqlite> insert into u default values;
sqlite> select * from u;
-100
1


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to