Log all error messages if logging is enabled.
FossilOrigin-Name: a8076aede33c07e9a2aaa05be8a888f37b45e41c
This commit is contained in:
parent
195475d839
commit
a756466349
36
manifest
36
manifest
@ -1,5 +1,8 @@
|
||||
C Changes\sto\spragma\sintegrity_check\sto\scheck\srowid\sorder.\s\sTests\sof\ssame\sin\scorruptE.test.
|
||||
D 2010-02-19T04:28:09
|
||||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA1
|
||||
|
||||
C Log\sall\serror\smessages\sif\slogging\sis\senabled.
|
||||
D 2010-02-22T19:32:32
|
||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||
F Makefile.in c5827ead754ab32b9585487177c93bb00b9497b3
|
||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||
@ -106,13 +109,13 @@ F src/alter.c e6f4d11b1c0b23642fc46bac9abe0753c4294e05
|
||||
F src/analyze.c 55155f05ee9ab4ce33b7a4d19c449053f8935200
|
||||
F src/attach.c f6d33268019460724e4c57aeec543eaaa55d8310
|
||||
F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
|
||||
F src/backup.c 744e98359dfc79fed43e8dec911e33e108b06aae
|
||||
F src/backup.c b293534bc2df23c57668a585b17ee7faaaef0939
|
||||
F src/bitvec.c 06ad2c36a9c3819c0b9cbffec7b15f58d5d834e0
|
||||
F src/btmutex.c 96a12f50f7a17475155971a241d85ec5171573ff
|
||||
F src/btree.c b7ac4420d10662259ad3421145eab16a279f5bd3
|
||||
F src/btree.h 0e193b7e90f1d78b79c79474040e3d66a553a4fa
|
||||
F src/btreeInt.h 71ed5e7f009caf17b7dc304350b3cb64b5970135
|
||||
F src/build.c 81412e0f3cabd0cc7a71a1644c46d9ccad9613f5
|
||||
F src/build.c 254a273acb8923f3bdecc933d787f4f67737c489
|
||||
F src/callback.c 908f3e0172c3d4058f4ca0acd42c637c52e9669f
|
||||
F src/complete.c 4c8a742c4a4a6d9c835912648f5c8f032ea36c7b
|
||||
F src/date.c 485a4409a384310e6d93fd1104a9d0a8658becd9
|
||||
@ -159,15 +162,15 @@ F src/pcache.h c683390d50f856d4cd8e24342ae62027d1bb6050
|
||||
F src/pcache1.c 2bb2261190b42a348038f5b1c285c8cef415fcc8
|
||||
F src/pragma.c 5febf8b5d88cc331effb3f2e14d0473488649b1e
|
||||
F src/prepare.c d4cd38ccfb51f1424d0e61d4878a810b7e1ebb60
|
||||
F src/printf.c 35d62dffdcae3d905561fdeb78eb0f17049a103e
|
||||
F src/printf.c f5c160b471e4a4dd22b756cb4ffe0c6979fd6d24
|
||||
F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50
|
||||
F src/resolve.c 56ecd50851afa9dbcc1803ef86a9b17b3f3d3b89
|
||||
F src/resolve.c a1648d98e869937b29f4f697461fe4d60f220a7b
|
||||
F src/rowset.c 69afa95a97c524ba6faf3805e717b5b7ae85a697
|
||||
F src/select.c 0109b993c360d649857523abb72919e1794f9b45
|
||||
F src/shell.c 56521a172567f5f9f59f528599bf63380e150ac4
|
||||
F src/sqlite.h.in 7725ebcd19ea2bc3cb64631682dda9b773a31b6b
|
||||
F src/sqlite.h.in 16f33c1ceb971bfa7a04a73039947630f445146e
|
||||
F src/sqlite3ext.h 69dfb8116af51b84a029cddb3b35062354270c89
|
||||
F src/sqliteInt.h f86cce6239b02a913aad6bf8052c2541a2c0e813
|
||||
F src/sqliteInt.h d5fe1c8335b5bf376639837fa42124327cdb6767
|
||||
F src/sqliteLimit.h 3afab2291762b5d09ae20c18feb8e9fa935a60a6
|
||||
F src/status.c e651be6b30d397d86384c6867bc016e4913bcac7
|
||||
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
|
||||
@ -208,7 +211,7 @@ F src/tokenize.c e7f3606cc1b51a819a2bfee99100648d35bc791d
|
||||
F src/trigger.c 340c9eca0fb24b1197468d96ba059f867c9834c7
|
||||
F src/update.c c0dc6b75ad28b76b619042d934f337b02acee208
|
||||
F src/utf.c dad16adcc0c35ef2437dca125a4b07419d361052
|
||||
F src/util.c aa0b1da8f71edff84b4b41dbe05fe6ac75d819c6
|
||||
F src/util.c 88b16cd614f42cbbe22e48633f220506e38fa654
|
||||
F src/vacuum.c 28ee5a4963d16cf2477075d85966c0f461cd79de
|
||||
F src/vdbe.c 428411c6fbd49e9a4ce043dad87a0b079d403714
|
||||
F src/vdbe.h bea1f0cd530775bdb58a340265f3cf3ee920e9b2
|
||||
@ -790,7 +793,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
||||
P 103321e37ae46eacfad4e127d13477ad5dd02bab
|
||||
R becff0b48e882ac8f957bf23a46ac2b6
|
||||
U shaneh
|
||||
Z 75f7bf2a2627891ab273971d988089a2
|
||||
P cae47c5b09cb122689bcb020a66ce14982cc4aa8
|
||||
R d7121689968b9a49bfb3b115f6caae1f
|
||||
U drh
|
||||
Z 756dc0e686614f50b3726f7d79fbf33e
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v1.4.6 (GNU/Linux)
|
||||
|
||||
iD8DBQFLgtvToxKgR168RlERAgD+AJ9pel9BuoeQ60Zg2RwC7UUcyLa15QCgjQyw
|
||||
eVPi7VygVLOyvzAZ+LPjDAY=
|
||||
=r/gG
|
||||
-----END PGP SIGNATURE-----
|
||||
|
@ -1 +1 @@
|
||||
cae47c5b09cb122689bcb020a66ce14982cc4aa8
|
||||
a8076aede33c07e9a2aaa05be8a888f37b45e41c
|
@ -98,10 +98,10 @@ static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){
|
||||
}else{
|
||||
pParse->db = pDb;
|
||||
if( sqlite3OpenTempDatabase(pParse) ){
|
||||
sqlite3ErrorClear(pParse);
|
||||
sqlite3Error(pErrorDb, pParse->rc, "%s", pParse->zErrMsg);
|
||||
rc = SQLITE_ERROR;
|
||||
}
|
||||
sqlite3DbFree(pErrorDb, pParse->zErrMsg);
|
||||
sqlite3StackFree(pErrorDb, pParse);
|
||||
}
|
||||
if( rc ){
|
||||
|
@ -1974,13 +1974,12 @@ void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, int noErr){
|
||||
}
|
||||
assert( pParse->nErr==0 );
|
||||
assert( pName->nSrc==1 );
|
||||
if( noErr ) db->suppressErr++;
|
||||
pTab = sqlite3LocateTable(pParse, isView,
|
||||
pName->a[0].zName, pName->a[0].zDatabase);
|
||||
if( noErr ) db->suppressErr--;
|
||||
|
||||
if( pTab==0 ){
|
||||
if( noErr ){
|
||||
sqlite3ErrorClear(pParse);
|
||||
}
|
||||
goto exit_drop_table;
|
||||
}
|
||||
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
|
||||
|
@ -942,21 +942,21 @@ char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
|
||||
/*
|
||||
** Format and write a message to the log if logging is enabled.
|
||||
*/
|
||||
void sqlite3_log(int iPriority, const char *zFormat, ...){
|
||||
void sqlite3_log(int iErrCode, const char *zFormat, ...){
|
||||
void (*xLog)(void*, int, const char*); /* The global logger function */
|
||||
void *pLogArg; /* First argument to the logger */
|
||||
va_list ap; /* Vararg list */
|
||||
char *zMsg; /* Complete log message */
|
||||
|
||||
xLog = sqlite3GlobalConfig.xLog;
|
||||
if( xLog ){
|
||||
if( xLog && zFormat ){
|
||||
va_start(ap, zFormat);
|
||||
sqlite3BeginBenignMalloc();
|
||||
zMsg = sqlite3_vmprintf(zFormat, ap);
|
||||
sqlite3EndBenignMalloc();
|
||||
va_end(ap);
|
||||
pLogArg = sqlite3GlobalConfig.pLogArg;
|
||||
xLog(pLogArg, iPriority, zMsg ? zMsg : zFormat);
|
||||
xLog(pLogArg, iErrCode, zMsg ? zMsg : zFormat);
|
||||
sqlite3_free(zMsg);
|
||||
}
|
||||
}
|
||||
|
@ -664,6 +664,9 @@ static int resolveOrderByTermToExprList(
|
||||
int i; /* Loop counter */
|
||||
ExprList *pEList; /* The columns of the result set */
|
||||
NameContext nc; /* Name context for resolving pE */
|
||||
sqlite3 *db; /* Database connection */
|
||||
int rc; /* Return code from subprocedures */
|
||||
u8 savedSuppErr; /* Saved value of db->suppressErr */
|
||||
|
||||
assert( sqlite3ExprIsInteger(pE, &i)==0 );
|
||||
pEList = pSelect->pEList;
|
||||
@ -676,10 +679,12 @@ static int resolveOrderByTermToExprList(
|
||||
nc.pEList = pEList;
|
||||
nc.allowAgg = 1;
|
||||
nc.nErr = 0;
|
||||
if( sqlite3ResolveExprNames(&nc, pE) ){
|
||||
sqlite3ErrorClear(pParse);
|
||||
return 0;
|
||||
}
|
||||
db = pParse->db;
|
||||
savedSuppErr = db->suppressErr;
|
||||
db->suppressErr = 1;
|
||||
rc = sqlite3ResolveExprNames(&nc, pE);
|
||||
db->suppressErr = savedSuppErr;
|
||||
if( rc ) return 0;
|
||||
|
||||
/* Try to match the ORDER BY expression against an expression
|
||||
** in the result set. Return an 1-based index of the matching
|
||||
|
@ -3657,7 +3657,7 @@ int sqlite3_collation_needed16(
|
||||
void(*)(void*,sqlite3*,int eTextRep,const void*)
|
||||
);
|
||||
|
||||
#if SQLITE_HAS_CODEC
|
||||
#if SQLITE_HAS_CODEC
|
||||
/*
|
||||
** Specify the key for an encrypted database. This routine should be
|
||||
** called right after sqlite3_open().
|
||||
@ -3687,19 +3687,19 @@ int sqlite3_rekey(
|
||||
** Specify the activation key for a SEE database. Unless
|
||||
** activated, none of the SEE routines will work.
|
||||
*/
|
||||
void sqlite3_activate_see(
|
||||
const char *zPassPhrase /* Activation phrase */
|
||||
);
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_ENABLE_CEROD
|
||||
void sqlite3_activate_see(
|
||||
const char *zPassPhrase /* Activation phrase */
|
||||
);
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_ENABLE_CEROD
|
||||
/*
|
||||
** Specify the activation key for a CEROD database. Unless
|
||||
** activated, none of the CEROD routines will work.
|
||||
*/
|
||||
void sqlite3_activate_cerod(
|
||||
const char *zPassPhrase /* Activation phrase */
|
||||
);
|
||||
void sqlite3_activate_cerod(
|
||||
const char *zPassPhrase /* Activation phrase */
|
||||
);
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -5675,7 +5675,7 @@ int sqlite3_strnicmp(const char *, const char *, int);
|
||||
** nothing to prevent an application from calling sqlite3_log(), doing so
|
||||
** is considered bad form.
|
||||
*/
|
||||
void sqlite3_log(int iPriority, const char *zFormat, ...);
|
||||
void sqlite3_log(int iErrCode, const char *zFormat, ...);
|
||||
|
||||
/*
|
||||
** Undo the hack that converts floating point types to integer for
|
||||
|
@ -794,6 +794,7 @@ struct sqlite3 {
|
||||
u8 dfltLockMode; /* Default locking-mode for attached dbs */
|
||||
u8 dfltJournalMode; /* Default journal mode for attached dbs */
|
||||
signed char nextAutovac; /* Autovac setting after VACUUM if >=0 */
|
||||
u8 suppressErr; /* Do not issue error messages if true */
|
||||
int nextPagesize; /* Pagesize after VACUUM if >0 */
|
||||
int nTable; /* Number of tables in the database */
|
||||
CollSeq *pDfltColl; /* The default collating sequence (BINARY) */
|
||||
@ -2554,7 +2555,6 @@ char *sqlite3MAppendf(sqlite3*,char*,const char*,...);
|
||||
#endif
|
||||
void sqlite3SetString(char **, sqlite3*, const char*, ...);
|
||||
void sqlite3ErrorMsg(Parse*, const char*, ...);
|
||||
void sqlite3ErrorClear(Parse*);
|
||||
int sqlite3Dequote(char*);
|
||||
int sqlite3KeywordCode(const unsigned char*, int);
|
||||
int sqlite3RunParser(Parse*, const char*, char **);
|
||||
|
25
src/util.c
25
src/util.c
@ -123,6 +123,7 @@ void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat, ...){
|
||||
va_start(ap, zFormat);
|
||||
z = sqlite3VMPrintf(db, zFormat, ap);
|
||||
va_end(ap);
|
||||
sqlite3_log(err_code, z);
|
||||
sqlite3ValueSetStr(db->pErr, -1, z, SQLITE_UTF8, SQLITE_DYNAMIC);
|
||||
}else{
|
||||
sqlite3ValueSetStr(db->pErr, 0, 0, SQLITE_UTF8, SQLITE_STATIC);
|
||||
@ -148,23 +149,21 @@ void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat, ...){
|
||||
** (sqlite3_step() etc.).
|
||||
*/
|
||||
void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){
|
||||
char *zMsg;
|
||||
va_list ap;
|
||||
sqlite3 *db = pParse->db;
|
||||
pParse->nErr++;
|
||||
sqlite3DbFree(db, pParse->zErrMsg);
|
||||
va_start(ap, zFormat);
|
||||
pParse->zErrMsg = sqlite3VMPrintf(db, zFormat, ap);
|
||||
zMsg = sqlite3VMPrintf(db, zFormat, ap);
|
||||
va_end(ap);
|
||||
pParse->rc = SQLITE_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
** Clear the error message in pParse, if any
|
||||
*/
|
||||
void sqlite3ErrorClear(Parse *pParse){
|
||||
sqlite3DbFree(pParse->db, pParse->zErrMsg);
|
||||
pParse->zErrMsg = 0;
|
||||
pParse->nErr = 0;
|
||||
if( db->suppressErr ){
|
||||
sqlite3DbFree(db, zMsg);
|
||||
}else{
|
||||
pParse->nErr++;
|
||||
sqlite3DbFree(db, pParse->zErrMsg);
|
||||
pParse->zErrMsg = zMsg;
|
||||
pParse->rc = SQLITE_ERROR;
|
||||
sqlite3_log(SQLITE_ERROR, pParse->zErrMsg);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user