mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
The schema name "main" is always an acceptable alias for the primary database
even if the primary database is renamed using SQLITE_DBCONFIG_MAINDBNAME. FossilOrigin-Name: 2f481b854f04bec546eb172d1b6dbc88067d3fda
This commit is contained in:
11
src/main.c
11
src/main.c
@@ -3926,15 +3926,8 @@ sqlite3_int64 sqlite3_uri_int64(
|
||||
** Return the Btree pointer identified by zDbName. Return NULL if not found.
|
||||
*/
|
||||
Btree *sqlite3DbNameToBtree(sqlite3 *db, const char *zDbName){
|
||||
int i;
|
||||
for(i=0; i<db->nDb; i++){
|
||||
if( db->aDb[i].pBt
|
||||
&& (zDbName==0 || sqlite3StrICmp(zDbName, db->aDb[i].zDbSName)==0)
|
||||
){
|
||||
return db->aDb[i].pBt;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
int iDb = zDbName ? sqlite3FindDbName(db, zDbName) : 0;
|
||||
return iDb<0 ? 0 : db->aDb[iDb].pBt;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user