mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-21 09:00:59 +03:00
Split the sqlite3Error() routine into sqlite3Error() and
sqlite3ErrorWithMsg(), for a slight size reduction and performance increase. FossilOrigin-Name: cf561d1f0bb60b3d638632d20bd686dda4fa4a04
This commit is contained in:
12
src/backup.c
12
src/backup.c
@@ -87,12 +87,12 @@ static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){
|
||||
int rc = 0;
|
||||
pParse = sqlite3StackAllocZero(pErrorDb, sizeof(*pParse));
|
||||
if( pParse==0 ){
|
||||
sqlite3Error(pErrorDb, SQLITE_NOMEM, "out of memory");
|
||||
sqlite3ErrorWithMsg(pErrorDb, SQLITE_NOMEM, "out of memory");
|
||||
rc = SQLITE_NOMEM;
|
||||
}else{
|
||||
pParse->db = pDb;
|
||||
if( sqlite3OpenTempDatabase(pParse) ){
|
||||
sqlite3Error(pErrorDb, pParse->rc, "%s", pParse->zErrMsg);
|
||||
sqlite3ErrorWithMsg(pErrorDb, pParse->rc, "%s", pParse->zErrMsg);
|
||||
rc = SQLITE_ERROR;
|
||||
}
|
||||
sqlite3DbFree(pErrorDb, pParse->zErrMsg);
|
||||
@@ -105,7 +105,7 @@ static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){
|
||||
}
|
||||
|
||||
if( i<0 ){
|
||||
sqlite3Error(pErrorDb, SQLITE_ERROR, "unknown database %s", zDb);
|
||||
sqlite3ErrorWithMsg(pErrorDb, SQLITE_ERROR, "unknown database %s", zDb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ sqlite3_backup *sqlite3_backup_init(
|
||||
sqlite3_mutex_enter(pDestDb->mutex);
|
||||
|
||||
if( pSrcDb==pDestDb ){
|
||||
sqlite3Error(
|
||||
sqlite3ErrorWithMsg(
|
||||
pDestDb, SQLITE_ERROR, "source and destination must be distinct"
|
||||
);
|
||||
p = 0;
|
||||
@@ -161,7 +161,7 @@ sqlite3_backup *sqlite3_backup_init(
|
||||
** sqlite3_backup_finish(). */
|
||||
p = (sqlite3_backup *)sqlite3MallocZero(sizeof(sqlite3_backup));
|
||||
if( !p ){
|
||||
sqlite3Error(pDestDb, SQLITE_NOMEM, 0);
|
||||
sqlite3Error(pDestDb, SQLITE_NOMEM);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -602,7 +602,7 @@ int sqlite3_backup_finish(sqlite3_backup *p){
|
||||
/* Set the error code of the destination database handle. */
|
||||
rc = (p->rc==SQLITE_DONE) ? SQLITE_OK : p->rc;
|
||||
if( p->pDestDb ){
|
||||
sqlite3Error(p->pDestDb, rc, 0);
|
||||
sqlite3Error(p->pDestDb, rc);
|
||||
|
||||
/* Exit the mutexes and free the backup context structure. */
|
||||
sqlite3LeaveMutexAndCloseZombie(p->pDestDb);
|
||||
|
||||
@@ -44,7 +44,7 @@ int sqlite3_exec(
|
||||
if( zSql==0 ) zSql = "";
|
||||
|
||||
sqlite3_mutex_enter(db->mutex);
|
||||
sqlite3Error(db, SQLITE_OK, 0);
|
||||
sqlite3Error(db, SQLITE_OK);
|
||||
while( rc==SQLITE_OK && zSql[0] ){
|
||||
int nCol;
|
||||
char **azVals = 0;
|
||||
@@ -102,7 +102,7 @@ int sqlite3_exec(
|
||||
rc = SQLITE_ABORT;
|
||||
sqlite3VdbeFinalize((Vdbe *)pStmt);
|
||||
pStmt = 0;
|
||||
sqlite3Error(db, SQLITE_ABORT, 0);
|
||||
sqlite3Error(db, SQLITE_ABORT);
|
||||
goto exec_out;
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ exec_out:
|
||||
memcpy(*pzErrMsg, sqlite3_errmsg(db), nErrMsg);
|
||||
}else{
|
||||
rc = SQLITE_NOMEM;
|
||||
sqlite3Error(db, SQLITE_NOMEM, 0);
|
||||
sqlite3Error(db, SQLITE_NOMEM);
|
||||
}
|
||||
}else if( pzErrMsg ){
|
||||
*pzErrMsg = 0;
|
||||
|
||||
@@ -749,7 +749,7 @@ void sqlite3AutoLoadExtensions(sqlite3 *db){
|
||||
sqlite3_mutex_leave(mutex);
|
||||
zErrmsg = 0;
|
||||
if( xInit && (rc = xInit(db, &zErrmsg, &sqlite3Apis))!=0 ){
|
||||
sqlite3Error(db, rc,
|
||||
sqlite3ErrorWithMsg(db, rc,
|
||||
"automatic extension loading failed: %s", zErrmsg);
|
||||
go = 0;
|
||||
}
|
||||
|
||||
26
src/main.c
26
src/main.c
@@ -852,7 +852,7 @@ static int sqlite3Close(sqlite3 *db, int forceZombie){
|
||||
** SQLITE_BUSY if the connection can not be closed immediately.
|
||||
*/
|
||||
if( !forceZombie && connectionIsBusy(db) ){
|
||||
sqlite3Error(db, SQLITE_BUSY, "unable to close due to unfinalized "
|
||||
sqlite3ErrorWithMsg(db, SQLITE_BUSY, "unable to close due to unfinalized "
|
||||
"statements or unfinished backups");
|
||||
sqlite3_mutex_leave(db->mutex);
|
||||
return SQLITE_BUSY;
|
||||
@@ -982,7 +982,7 @@ void sqlite3LeaveMutexAndCloseZombie(sqlite3 *db){
|
||||
sqlite3HashClear(&db->aModule);
|
||||
#endif
|
||||
|
||||
sqlite3Error(db, SQLITE_OK, 0); /* Deallocates any cached error strings. */
|
||||
sqlite3Error(db, SQLITE_OK); /* Deallocates any cached error strings. */
|
||||
sqlite3ValueFree(db->pErr);
|
||||
sqlite3CloseExtensions(db);
|
||||
|
||||
@@ -1415,7 +1415,7 @@ int sqlite3CreateFunc(
|
||||
p = sqlite3FindFunction(db, zFunctionName, nName, nArg, (u8)enc, 0);
|
||||
if( p && (p->funcFlags & SQLITE_FUNC_ENCMASK)==enc && p->nArg==nArg ){
|
||||
if( db->nVdbeActive ){
|
||||
sqlite3Error(db, SQLITE_BUSY,
|
||||
sqlite3ErrorWithMsg(db, SQLITE_BUSY,
|
||||
"unable to delete/modify user-function due to active statements");
|
||||
assert( !db->mallocFailed );
|
||||
return SQLITE_BUSY;
|
||||
@@ -1753,10 +1753,10 @@ int sqlite3_wal_checkpoint_v2(
|
||||
}
|
||||
if( iDb<0 ){
|
||||
rc = SQLITE_ERROR;
|
||||
sqlite3Error(db, SQLITE_ERROR, "unknown database: %s", zDb);
|
||||
sqlite3ErrorWithMsg(db, SQLITE_ERROR, "unknown database: %s", zDb);
|
||||
}else{
|
||||
rc = sqlite3Checkpoint(db, iDb, eMode, pnLog, pnCkpt);
|
||||
sqlite3Error(db, rc, 0);
|
||||
sqlite3Error(db, rc);
|
||||
}
|
||||
rc = sqlite3ApiExit(db, rc);
|
||||
sqlite3_mutex_leave(db->mutex);
|
||||
@@ -1911,7 +1911,7 @@ const void *sqlite3_errmsg16(sqlite3 *db){
|
||||
}else{
|
||||
z = sqlite3_value_text16(db->pErr);
|
||||
if( z==0 ){
|
||||
sqlite3Error(db, db->errCode, sqlite3ErrStr(db->errCode));
|
||||
sqlite3ErrorWithMsg(db, db->errCode, sqlite3ErrStr(db->errCode));
|
||||
z = sqlite3_value_text16(db->pErr);
|
||||
}
|
||||
/* A malloc() may have failed within the call to sqlite3_value_text16()
|
||||
@@ -2022,7 +2022,7 @@ static int createCollation(
|
||||
pColl = sqlite3FindCollSeq(db, (u8)enc2, zName, 0);
|
||||
if( pColl && pColl->xCmp ){
|
||||
if( db->nVdbeActive ){
|
||||
sqlite3Error(db, SQLITE_BUSY,
|
||||
sqlite3ErrorWithMsg(db, SQLITE_BUSY,
|
||||
"unable to delete/modify collation sequence due to active statements");
|
||||
return SQLITE_BUSY;
|
||||
}
|
||||
@@ -2056,7 +2056,7 @@ static int createCollation(
|
||||
pColl->pUser = pCtx;
|
||||
pColl->xDel = xDel;
|
||||
pColl->enc = (u8)(enc2 | (enc & SQLITE_UTF16_ALIGNED));
|
||||
sqlite3Error(db, SQLITE_OK, 0);
|
||||
sqlite3Error(db, SQLITE_OK);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
@@ -2541,7 +2541,7 @@ static int openDatabase(
|
||||
rc = sqlite3ParseUri(zVfs, zFilename, &flags, &db->pVfs, &zOpen, &zErrMsg);
|
||||
if( rc!=SQLITE_OK ){
|
||||
if( rc==SQLITE_NOMEM ) db->mallocFailed = 1;
|
||||
sqlite3Error(db, rc, zErrMsg ? "%s" : 0, zErrMsg);
|
||||
sqlite3ErrorWithMsg(db, rc, zErrMsg ? "%s" : 0, zErrMsg);
|
||||
sqlite3_free(zErrMsg);
|
||||
goto opendb_out;
|
||||
}
|
||||
@@ -2553,7 +2553,7 @@ static int openDatabase(
|
||||
if( rc==SQLITE_IOERR_NOMEM ){
|
||||
rc = SQLITE_NOMEM;
|
||||
}
|
||||
sqlite3Error(db, rc, 0);
|
||||
sqlite3Error(db, rc);
|
||||
goto opendb_out;
|
||||
}
|
||||
db->aDb[0].pSchema = sqlite3SchemaGet(db, db->aDb[0].pBt);
|
||||
@@ -2577,7 +2577,7 @@ static int openDatabase(
|
||||
** database schema yet. This is delayed until the first time the database
|
||||
** is accessed.
|
||||
*/
|
||||
sqlite3Error(db, SQLITE_OK, 0);
|
||||
sqlite3Error(db, SQLITE_OK);
|
||||
sqlite3RegisterBuiltinFunctions(db);
|
||||
|
||||
/* Load automatic extensions - extensions that have been registered
|
||||
@@ -2634,7 +2634,7 @@ static int openDatabase(
|
||||
SQLITE_DEFAULT_LOCKING_MODE);
|
||||
#endif
|
||||
|
||||
if( rc ) sqlite3Error(db, rc, 0);
|
||||
if( rc ) sqlite3Error(db, rc);
|
||||
|
||||
/* Enable the lookaside-malloc subsystem */
|
||||
setupLookaside(db, 0, sqlite3GlobalConfig.szLookaside,
|
||||
@@ -2996,7 +2996,7 @@ error_out:
|
||||
zColumnName);
|
||||
rc = SQLITE_ERROR;
|
||||
}
|
||||
sqlite3Error(db, rc, (zErrMsg?"%s":0), zErrMsg);
|
||||
sqlite3ErrorWithMsg(db, rc, (zErrMsg?"%s":0), zErrMsg);
|
||||
sqlite3DbFree(db, zErrMsg);
|
||||
rc = sqlite3ApiExit(db, rc);
|
||||
sqlite3_mutex_leave(db->mutex);
|
||||
|
||||
@@ -776,7 +776,7 @@ int sqlite3ApiExit(sqlite3* db, int rc){
|
||||
*/
|
||||
assert( !db || sqlite3_mutex_held(db->mutex) );
|
||||
if( db && (db->mallocFailed || rc==SQLITE_IOERR_NOMEM) ){
|
||||
sqlite3Error(db, SQLITE_NOMEM, 0);
|
||||
sqlite3Error(db, SQLITE_NOMEM);
|
||||
db->mallocFailed = 0;
|
||||
rc = SQLITE_NOMEM;
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ int sqlite3_unlock_notify(
|
||||
|
||||
leaveMutex();
|
||||
assert( !db->mallocFailed );
|
||||
sqlite3Error(db, rc, (rc?"database is deadlocked":0));
|
||||
sqlite3ErrorWithMsg(db, rc, (rc?"database is deadlocked":0));
|
||||
sqlite3_mutex_leave(db->mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -593,7 +593,7 @@ static int sqlite3Prepare(
|
||||
rc = sqlite3BtreeSchemaLocked(pBt);
|
||||
if( rc ){
|
||||
const char *zDb = db->aDb[i].zName;
|
||||
sqlite3Error(db, rc, "database schema is locked: %s", zDb);
|
||||
sqlite3ErrorWithMsg(db, rc, "database schema is locked: %s", zDb);
|
||||
testcase( db->flags & SQLITE_ReadUncommitted );
|
||||
goto end_prepare;
|
||||
}
|
||||
@@ -610,7 +610,7 @@ static int sqlite3Prepare(
|
||||
testcase( nBytes==mxLen );
|
||||
testcase( nBytes==mxLen+1 );
|
||||
if( nBytes>mxLen ){
|
||||
sqlite3Error(db, SQLITE_TOOBIG, "statement too long");
|
||||
sqlite3ErrorWithMsg(db, SQLITE_TOOBIG, "statement too long");
|
||||
rc = sqlite3ApiExit(db, SQLITE_TOOBIG);
|
||||
goto end_prepare;
|
||||
}
|
||||
@@ -677,10 +677,10 @@ static int sqlite3Prepare(
|
||||
}
|
||||
|
||||
if( zErrMsg ){
|
||||
sqlite3Error(db, rc, "%s", zErrMsg);
|
||||
sqlite3ErrorWithMsg(db, rc, "%s", zErrMsg);
|
||||
sqlite3DbFree(db, zErrMsg);
|
||||
}else{
|
||||
sqlite3Error(db, rc, 0);
|
||||
sqlite3Error(db, rc);
|
||||
}
|
||||
|
||||
/* Delete any TriggerPrg structures allocated while parsing this statement. */
|
||||
|
||||
@@ -3350,7 +3350,8 @@ int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity);
|
||||
char sqlite3ExprAffinity(Expr *pExpr);
|
||||
int sqlite3Atoi64(const char*, i64*, int, u8);
|
||||
int sqlite3DecOrHexToI64(const char*, i64*);
|
||||
void sqlite3Error(sqlite3*, int, const char*,...);
|
||||
void sqlite3ErrorWithMsg(sqlite3*, int, const char*,...);
|
||||
void sqlite3Error(sqlite3*,int);
|
||||
void *sqlite3HexToBlob(sqlite3*, const char *z, int n);
|
||||
u8 sqlite3HexToInt(int h);
|
||||
int sqlite3TwoPartName(Parse *, Token *, Token *, Token **);
|
||||
|
||||
23
src/util.c
23
src/util.c
@@ -111,6 +111,15 @@ int sqlite3Strlen30(const char *z){
|
||||
return 0x3fffffff & (int)(z2 - z);
|
||||
}
|
||||
|
||||
/*
|
||||
** Set the current error code to err_code and clear any prior error message.
|
||||
*/
|
||||
void sqlite3Error(sqlite3 *db, int err_code){
|
||||
assert( db!=0 );
|
||||
db->errCode = err_code;
|
||||
if( db->pErr ) sqlite3ValueSetNull(db->pErr);
|
||||
}
|
||||
|
||||
/*
|
||||
** Set the most recent error code and error string for the sqlite
|
||||
** handle "db". The error code is set to "err_code".
|
||||
@@ -132,18 +141,18 @@ int sqlite3Strlen30(const char *z){
|
||||
** should be called with err_code set to SQLITE_OK and zFormat set
|
||||
** to NULL.
|
||||
*/
|
||||
void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat, ...){
|
||||
void sqlite3ErrorWithMsg(sqlite3 *db, int err_code, const char *zFormat, ...){
|
||||
assert( db!=0 );
|
||||
db->errCode = err_code;
|
||||
if( zFormat && (db->pErr || (db->pErr = sqlite3ValueNew(db))!=0) ){
|
||||
if( zFormat==0 ){
|
||||
sqlite3Error(db, err_code);
|
||||
}else if( db->pErr || (db->pErr = sqlite3ValueNew(db))!=0 ){
|
||||
char *z;
|
||||
va_list ap;
|
||||
va_start(ap, zFormat);
|
||||
z = sqlite3VMPrintf(db, zFormat, ap);
|
||||
va_end(ap);
|
||||
sqlite3ValueSetStr(db->pErr, -1, z, SQLITE_UTF8, SQLITE_DYNAMIC);
|
||||
}else if( db->pErr ){
|
||||
sqlite3ValueSetNull(db->pErr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,12 +166,12 @@ void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat, ...){
|
||||
** %T Insert a token
|
||||
** %S Insert the first element of a SrcList
|
||||
**
|
||||
** This function should be used to report any error that occurs whilst
|
||||
** This function should be used to report any error that occurs while
|
||||
** compiling an SQL statement (i.e. within sqlite3_prepare()). The
|
||||
** last thing the sqlite3_prepare() function does is copy the error
|
||||
** stored by this function into the database handle using sqlite3Error().
|
||||
** Function sqlite3Error() should be used during statement execution
|
||||
** (sqlite3_step() etc.).
|
||||
** Functions sqlite3Error() or sqlite3ErrorWithMsg() should be used
|
||||
** during statement execution (sqlite3_step() etc.).
|
||||
*/
|
||||
void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){
|
||||
char *zMsg;
|
||||
|
||||
@@ -770,7 +770,7 @@ static Mem *columnMem(sqlite3_stmt *pStmt, int i){
|
||||
}else{
|
||||
if( pVm && ALWAYS(pVm->db) ){
|
||||
sqlite3_mutex_enter(pVm->db->mutex);
|
||||
sqlite3Error(pVm->db, SQLITE_RANGE, 0);
|
||||
sqlite3Error(pVm->db, SQLITE_RANGE);
|
||||
}
|
||||
pOut = (Mem*)columnNullValue();
|
||||
}
|
||||
@@ -1035,14 +1035,14 @@ static int vdbeUnbind(Vdbe *p, int i){
|
||||
}
|
||||
sqlite3_mutex_enter(p->db->mutex);
|
||||
if( p->magic!=VDBE_MAGIC_RUN || p->pc>=0 ){
|
||||
sqlite3Error(p->db, SQLITE_MISUSE, 0);
|
||||
sqlite3Error(p->db, SQLITE_MISUSE);
|
||||
sqlite3_mutex_leave(p->db->mutex);
|
||||
sqlite3_log(SQLITE_MISUSE,
|
||||
"bind on a busy prepared statement: [%s]", p->zSql);
|
||||
return SQLITE_MISUSE_BKPT;
|
||||
}
|
||||
if( i<1 || i>p->nVar ){
|
||||
sqlite3Error(p->db, SQLITE_RANGE, 0);
|
||||
sqlite3Error(p->db, SQLITE_RANGE);
|
||||
sqlite3_mutex_leave(p->db->mutex);
|
||||
return SQLITE_RANGE;
|
||||
}
|
||||
@@ -1050,7 +1050,7 @@ static int vdbeUnbind(Vdbe *p, int i){
|
||||
pVar = &p->aVar[i];
|
||||
sqlite3VdbeMemRelease(pVar);
|
||||
pVar->flags = MEM_Null;
|
||||
sqlite3Error(p->db, SQLITE_OK, 0);
|
||||
sqlite3Error(p->db, SQLITE_OK);
|
||||
|
||||
/* If the bit corresponding to this variable in Vdbe.expmask is set, then
|
||||
** binding a new value to this variable invalidates the current query plan.
|
||||
@@ -1092,7 +1092,7 @@ static int bindText(
|
||||
if( rc==SQLITE_OK && encoding!=0 ){
|
||||
rc = sqlite3VdbeChangeEncoding(pVar, ENC(p->db));
|
||||
}
|
||||
sqlite3Error(p->db, rc, 0);
|
||||
sqlite3Error(p->db, rc);
|
||||
rc = sqlite3ApiExit(p->db, rc);
|
||||
}
|
||||
sqlite3_mutex_leave(p->db->mutex);
|
||||
|
||||
@@ -2497,7 +2497,7 @@ int sqlite3VdbeTransferError(Vdbe *p){
|
||||
db->mallocFailed = mallocFailed;
|
||||
db->errCode = rc;
|
||||
}else{
|
||||
sqlite3Error(db, rc, 0);
|
||||
sqlite3Error(db, rc);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@@ -2560,7 +2560,7 @@ int sqlite3VdbeReset(Vdbe *p){
|
||||
** to sqlite3_step(). For consistency (since sqlite3_step() was
|
||||
** called), set the database error in this case as well.
|
||||
*/
|
||||
sqlite3Error(db, p->rc, p->zErrMsg ? "%s" : 0, p->zErrMsg);
|
||||
sqlite3ErrorWithMsg(db, p->rc, p->zErrMsg ? "%s" : 0, p->zErrMsg);
|
||||
sqlite3DbFree(db, p->zErrMsg);
|
||||
p->zErrMsg = 0;
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ blob_open_out:
|
||||
if( pBlob && pBlob->pStmt ) sqlite3VdbeFinalize((Vdbe *)pBlob->pStmt);
|
||||
sqlite3DbFree(db, pBlob);
|
||||
}
|
||||
sqlite3Error(db, rc, (zErr ? "%s" : 0), zErr);
|
||||
sqlite3ErrorWithMsg(db, rc, (zErr ? "%s" : 0), zErr);
|
||||
sqlite3DbFree(db, zErr);
|
||||
sqlite3ParserReset(pParse);
|
||||
sqlite3StackFree(db, pParse);
|
||||
@@ -371,7 +371,7 @@ static int blobReadWrite(
|
||||
if( n<0 || iOffset<0 || (iOffset+n)>p->nByte ){
|
||||
/* Request is out of range. Return a transient error. */
|
||||
rc = SQLITE_ERROR;
|
||||
sqlite3Error(db, SQLITE_ERROR, 0);
|
||||
sqlite3Error(db, SQLITE_ERROR);
|
||||
}else if( v==0 ){
|
||||
/* If there is no statement handle, then the blob-handle has
|
||||
** already been invalidated. Return SQLITE_ABORT in this case.
|
||||
@@ -451,7 +451,7 @@ int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
|
||||
char *zErr;
|
||||
rc = blobSeekToRow(p, iRow, &zErr);
|
||||
if( rc!=SQLITE_OK ){
|
||||
sqlite3Error(db, rc, (zErr ? "%s" : 0), zErr);
|
||||
sqlite3ErrorWithMsg(db, rc, (zErr ? "%s" : 0), zErr);
|
||||
sqlite3DbFree(db, zErr);
|
||||
}
|
||||
assert( rc!=SQLITE_SCHEMA );
|
||||
|
||||
@@ -699,7 +699,7 @@ int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
|
||||
|
||||
sqlite3_mutex_enter(db->mutex);
|
||||
if( !db->pVtabCtx || !(pTab = db->pVtabCtx->pTab) ){
|
||||
sqlite3Error(db, SQLITE_MISUSE, 0);
|
||||
sqlite3Error(db, SQLITE_MISUSE);
|
||||
sqlite3_mutex_leave(db->mutex);
|
||||
return SQLITE_MISUSE_BKPT;
|
||||
}
|
||||
@@ -727,7 +727,7 @@ int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){
|
||||
}
|
||||
db->pVtabCtx->pTab = 0;
|
||||
}else{
|
||||
sqlite3Error(db, SQLITE_ERROR, (zErr ? "%s" : 0), zErr);
|
||||
sqlite3ErrorWithMsg(db, SQLITE_ERROR, (zErr ? "%s" : 0), zErr);
|
||||
sqlite3DbFree(db, zErr);
|
||||
rc = SQLITE_ERROR;
|
||||
}
|
||||
@@ -1088,7 +1088,7 @@ int sqlite3_vtab_config(sqlite3 *db, int op, ...){
|
||||
}
|
||||
va_end(ap);
|
||||
|
||||
if( rc!=SQLITE_OK ) sqlite3Error(db, rc, 0);
|
||||
if( rc!=SQLITE_OK ) sqlite3Error(db, rc);
|
||||
sqlite3_mutex_leave(db->mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user