Re: [sqlite] FTS4 bug in last_insert_rowid()

2011-04-04 Thread Alexey Pechnikov
2011/4/4 Nico Williams : > You're missing something: FTS4 is a virtual table In triggers code we can't know about virtual tables! So in triggers we may get wrong results?.. As example (this _does not_ work now): CREATE TRIGGER view_job_update instead of update on view_job

Re: [sqlite] FTS4 bug in last_insert_rowid()

2011-04-04 Thread Nico Williams
On Mon, Apr 4, 2011 at 9:10 AM, Enrico Thierbach wrote: > I might have an exceptionally dumb day, but this sequence (from this post > http://www.mail-archive.com/sqlite-users@sqlite.org/msg34082.html ) looks > totally fine: You're missing something: FTS4 is a virtual table

Re: [sqlite] FTS4 bug in last_insert_rowid()

2011-04-04 Thread Enrico Thierbach
On 04.04.2011, at 15:59, Simon Slavin wrote: > > On 4 Apr 2011, at 2:48pm, Enrico Thierbach wrote: > >> isn't last_insert_rowid defined as the ID of the last row inserted > > Yes it is. But the FTS system does what it does by maintaining extra tables, > and doing extra operations to them

Re: [sqlite] FTS4 bug in last_insert_rowid()

2011-04-04 Thread Enrico Thierbach
On 04.04.2011, at 15:59, Simon Slavin wrote: > > On 4 Apr 2011, at 2:48pm, Enrico Thierbach wrote: > >> isn't last_insert_rowid defined as the ID of the last row inserted > > Yes it is. But the FTS system does what it does by maintaining extra tables, > and doing extra operations to them

Re: [sqlite] FTS4 bug in last_insert_rowid()

2011-04-04 Thread Simon Slavin
On 4 Apr 2011, at 2:48pm, Enrico Thierbach wrote: > isn't last_insert_rowid defined as the ID of the last row inserted Yes it is. But the FTS system does what it does by maintaining extra tables, and doing extra operations to them besides the ones that the programmer has asked for.

Re: [sqlite] FTS4 bug in last_insert_rowid()

2011-04-04 Thread Enrico Thierbach
Hi Nico, this >> Is this really a bug? I at least wouldn't expect last_insert_rowid to be >> constant if the database gets modified. > was more a question for sake of my understanding. Both in the post Simon referred to > insert into one (value) values ("hello1"); > select

Re: [sqlite] FTS4 bug in last_insert_rowid()

2011-04-04 Thread Nico Williams
On Mon, Apr 4, 2011 at 6:43 AM, Enrico Thierbach wrote: > Is this really a bug? I at least wouldn't expect last_insert_rowid to be > constant if the database gets modified. If you read the post that Simon referenced you'll see that the caller typically wants to know the row

Re: [sqlite] FTS4 bug in last_insert_rowid()

2011-04-04 Thread Enrico Thierbach
Is this really a bug? I at least wouldn't expect last_insert_rowid to be constant if the database gets modified. /eno On 04.04.2011, at 13:28, Alexey Pechnikov wrote: > $ sqlite3 > SQLite version 3.7.6 > Enter ".help" for instructions > Enter SQL statements terminated with a ";" > sqlite>

Re: [sqlite] FTS4 bug in last_insert_rowid()

2011-04-04 Thread Simon Slavin
On 4 Apr 2011, at 12:28pm, Alexey Pechnikov wrote: > sqlite> delete from fts where rowid=2; > sqlite> select last_insert_rowid(); > 3 See http://www.mail-archive.com/sqlite-users@sqlite.org/msg34082.html Simon. ___ sqlite-users mailing list

[sqlite] FTS4 bug in last_insert_rowid()

2011-04-04 Thread Alexey Pechnikov
$ sqlite3 SQLite version 3.7.6 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> CREATE VIRTUAL TABLE fts USING fts4(a,TOKENIZE icu russian); sqlite> select last_insert_rowid(); 0 sqlite> insert into fts(a) values ('test'); sqlite> insert into fts(a) values