On 02/28/2017 12:15 AM, Cezary H. Noweta wrote:
Hello,
On 2017-02-27 11:41, Dan Kennedy wrote:
CREATE VIRTUAL TABLE f USING fts3(x);
BEGIN;
INSERT INTO f VALUES('one');
INSERT INTO f VALUES('two');
INSERT INTO f VALUES('three');
INSERT INTO f VALUES('four');
COMMIT;
INSERT INTO f VALUES('five');
SELECT last_insert_rowid();
The last SELECT statement returns integer value 2, not 5 as you would
expect.
Indeed, something opposite to the original problem: works (FTS5: not
so) fine until you use transactions.
I think that might have just been luck. Fts3 writes the database as part
of committing a transaction as well - it just happens to choose the same
rowids for simple examples so it looks like it works.
In any case, should work in 3.18:
http://www.sqlite.org/src/info/952a3906b30a818e
Dan.
Not sure if this is something we can fix or not.
In FTS5 ``*_data'' is updated by ``REPLACE ...''. It is impossible to
disable updating of lastRowid. There are commands OP_Insert with P5 |=
OPFLAG_LASTROWID hardcoded. Such late update is bypassing (or
overwriting) virtual table xUpdate's ``pRowid'' feature.
IMHO, the problem requires redesigning of FTSes or SQLite core (for
example by allowing to disable lastRowid's updating temporarily). I'm
not as fluent in SQLite as to see an ``append-one-line'' solution.
-- best regards
Cezary H. Noweta
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users