diff options
author | drh <> | 2023-04-22 12:37:41 +0000 |
---|---|---|
committer | drh <> | 2023-04-22 12:37:41 +0000 |
commit | fb50f96121a7b6b6a3304ac3ea6e40b260cfd124 (patch) | |
tree | 215283058e7690a3b7994ce5397c5f5271165737 /src | |
parent | bbe198676185a549eb5a05f49dd1d75df412a6ad (diff) | |
download | sqlite-fb50f96121a7b6b6a3304ac3ea6e40b260cfd124.tar.gz sqlite-fb50f96121a7b6b6a3304ac3ea6e40b260cfd124.zip |
Fix a incorrect assert() statement in the pre-update hook logic. No changes
to production code. Fix for the problem reported by
[forum:/info/19b217bfe709a072|forum post 19b217bfe709a072].
FossilOrigin-Name: 53a61f7423a7f057568a1d8a1e63be01a2328997850dc32e3d8c6d51f1c5ab0b
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbeaux.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vdbeaux.c b/src/vdbeaux.c index beb8a2f40..71813baa5 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -5354,6 +5354,9 @@ void sqlite3VdbePreUpdateHook( PreUpdate preupdate; const char *zTbl = pTab->zName; static const u8 fakeSortOrder = 0; +#ifdef SQLITE_DEBUG + int nRealCol = (pTab->tabFlags & TF_HasVirtual) ? pTab->nNVCol : pTab->nCol; +#endif assert( db->pPreUpdate==0 ); memset(&preupdate, 0, sizeof(PreUpdate)); @@ -5370,8 +5373,8 @@ void sqlite3VdbePreUpdateHook( assert( pCsr!=0 ); assert( pCsr->eCurType==CURTYPE_BTREE ); - assert( pCsr->nField==pTab->nCol - || (pCsr->nField==pTab->nCol+1 && op==SQLITE_DELETE && iReg==-1) + assert( pCsr->nField==nRealCol + || (pCsr->nField==nRealCol+1 && op==SQLITE_DELETE && iReg==-1) ); preupdate.v = v; |