3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
12 # Tests of the last_insert_rowid functionality with fts4.
15 set testdir [file dirname $argv0]
16 source [file join [file dirname [info script]] tester.tcl]
17 set testprefix fts4lastrowid
25 CREATE VIRTUAL TABLE t1 USING fts4(str);
29 INSERT INTO t1 VALUES('one string');
30 INSERT INTO t1 VALUES('two string');
31 INSERT INTO t1 VALUES('three string');
32 SELECT last_insert_rowid();
37 INSERT INTO t1 VALUES('one string');
38 INSERT INTO t1 VALUES('two string');
39 INSERT INTO t1 VALUES('three string');
41 SELECT last_insert_rowid();
45 INSERT INTO t1(rowid, str) VALUES(-22, 'some more text');
46 SELECT last_insert_rowid();
51 INSERT INTO t1(rowid, str) VALUES(45, 'some more text');
52 INSERT INTO t1(rowid, str) VALUES(46, 'some more text');
53 INSERT INTO t1(rowid, str) VALUES(222, 'some more text');
54 SELECT last_insert_rowid();
56 SELECT last_insert_rowid();
61 INSERT INTO x1 VALUES('john'), ('paul'), ('george'), ('ringo');
62 INSERT INTO t1 SELECT x FROM x1;
63 SELECT last_insert_rowid();
67 INSERT INTO t1(rowid, str) SELECT rowid+10, x FROM x1;
68 SELECT last_insert_rowid();