1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +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:
drh
2012-02-22 19:56:17 +00:00
parent eb9a9696f6
commit 92c700dbb7
5 changed files with 53 additions and 12 deletions

View File

@@ -357,9 +357,7 @@ void sqlite3Pragma(
aFcntl[1] = zLeft;
aFcntl[2] = zRight;
aFcntl[3] = 0;
sqlite3BeginBenignMalloc();
rc = sqlite3_file_control(db, zDb, SQLITE_FCNTL_PRAGMA, (void*)aFcntl);
sqlite3EndBenignMalloc();
if( rc==SQLITE_OK ){
if( aFcntl[0] ){
int mem = ++pParse->nMem;
@@ -369,7 +367,14 @@ void sqlite3Pragma(
sqlite3VdbeAddOp2(v, OP_ResultRow, mem, 1);
sqlite3_free(aFcntl[0]);
}
}else
}else if( rc!=SQLITE_NOTFOUND ){
if( aFcntl[0] ){
sqlite3ErrorMsg(pParse, "%s", aFcntl[0]);
sqlite3_free(aFcntl[0]);
}
pParse->nErr++;
pParse->rc = rc;
}
#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED)