aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2024-02-12 14:44:35 +0000
committerdrh <>2024-02-12 14:44:35 +0000
commit38e0492b91f7f47b86dd94ff6683b71fe712fcbb (patch)
treedddc57e61b969b76a21ab6e2bb5d9c181a8082ae /src
parentb29047838d7b8de39467800944b3d169cf1f495b (diff)
parent84dea8264b783dcfe780633ddae1e57b5f37be57 (diff)
downloadsqlite-38e0492b91f7f47b86dd94ff6683b71fe712fcbb.tar.gz
sqlite-38e0492b91f7f47b86dd94ff6683b71fe712fcbb.zip
Add a new sqlite3FaultSim() to btree for better fault analysis.
FossilOrigin-Name: 2c675bd30568d3c530300beb3fcfaa17c9f063cdcb9a39ac68b9902100f641a6
Diffstat (limited to 'src')
-rw-r--r--src/btree.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/btree.c b/src/btree.c
index 058f24670..49c07c81a 100644
--- a/src/btree.c
+++ b/src/btree.c
@@ -5128,9 +5128,12 @@ static int accessPayload(
if( pCur->aOverflow==0
|| nOvfl*(int)sizeof(Pgno) > sqlite3MallocSize(pCur->aOverflow)
){
- Pgno *aNew = (Pgno*)sqlite3Realloc(
- pCur->aOverflow, nOvfl*2*sizeof(Pgno)
- );
+ Pgno *aNew;
+ if( sqlite3FaultSim(413) ){
+ aNew = 0;
+ }else{
+ aNew = (Pgno*)sqlite3Realloc(pCur->aOverflow, nOvfl*2*sizeof(Pgno));
+ }
if( aNew==0 ){
return SQLITE_NOMEM_BKPT;
}else{