1
0
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:
drh
2016-12-24 19:37:16 +00:00
parent b20a61b704
commit 2951809ed4
4 changed files with 14 additions and 18 deletions

View File

@@ -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;
}
/*