diff options
author | drh <drh@noemail.net> | 2019-02-08 14:55:30 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-02-08 14:55:30 +0000 |
commit | 1cf197583de15d352dc169437f619d2e4631cf4b (patch) | |
tree | fdb5c38ef260c5263604a91f905fe51394d0148b /src/malloc.c | |
parent | 8851e10017893cfaf88acf80e223149fea1a1a37 (diff) | |
download | sqlite-1cf197583de15d352dc169437f619d2e4631cf4b.tar.gz sqlite-1cf197583de15d352dc169437f619d2e4631cf4b.zip |
Give the sqlite3 object a pointer to the current Parse so that if an OOM
occurs, it can automatically set the Parse.rc value to SQLITE_NOMEM. This
avoids a frequent extra test of db.mallocFailed in the innermost parser loop.
FossilOrigin-Name: 5c6638040b3017c6be016441422d965a3ca00dd6ae1f78cadc0b54562978f64e
Diffstat (limited to 'src/malloc.c')
-rw-r--r-- | src/malloc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/malloc.c b/src/malloc.c index d7f9df5ef..559e7259c 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -661,6 +661,9 @@ void sqlite3OomFault(sqlite3 *db){ db->u1.isInterrupted = 1; } db->lookaside.bDisable++; + if( db->pParse ){ + db->pParse->rc = SQLITE_NOMEM_BKPT; + } } } |