Re: [sqlite] 3.17.0 bug report: FTS5 insertion puts a wrong value in last_insert_rowid

2017-03-27 Thread Gwendal Roué

* Florian Weimer  wrote:

> * Gwendal Roué:
> 
>> I have found a regression in SQLite 3.17.0. In the following SQL statements:
>> 
>>CREATE VIRTUAL TABLE t1 USING FTS5(content);
>>INSERT INTO t1(content) VALUES ('some text');
>>SELECT last_insert_rowid(); // 10 (wrong)
>>SELECT rowid FROM t1;   // 1
>> 
>> The expected value of the the SQL function last_insert_rowid()
>> function is 1, not 10. Same for the C function
>> sqlite3_last_insert_rowid().
> 
> I think this is a known issue.

I am not sure this is a known issue: I don't find it in the tickets list 
(http://www.sqlite.org/src/reportlist).

> SQLite 3.18 adds a
> sqlite3_set_last_insert_rowid() function and uses it in “the new
> interface in the FTS3, FTS4, and FTS5 extensions to ensure that the
> sqlite3_last_insert_rowid() interface always returns reasonable
> values”.

The pending SQLite 3.18 indeed looks like it addresses this issue!

Gwendal Roué


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] 3.17.0 bug report: FTS5 insertion puts a wrong value in last_insert_rowid

2017-03-26 Thread Florian Weimer
* Gwendal Roué:

> I have found a regression in SQLite 3.17.0. In the following SQL statements:
>
> CREATE VIRTUAL TABLE t1 USING FTS5(content);
> INSERT INTO t1(content) VALUES ('some text');
> SELECT last_insert_rowid(); // 10 (wrong)
> SELECT rowid FROM t1;   // 1
>
> The expected value of the the SQL function last_insert_rowid()
> function is 1, not 10. Same for the C function
> sqlite3_last_insert_rowid().

I think this is a known issue.  SQLite 3.18 adds a
sqlite3_set_last_insert_rowid() function and uses it in “the new
interface in the FTS3, FTS4, and FTS5 extensions to ensure that the
sqlite3_last_insert_rowid() interface always returns reasonable
values”.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] 3.17.0 bug report: FTS5 insertion puts a wrong value in last_insert_rowid

2017-03-26 Thread Gwendal Roué
Hello,

I have found a regression in SQLite 3.17.0. In the following SQL statements:

CREATE VIRTUAL TABLE t1 USING FTS5(content);
INSERT INTO t1(content) VALUES ('some text');
SELECT last_insert_rowid(); // 10 (wrong)
SELECT rowid FROM t1;   // 1

The expected value of the the SQL function last_insert_rowid() function is 1, 
not 10. Same for the C function sqlite3_last_insert_rowid().

This bug was not present in 3.16.2.

This bug is very similar to http://www.sqlite.org/src/tktview?name=13137dccf3, 
which affected FTS3.

Cheers,
Gwendal Roué

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users