1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-21 13:38:01 +03:00

Reduce the size of the SrcItem object by combining fields into a union.

FossilOrigin-Name: a4c59ac3c6ec979c25b544d29e47b8e39f6439c098eed8f84b3bd506c9adf047
This commit is contained in:
drh
2024-08-17 19:46:49 +00:00
parent 21363ac78d
commit 8797bd695f
13 changed files with 92 additions and 59 deletions

View File

@@ -480,19 +480,20 @@ static int fixSelectCb(Walker *p, Select *pSelect){
if( NEVER(pList==0) ) return WRC_Continue;
for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){
if( pFix->bTemp==0 ){
if( pItem->zDatabase ){
if( iDb!=sqlite3FindDbName(db, pItem->zDatabase) ){
if( pItem->fg.fixedSchema==0 && pItem->u4.zDatabase!=0 ){
if( iDb!=sqlite3FindDbName(db, pItem->u4.zDatabase) ){
sqlite3ErrorMsg(pFix->pParse,
"%s %T cannot reference objects in database %s",
pFix->zType, pFix->pName, pItem->zDatabase);
pFix->zType, pFix->pName, pItem->u4.zDatabase);
return WRC_Abort;
}
sqlite3DbFree(db, pItem->zDatabase);
pItem->zDatabase = 0;
sqlite3DbFree(db, pItem->u4.zDatabase);
pItem->fg.notCte = 1;
pItem->fg.hadSchema = 1;
}
pItem->pSchema = pFix->pSchema;
pItem->u4.pSchema = pFix->pSchema;
pItem->fg.fromDDL = 1;
pItem->fg.fixedSchema = 1;
}
#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_TRIGGER)
if( pList->a[i].fg.isUsing==0