aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeaux.c
diff options
context:
space:
mode:
authordan <Dan Kennedy>2024-09-18 15:02:27 +0000
committerdan <Dan Kennedy>2024-09-18 15:02:27 +0000
commit38b31a93b3ded0cc39eae8a8c07005606d129434 (patch)
tree45fdc23ec34d895db10757f73dc6359a5021fc43 /src/vdbeaux.c
parenteaa50b866075f4c1a19065600e4f1bae059eb505 (diff)
downloadsqlite-38b31a93b3ded0cc39eae8a8c07005606d129434.tar.gz
sqlite-38b31a93b3ded0cc39eae8a8c07005606d129434.zip
Fix the preupdate hook so that it works when the "old.*" row has a column with a non-NULL default value that was added by ALTER TABLE ADD COLUMN after the current record was created.
FossilOrigin-Name: 00a398cf900179aa5a8aab09fe4a671d99e7a31583282848ef39390f2ef246eb
Diffstat (limited to 'src/vdbeaux.c')
-rw-r--r--src/vdbeaux.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index f1e0cccdc..a66bdecff 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -5543,5 +5543,12 @@ void sqlite3VdbePreUpdateHook(
}
sqlite3DbNNFreeNN(db, preupdate.aNew);
}
+ if( preupdate.apDflt ){
+ int i;
+ for(i=0; i<pTab->nCol; i++){
+ sqlite3ValueFree(preupdate.apDflt[i]);
+ }
+ sqlite3DbFree(db, preupdate.apDflt);
+ }
}
#endif /* SQLITE_ENABLE_PREUPDATE_HOOK */