Additional testing of the ATTACH command with bug fixes for the new problems
that the tests found. (CVS 998) FossilOrigin-Name: 3e8889d7ce5e99fc855526fc1bb62ddbe282bfc5
This commit is contained in:
+5
-3
@@ -11,7 +11,7 @@
|
||||
*************************************************************************
|
||||
** This file contains code used to implement the ATTACH and DETACH commands.
|
||||
**
|
||||
** $Id: attach.c,v 1.4 2003/05/31 16:21:12 drh Exp $
|
||||
** $Id: attach.c,v 1.5 2003/06/03 01:47:11 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -148,6 +148,7 @@ int sqliteFixInit(
|
||||
if( iDb<0 || iDb==1 ) return 0;
|
||||
db = pParse->db;
|
||||
assert( db->nDb>iDb );
|
||||
pFix->pParse = pParse;
|
||||
pFix->zDb = db->aDb[iDb].zName;
|
||||
pFix->zType = zType;
|
||||
pFix->pName = pName;
|
||||
@@ -182,8 +183,9 @@ int sqliteFixSrcList(
|
||||
pList->a[i].zDatabase = sqliteStrDup(zDb);
|
||||
}else if( sqliteStrICmp(pList->a[i].zDatabase,zDb)!=0 ){
|
||||
sqliteErrorMsg(pFix->pParse,
|
||||
"%s %.*s cannot reference objects in database %s",
|
||||
pFix->zType, pFix->pName->n, pFix->pName->z, pList->a[i].zDatabase);
|
||||
"%s %z cannot reference objects in database %s",
|
||||
pFix->zType, sqliteStrNDup(pFix->pName->z, pFix->pName->n),
|
||||
pList->a[i].zDatabase);
|
||||
return 1;
|
||||
}
|
||||
if( sqliteFixSelect(pFix, pList->a[i].pSelect) ) return 1;
|
||||
|
||||
Reference in New Issue
Block a user