1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

Return a better error message when problems are encountered parsing a

TEMP trigger or TEMP view that references objects in other databases that
have been modified or dropped.  Ticket #3810. (CVS 6956)

FossilOrigin-Name: 102785b9fbc5ab5dd740110243f080e3f3661e87
This commit is contained in:
drh
2009-08-01 16:27:00 +00:00
parent a0e0d8ea98
commit 35ccb3d3bc
4 changed files with 24 additions and 17 deletions

View File

@@ -13,7 +13,7 @@
** interface, and routines that contribute to loading the database schema
** from disk.
**
** $Id: prepare.c,v 1.129 2009/07/24 17:58:53 danielk1977 Exp $
** $Id: prepare.c,v 1.130 2009/08/01 16:27:00 drh Exp $
*/
#include "sqliteInt.h"
@@ -27,13 +27,18 @@ static void corruptSchema(
const char *zExtra /* Error information */
){
sqlite3 *db = pData->db;
if( pData->iDb==1 && zObj && zExtra ){
*pData->pzErrMsg = sqlite3MPrintf(db, "in %s: %s", zObj, zExtra);
pData->rc = SQLITE_ERROR;
return;
}
if( !db->mallocFailed && (db->flags & SQLITE_RecoveryMode)==0 ){
if( zObj==0 ) zObj = "?";
sqlite3SetString(pData->pzErrMsg, pData->db,
"malformed database schema (%s)", zObj);
sqlite3SetString(pData->pzErrMsg, db,
"malformed database schema (%s)", zObj);
if( zExtra ){
*pData->pzErrMsg = sqlite3MAppendf(pData->db, *pData->pzErrMsg, "%s - %s",
*pData->pzErrMsg, zExtra);
*pData->pzErrMsg = sqlite3MAppendf(db, *pData->pzErrMsg,
"%s - %s", *pData->pzErrMsg, zExtra);
}
}
pData->rc = db->mallocFailed ? SQLITE_NOMEM : SQLITE_CORRUPT;