aboutsummaryrefslogtreecommitdiff
path: root/mptest
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-03-31 18:05:49 +0000
committerdrh <drh@noemail.net>2015-03-31 18:05:49 +0000
commit4c45196a76c92309980cdbd7fd570e183c272c36 (patch)
treeda8e7f0f6bb03bf9990b07dcbdf166331dc3a312 /mptest
parent8237f6d180d0233a4abac22e12e5f52f6497fd8f (diff)
downloadsqlite-4c45196a76c92309980cdbd7fd570e183c272c36.tar.gz
sqlite-4c45196a76c92309980cdbd7fd570e183c272c36.zip
Add the "mptest" target to main.mk. Change TRUNCATE and PERSIST to DELETE
for mptest.c on Windows because of problems trying to delete the journal. FossilOrigin-Name: ea697e6d9ff1f4d77774589a02ba4a18feafbf03
Diffstat (limited to 'mptest')
-rw-r--r--mptest/mptest.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mptest/mptest.c b/mptest/mptest.c
index 1efdc0319..52ff6a4c8 100644
--- a/mptest/mptest.c
+++ b/mptest/mptest.c
@@ -1327,6 +1327,17 @@ int SQLITE_CDECL main(int argc, char **argv){
}
rc = sqlite3_open_v2(g.zDbFile, &g.db, openFlags, g.zVfs);
if( rc ) fatalError("cannot open [%s]", g.zDbFile);
+ if( zJMode ){
+#if defined(_WIN32)
+ if( sqlite3_stricmp(zJMode,"persist")==0
+ || sqlite3_stricmp(zJMode,"truncate")==0
+ ){
+ printf("Changing journal mode to DELETE from %s", zJMode);
+ zJMode = "DELETE";
+ }
+#endif
+ runSql("PRAGMA journal_mode=%Q;", zJMode);
+ }
sqlite3_enable_load_extension(g.db, 1);
sqlite3_busy_handler(g.db, busyHandler, 0);
sqlite3_create_function(g.db, "vfsname", 0, SQLITE_UTF8, 0,
@@ -1358,7 +1369,6 @@ int SQLITE_CDECL main(int argc, char **argv){
fatalError("missing script filename");
}
if( n>1 ) unrecognizedArguments(argv[0], n, argv+2);
- if( zJMode ) runSql("PRAGMA journal_mode=%Q;", zJMode);
runSql(
"DROP TABLE IF EXISTS task;\n"
"DROP TABLE IF EXISTS counters;\n"