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

Fix some problems to do with OOM conditions in vdbesort.c. Some problems remain.

FossilOrigin-Name: 2f94f9ce9bf11f1599bbc640b3fc8c15da588416
This commit is contained in:
dan
2014-04-15 20:52:27 +00:00
parent 1a088a8ef5
commit 22ace89179
4 changed files with 63 additions and 8 deletions

40
test/sortfault.test Normal file
View File

@ -0,0 +1,40 @@
# 2014 March 25.
#
# 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.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix sortfault
do_execsql_test 1.0 {
PRAGMA cache_size = 5;
}
do_faultsim_test 1 -prep {
sqlite3 db test.db
} -body {
execsql {
WITH r(x,y) AS (
SELECT 1, randomblob(1000)
UNION ALL
SELECT x+1, randomblob(1000) FROM r
LIMIT 500
)
SELECT count(x), length(y) FROM r GROUP BY (x%5)
}
} -test {
faultsim_test_result {0 {100 1000 100 1000 100 1000 100 1000 100 1000}}
}
finish_test