aboutsummaryrefslogtreecommitdiff
path: root/src/trigger.c
diff options
context:
space:
mode:
authordrh <>2024-08-17 19:46:49 +0000
committerdrh <>2024-08-17 19:46:49 +0000
commit8797bd695f97db094bf10e546170d7b1e266867c (patch)
tree162455af982cbc5af4ce2a075c2de5c3c837d2ce /src/trigger.c
parent21363ac78df6751655c33372a7277512531b9570 (diff)
downloadsqlite-8797bd695f97db094bf10e546170d7b1e266867c.tar.gz
sqlite-8797bd695f97db094bf10e546170d7b1e266867c.zip
Reduce the size of the SrcItem object by combining fields into a union.
FossilOrigin-Name: a4c59ac3c6ec979c25b544d29e47b8e39f6439c098eed8f84b3bd506c9adf047
Diffstat (limited to 'src/trigger.c')
-rw-r--r--src/trigger.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/trigger.c b/src/trigger.c
index 98e8da58c..a5a57abf1 100644
--- a/src/trigger.c
+++ b/src/trigger.c
@@ -151,9 +151,9 @@ void sqlite3BeginTrigger(
** To maintain backwards compatibility, ignore the database
** name on pTableName if we are reparsing out of the schema table
*/
- if( db->init.busy && iDb!=1 ){
- sqlite3DbFree(db, pTableName->a[0].zDatabase);
- pTableName->a[0].zDatabase = 0;
+ if( db->init.busy && iDb!=1 && ALWAYS(pTableName->a[0].fg.fixedSchema==0) ){
+ sqlite3DbFree(db, pTableName->a[0].u4.zDatabase);
+ pTableName->a[0].u4.zDatabase = 0;
}
/* If the trigger name was unqualified, and the table is a temp table,
@@ -631,7 +631,8 @@ void sqlite3DropTrigger(Parse *pParse, SrcList *pName, int noErr){
}
assert( pName->nSrc==1 );
- zDb = pName->a[0].zDatabase;
+ assert( pName->a[0].fg.fixedSchema==0 );
+ zDb = pName->a[0].u4.zDatabase;
zName = pName->a[0].zName;
assert( zDb!=0 || sqlite3BtreeHoldsAllMutexes(db) );
for(i=OMIT_TEMPDB; i<db->nDb; i++){
@@ -868,7 +869,9 @@ SrcList *sqlite3TriggerStepSrc(
Schema *pSchema = pStep->pTrig->pSchema;
pSrc->a[0].zName = zName;
if( pSchema!=db->aDb[1].pSchema ){
- pSrc->a[0].pSchema = pSchema;
+ assert( pSrc->a[0].fg.fixedSchema || pSrc->a[0].u4.zDatabase==0 );
+ pSrc->a[0].u4.pSchema = pSchema;
+ pSrc->a[0].fg.fixedSchema = 1;
}
if( pStep->pFrom ){
SrcList *pDup = sqlite3SrcListDup(db, pStep->pFrom, 0);