aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2014-09-23 18:30:00 +0000
committerdrh <drh@noemail.net>2014-09-23 18:30:00 +0000
commit3b8fea9ec64d77d23a28c7f1beb2d61e4d475c92 (patch)
tree5b70fc1556c1406c52bd9d4e9e7492e58cdfc100 /src
parent14f0e2128ac9cbbe5e1e871372911e3df447df4f (diff)
downloadsqlite-3b8fea9ec64d77d23a28c7f1beb2d61e4d475c92.tar.gz
sqlite-3b8fea9ec64d77d23a28c7f1beb2d61e4d475c92.zip
Add the "multiplex_truncate" PRAGMA to the multiplexor extension, for
querying and setting the truncate flag on a database connection. FossilOrigin-Name: d2962a5f388f30a02429e0c8b87399f482b5604c
Diffstat (limited to 'src')
-rw-r--r--src/test_multiplex.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test_multiplex.c b/src/test_multiplex.c
index 427cc65ad..99819371c 100644
--- a/src/test_multiplex.c
+++ b/src/test_multiplex.c
@@ -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 ){