aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeapi.c
diff options
context:
space:
mode:
authordrh <>2023-04-28 10:23:01 +0000
committerdrh <>2023-04-28 10:23:01 +0000
commitea2529528ef9f195bbf03c980eb254581aae2bcd (patch)
tree3d72d53548fc587cbb7b42991b03fa80e6cfc3b6 /src/vdbeapi.c
parent52da6d26074a6aa3e3aed0e16b18a91b068490ca (diff)
parent90f549a0cfb94c25e2126e27ce358618e11e8bd6 (diff)
downloadsqlite-ea2529528ef9f195bbf03c980eb254581aae2bcd.tar.gz
sqlite-ea2529528ef9f195bbf03c980eb254581aae2bcd.zip
Merge all the latest trunk fixes and enhancements into the json5 branch.
FossilOrigin-Name: b5ca15cfc19380cf870b70be6a86e70f2026cc3d6d89005b45891d58c4f11c2d
Diffstat (limited to 'src/vdbeapi.c')
-rw-r--r--src/vdbeapi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vdbeapi.c b/src/vdbeapi.c
index d1e1232b1..d8fcda96d 100644
--- a/src/vdbeapi.c
+++ b/src/vdbeapi.c
@@ -1337,9 +1337,9 @@ static const void *columnName(
assert( db!=0 );
n = sqlite3_column_count(pStmt);
if( N<n && N>=0 ){
+ u8 prior_mallocFailed = db->mallocFailed;
N += useType*n;
sqlite3_mutex_enter(db->mutex);
- assert( db->mallocFailed==0 );
#ifndef SQLITE_OMIT_UTF16
if( useUtf16 ){
ret = sqlite3_value_text16((sqlite3_value*)&p->aColName[N]);
@@ -1351,7 +1351,8 @@ static const void *columnName(
/* A malloc may have failed inside of the _text() call. If this
** is the case, clear the mallocFailed flag and return NULL.
*/
- if( db->mallocFailed ){
+ assert( db->mallocFailed==0 || db->mallocFailed==1 );
+ if( db->mallocFailed > prior_mallocFailed ){
sqlite3OomClear(db);
ret = 0;
}