mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
If the SQLITE_FCNTL_PRAGMA file-control returns anything other than
SQLTIE_NOTFOUND and SQLITE_OK, then treat the result as an error. FossilOrigin-Name: 5643618108a8aafba67ed4004039b862bb5e5da8
This commit is contained in:
@@ -480,6 +480,23 @@ static int tvfsCheckReservedLock(sqlite3_file *pFile, int *pResOut){
|
||||
*/
|
||||
static int tvfsFileControl(sqlite3_file *pFile, int op, void *pArg){
|
||||
TestvfsFd *p = tvfsGetFd(pFile);
|
||||
if( op==SQLITE_FCNTL_PRAGMA ){
|
||||
char **argv = (char**)pArg;
|
||||
if( sqlite3_stricmp(argv[1],"error")==0 ){
|
||||
int rc = SQLITE_ERROR;
|
||||
if( argv[2] ){
|
||||
const char *z = argv[2];
|
||||
int x = atoi(z);
|
||||
if( x ){
|
||||
rc = x;
|
||||
while( sqlite3Isdigit(z[0]) ){ z++; }
|
||||
while( sqlite3Isspace(z[0]) ){ z++; }
|
||||
}
|
||||
if( z[0] ) argv[0] = sqlite3_mprintf("%s", z);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
return sqlite3OsFileControl(p->pReal, op, pArg);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user