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

Minor simplification of schema error reporting.

FossilOrigin-Name: a8846aeed9992c6c9f1c8bd6e996a4cbe891751e
This commit is contained in:
drh
2016-02-05 02:50:11 +00:00
parent b84e574c89
commit 17a936f84a
3 changed files with 9 additions and 10 deletions

View File

@@ -28,11 +28,10 @@ static void corruptSchema(
if( !db->mallocFailed && (db->flags & SQLITE_RecoveryMode)==0 ){
char *z;
if( zObj==0 ) zObj = "?";
z = sqlite3_mprintf("malformed database schema (%s)", zObj);
if( z && zExtra ) z = sqlite3_mprintf("%z - %s", z, zExtra);
z = sqlite3MPrintf(db, "malformed database schema (%s)", zObj);
if( zExtra ) z = sqlite3MPrintf(db, "%z - %s", z, zExtra);
sqlite3DbFree(db, *pData->pzErrMsg);
*pData->pzErrMsg = z;
if( z==0 ) sqlite3OomFault(db);
}
pData->rc = db->mallocFailed ? SQLITE_NOMEM : SQLITE_CORRUPT_BKPT;
}