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

Avoid using LIKE with the target db in RBU. It is possible the user may issue "PRAGMA case_sensitive_like = 1" or override the like() user function, causing RBU to malfunction.

FossilOrigin-Name: 7cbd8cd5aa768a0b72f769fa390fae1158d1dcfac5273b9d0238ecf2f52e273d
This commit is contained in:
dan
2021-08-04 11:29:18 +00:00
parent 7061aa8977
commit fd779e2fa1
4 changed files with 13 additions and 11 deletions

View File

@ -50,7 +50,7 @@ do_test 1.1 {
#
ifcapable fts3 {
do_execsql_test 2.0 {
CREATE VIRTUAL TABLE ft USING fts4(a, b, languageid='langid');
create virtual TABLE ft USING fts4(a, b, languageid='langid');
}
do_test 2.1 {
apply_rbu {

View File

@ -1194,7 +1194,9 @@ static void rbuTableType(
assert( p->rc==SQLITE_OK );
p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[0], &p->zErrmsg,
sqlite3_mprintf(
"SELECT (sql LIKE 'create virtual%%'), rootpage"
"SELECT "
" (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'),"
" rootpage"
" FROM sqlite_schema"
" WHERE name=%Q", zTab
));