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

Set the SQLITE_DIRECTONLY flag on the fts3_tokenizer() function of FTS3,

thus preventing that function from being called from within a trigger or
view.

FossilOrigin-Name: f3171dc22e4d3a40ca17fe609391d92fc6a997b775bfefa5947aec69c889aa73
This commit is contained in:
drh
2019-12-31 18:12:36 +00:00
parent 02ff747bc0
commit 1e732787da
4 changed files with 32 additions and 9 deletions

View File

@ -129,6 +129,29 @@ do_test fts3atoken-1.9 {
}
} {1 blob blob blob blob}
# 2019-12-31: The fts3_tokenizer() function can never be invoked from
# within a trigger or view.
#
do_catchsql_test fts3atoken-1.10 {
CREATE VIEW v110(x) AS
SELECT fts3_tokenizer('tok110', fts3_tokenizer('simple')) IS NULL;
} {0 {}}
do_catchsql_test fts3atoken-1.11 {
SELECT * FROM v110;
} {1 {fts3_tokenizer() prohibited in triggers and views}}
do_catchsql_test fts3atoken-1.12 {
CREATE TABLE t110(a,b);
CREATE TRIGGER r110 AFTER INSERT ON t110 BEGIN
SELECT fts3_tokenizer('tok110', fts3_tokenizer('simple')) IS NULL;
END;
} {0 {}}
do_catchsql_test fts3atoken-1.13 {
INSERT INTO t110(a,b) VALUES(1,2);
} {1 {fts3_tokenizer() prohibited in triggers and views}}
do_catchsql_test fts3atoken-1.14 {
SELECT * FROM t110;
} {0 {}}
#--------------------------------------------------------------------------
# Test cases fts3atoken-2.* test error cases in the scalar function based
# API for getting and setting tokenizers.