mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Add the "multiplex_truncate" PRAGMA to the multiplexor extension, for
querying and setting the truncate flag on a database connection. FossilOrigin-Name: d2962a5f388f30a02429e0c8b87399f482b5604c
This commit is contained in:
@@ -1002,6 +1002,26 @@ static int multiplexFileControl(sqlite3_file *pConn, int op, void *pArg){
|
||||
/* no-op these */
|
||||
rc = SQLITE_OK;
|
||||
break;
|
||||
case SQLITE_FCNTL_PRAGMA: {
|
||||
char **aFcntl = (char**)pArg;
|
||||
if( aFcntl[1] && sqlite3_stricmp(aFcntl[1],"multiplex_truncate")==0 ){
|
||||
if( aFcntl[2] && aFcntl[2][0] ){
|
||||
if( sqlite3_stricmp(aFcntl[2], "on")==0
|
||||
|| sqlite3_stricmp(aFcntl[2], "1")==0 ){
|
||||
pGroup->bTruncate = 1;
|
||||
}else
|
||||
if( sqlite3_stricmp(aFcntl[2], "off")==0
|
||||
|| sqlite3_stricmp(aFcntl[2], "0")==0 ){
|
||||
pGroup->bTruncate = 0;
|
||||
}
|
||||
}
|
||||
aFcntl[0] = sqlite3_mprintf(pGroup->bTruncate ? "on" : "off");
|
||||
rc = SQLITE_OK;
|
||||
break;
|
||||
}
|
||||
/* If the multiplexor does not handle the pragma, pass it through
|
||||
** into the default case. */
|
||||
}
|
||||
default:
|
||||
pSubOpen = multiplexSubOpen(pGroup, 0, &rc, NULL, 0);
|
||||
if( pSubOpen ){
|
||||
|
||||
Reference in New Issue
Block a user