mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Fix two similar problems in fts3 that meant that an OOM error could cause a memory leak.
FossilOrigin-Name: 701ef64b3dbf45e52043e79e528002bd4b7a21e2
This commit is contained in:
@ -33,7 +33,8 @@ set DO_MALLOC_TEST 1
|
||||
# fts3_malloc-2.*: Test OOM during SELECT operations.
|
||||
# fts3_malloc-3.*: Test OOM during SELECT operations with a larger database.
|
||||
# fts3_malloc-4.*: Test OOM during database write operations.
|
||||
#
|
||||
# fts3_malloc-5.*: Test that a couple of memory leaks that could follow
|
||||
# OOM in tokenizer code have been fixed.
|
||||
#
|
||||
|
||||
|
||||
@ -288,6 +289,16 @@ do_test fts3_malloc-4.2 {
|
||||
execsql { SELECT a FROM ft }
|
||||
} {two four {two four}}
|
||||
|
||||
do_write_test fts3_malloc-5.1 ft_content {
|
||||
INSERT INTO ft VALUES('short alongertoken reallyquitealotlongerimeanit andthistokenisjustsolongthatonemightbeforgivenforimaginingthatitwasmerelyacontrivedexampleandnotarealtoken', 'cynics!')
|
||||
}
|
||||
do_test fts3_malloc-5.2 {
|
||||
execsql { CREATE VIRTUAL TABLE ft8 USING fts3(x, tokenize porter) }
|
||||
} {}
|
||||
do_write_test fts3_malloc-5.3 ft_content {
|
||||
INSERT INTO ft8 VALUES('short alongertoken reallyquitealotlongerimeanit andthistokenisjustsolongthatonemightbeforgivenforimaginingthatitwasmerelyacontrivedexampleandnotarealtoken')
|
||||
}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
|
Reference in New Issue
Block a user