mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Fix a crash that could follow an OOM condition in the instr() SQL function.
FossilOrigin-Name: 6e59e903e4e956617bddef0b94e5cae02d724ac8145940b57ab5b0f628759736
This commit is contained in:
@ -21,7 +21,7 @@ sqlite3_db_config_lookaside db 0 0 0
|
||||
do_execsql_test 1.0 {
|
||||
CREATE TABLE t1(x);
|
||||
}
|
||||
do_faultsim_test 1 -faults oom-t* -body {
|
||||
do_faultsim_test 1 -faults oom* -body {
|
||||
execsql {
|
||||
SELECT 'abc' FROM ( SELECT 'xyz' FROM t1 WHERE (SELECT 1) )
|
||||
}
|
||||
@ -29,4 +29,20 @@ do_faultsim_test 1 -faults oom-t* -body {
|
||||
faultsim_test_result {0 {}}
|
||||
}
|
||||
|
||||
do_execsql_test 2.0.1 { SELECT instr(x'', x'') } {1}
|
||||
do_execsql_test 2.0.2 { SELECT instr(x'12345678', x'') } {1}
|
||||
do_execsql_test 2.0.3 { SELECT instr(x'', x'1234') } {0}
|
||||
|
||||
do_faultsim_test 2.1 -faults oom* -body {
|
||||
execsql { SELECT instr (x'00', zeroblob(1)) }
|
||||
} -test {
|
||||
faultsim_test_result {0 1}
|
||||
}
|
||||
|
||||
do_faultsim_test 2.2 -faults oom* -body {
|
||||
execsql { SELECT instr (zeroblob(1), x'00') }
|
||||
} -test {
|
||||
faultsim_test_result {0 1}
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user