123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- # 2023 Nov 23
- #
- # 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.
- #
- #*************************************************************************
- #
- source [file join [file dirname [info script]] fts5_common.tcl]
- ifcapable !fts5 { finish_test ; return }
- set ::testprefix fts5secure8
- proc sql_repeat {txt n} {
- string repeat $txt $n
- }
- db func repeat sql_repeat
- do_execsql_test 1.0 {
- CREATE VIRTUAL TABLE ft USING fts5(x);
- INSERT INTO ft(ft, rank) VALUES('pgsz', 64);
- INSERT INTO ft(rowid, x) VALUES(100, 'hello world');
- INSERT INTO ft(rowid, x) VALUES(200, 'one day');
- BEGIN;
- INSERT INTO ft(rowid, x) VALUES(45, 'one two three');
- UPDATE ft SET x = repeat('hello world ', 500) WHERE rowid=100;
- COMMIT
- }
- do_execsql_test 1.1 {
- INSERT INTO ft(ft, rank) VALUES('secure-delete', 1);
- DELETE FROM ft WHERE rowid=100;
- }
- do_execsql_test 1.2 {
- PRAGMA integrity_check;
- } {ok}
- do_execsql_test 2.0 {
- CREATE VIRTUAL TABLE xyz USING fts5 (
- name,
- content=''
- );
- INSERT INTO xyz(xyz, rank) VALUES('secure-delete', 1);
- INSERT INTO xyz (rowid, name) VALUES(1, 'A');
- INSERT INTO xyz (rowid, name) VALUES(2, 'A');
- INSERT INTO xyz(xyz, rowid, name) VALUES('delete', 2, 'A');
- }
- do_execsql_test 2.1 {
- pragma quick_check;
- } {ok}
- do_catchsql_test 2.2 {
- INSERT INTO xyz(xyz, rank) VALUES('secure-delete', 'hello world');
- } {1 {SQL logic error}}
- finish_test
|