mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Allow "main" to be used to refer to the main database even after SQLITE_DBCONFIG_MAINDBNAME has been used to assign another alias.
FossilOrigin-Name: 75c85ca32f9ae4a28fd8f8ff2f7639599413d22af706e9799a0e76cc560d14eb
This commit is contained in:
@@ -227,6 +227,9 @@ static int lookupName(
|
||||
assert( zCol ); /* The Z in X.Y.Z cannot be NULL */
|
||||
assert( !ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced) );
|
||||
|
||||
static int nCall = 0;
|
||||
nCall++;
|
||||
|
||||
/* Initialize the node to no-match */
|
||||
pExpr->iTable = -1;
|
||||
ExprSetVVAProperty(pExpr, EP_NoReduce);
|
||||
@@ -252,6 +255,12 @@ static int lookupName(
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( i==db->nDb && sqlite3StrICmp("main", zDb)==0 ){
|
||||
/* This branch is taken when the main database has been renamed
|
||||
** using SQLITE_DBCONFIG_MAINDBNAME. */
|
||||
pSchema = db->aDb[0].pSchema;
|
||||
zDb = db->aDb[0].zDbSName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user