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.

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

Reply via email to