1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Have the xUpdate() method of the rtree module virtual table implementation set the *pRowid output variable when inserting a row. Fix for [dd3ba6063a].

FossilOrigin-Name: f31d22489d44701c89cb13c663dfa1a6cc04f900
This commit is contained in:
dan
2010-03-19 19:02:27 +00:00
parent f92a4e35c5
commit 3f0d9d3846
4 changed files with 27 additions and 19 deletions

View File

@ -2483,6 +2483,7 @@ static int rtreeUpdate(
}
rc = sqlite3_reset(pRtree->pReadRowid);
}
*pRowid = cell.iRowid;
if( rc==SQLITE_OK ){
rc = ChooseLeaf(pRtree, &cell, 0, &pLeaf);

View File

@ -399,4 +399,21 @@ do_test rtree-10.1 {
catchsql { CREATE VIRTUAL TABLE t7 USING rtree(index, x1, y1, x2, y2) }
} {1 {near "index": syntax error}}
#-------------------------------------------------------------------------
# Test last_insert_rowid().
#
do_test rtree-11.1 {
execsql {
CREATE VIRTUAL TABLE t8 USING rtree(idx, x1, x2, y1, y2);
INSERT INTO t8 VALUES(1, 1.0, 1.0, 2.0, 2.0);
SELECT last_insert_rowid();
}
} {1}
do_test rtree-11.2 {
execsql {
INSERT INTO t8 VALUES(NULL, 1.0, 1.0, 2.0, 2.0);
SELECT last_insert_rowid();
}
} {2}
finish_test