1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Include the SOURCE_ID value in the log messages output for corruption, misuse,

and CANTOPEN errors.

FossilOrigin-Name: 1727a81fed65bebfea43e0bda271584096d82785
This commit is contained in:
drh
2010-06-23 17:59:51 +00:00
parent bd9676c19e
commit 75e876be30
3 changed files with 18 additions and 13 deletions

View File

@@ -2099,17 +2099,22 @@ int sqlite3_get_autocommit(sqlite3 *db){
int sqlite3CorruptError(int lineno){
testcase( sqlite3GlobalConfig.xLog!=0 );
sqlite3_log(SQLITE_CORRUPT,
"database corruption found by source line %d", lineno);
"database corruption at line %d of [%.10s]",
lineno, 20+sqlite3_sourceid());
return SQLITE_CORRUPT;
}
int sqlite3MisuseError(int lineno){
testcase( sqlite3GlobalConfig.xLog!=0 );
sqlite3_log(SQLITE_MISUSE, "misuse detected by source line %d", lineno);
sqlite3_log(SQLITE_MISUSE,
"misuse at line %d of [%.10s]",
lineno, 20+sqlite3_sourceid());
return SQLITE_MISUSE;
}
int sqlite3CantopenError(int lineno){
testcase( sqlite3GlobalConfig.xLog!=0 );
sqlite3_log(SQLITE_CANTOPEN, "cannot open file at source line %d", lineno);
sqlite3_log(SQLITE_CANTOPEN,
"cannot open file at line %d of [%.10s]",
lineno, 20+sqlite3_sourceid());
return SQLITE_CANTOPEN;
}