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

Use SQLITE_PREPARE_NO_VTAB in rtree as well.

FossilOrigin-Name: 82a2ae7132964eab0dfad9a8314a399ffd3b72366b35e1767df6452125dd1d80
This commit is contained in:
dan
2018-12-21 19:55:20 +00:00
parent 38e3853240
commit deb201b866
4 changed files with 77 additions and 11 deletions

View File

@ -3423,6 +3423,7 @@ static int rtreeSqlInit(
};
sqlite3_stmt **appStmt[N_STATEMENT];
int i;
const int f = SQLITE_PREPARE_PERSISTENT|SQLITE_PREPARE_NO_VTAB;
pRtree->db = db;
@ -3479,8 +3480,7 @@ static int rtreeSqlInit(
}
zSql = sqlite3_mprintf(zFormat, zDb, zPrefix);
if( zSql ){
rc = sqlite3_prepare_v3(db, zSql, -1, SQLITE_PREPARE_PERSISTENT,
appStmt[i], 0);
rc = sqlite3_prepare_v3(db, zSql, -1, f, appStmt[i], 0);
}else{
rc = SQLITE_NOMEM;
}
@ -3510,8 +3510,7 @@ static int rtreeSqlInit(
if( zSql==0 ){
rc = SQLITE_NOMEM;
}else{
rc = sqlite3_prepare_v3(db, zSql, -1, SQLITE_PREPARE_PERSISTENT,
&pRtree->pWriteAux, 0);
rc = sqlite3_prepare_v3(db, zSql, -1, f, &pRtree->pWriteAux, 0);
sqlite3_free(zSql);
}
}

66
ext/rtree/rtreecirc.test Normal file
View File

@ -0,0 +1,66 @@
# 2018 Dec 22
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#*************************************************************************
# This file implements regression tests for SQLite library. The
# focus of this script is testing the FTS5 module.
#
if {![info exists testdir]} {
set testdir [file join [file dirname [info script]] .. .. test]
}
source [file join [file dirname [info script]] rtree_util.tcl]
source $testdir/tester.tcl
set testprefix rtreecirc
ifcapable !rtree {
finish_test
return
}
do_execsql_test 1.0 {
CREATE VIRTUAL TABLE rt USING rtree(id, x1, x2, y1, y2);
SELECT name FROM sqlite_master ORDER BY 1;
} {
rt rt_node rt_parent rt_rowid
}
db_save_and_close
foreach {tn schema sql} {
1 {
CREATE TRIGGER tr1 AFTER INSERT ON rt_node BEGIN
SELECT * FROM rt;
END;
} {
INSERT INTO rt VALUES(1, 2, 3, 4, 5);
}
2 {
CREATE TRIGGER tr1 AFTER INSERT ON rt_parent BEGIN
SELECT * FROM rt;
END;
} {
INSERT INTO rt VALUES(1, 2, 3, 4, 5);
}
3 {
CREATE TRIGGER tr1 AFTER INSERT ON rt_rowid BEGIN
SELECT * FROM rt;
END;
} {
INSERT INTO rt VALUES(1, 2, 3, 4, 5);
}
} {
db_restore_and_reopen
do_execsql_test 1.1.$tn.1 $schema
do_catchsql_test 1.1.$tn.2 $sql {1 {no such table: main.rt}}
db close
}
finish_test