Modify the CLI so that the --deserialize option is only available if it is

compiled with SQLITE_ENABLE_DESERIALIZE.  DESERIALIZE is now off by default
for the main.mk makefile, but on for Makefile.in and Makefile.msc.

FossilOrigin-Name: 90b2a684f775e1468d63bf950119cf0aaa62b5a449f518e7cc513c314191dd14
This commit is contained in:
drh 2018-10-30 15:31:22 +00:00
parent ad9bfa5e07
commit a751f39c3f
4 changed files with 20 additions and 11 deletions

View File

@ -523,7 +523,6 @@ SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
SHELL_OPT += -DSQLITE_ENABLE_DESERIALIZE
SHELL_OPT += -DSQLITE_INTROSPECTION_PRAGMAS
FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5

View File

@ -1,5 +1,5 @@
C Improvements\sto\sthe\s-fsanitize=fuzzer\sbased\sdatabase\sfile\sfuzzer.\n(Cherrypick\sfrom\sthe\srubust-against-damaged-db\sbranch.)
D 2018-10-30T15:20:35.806
C Modify\sthe\sCLI\sso\sthat\sthe\s--deserialize\soption\sis\sonly\savailable\sif\sit\sis\ncompiled\swith\sSQLITE_ENABLE_DESERIALIZE.\s\sDESERIALIZE\sis\snow\soff\sby\sdefault\nfor\sthe\smain.mk\smakefile,\sbut\son\sfor\sMakefile.in\sand\sMakefile.msc.
D 2018-10-30T15:31:22.400
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F Makefile.in 64113b9c489de88bf5ea29d7426fa3f63938ee5f5e4a4fea1f6e62a25efba177
@ -426,7 +426,7 @@ F ext/userauth/userauth.c f81aa5a3ecacf406f170c62a144405858f6f6de51dbdc0920134e6
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60
F main.mk 261a2292823e3c3107515f7a25c73915b3bfa0bda28136d91999e62dfbb2e082
F main.mk ff82d38126f8f0668b7990e0f1f3dcd74fa2d477c19b2e3feaaba586051e9b48
F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
@ -505,7 +505,7 @@ F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
F src/resolve.c bc8c79e56439b111e7d9415e44940951f7087e9466c3a9d664558ef0faf31073
F src/rowset.c d977b011993aaea002cab3e0bb2ce50cf346000dff94e944d547b989f4b1fe93
F src/select.c 61e867a906f140b73baf4ce7a201ad6dcba30820969f5618ee40e9a0d32c6f5f
F src/shell.c.in a1fa74761b1bdeca5d40dcfdf55fd88f5139155e2bdd2c6b3e9e8e359d062a7d
F src/shell.c.in f5a89e43e1b3255fcc274f5185595f547199757e0c59e3ea938af9676e9557d4
F src/sqlite.h.in 4b4c2f2daeeed4412ba9d81bc78092c69831fe6eda4f0ae5bf951da51a8dccec
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h 305adca1b5da4a33ce2db5bd236935768e951d5651bfe5560ed55cfcdbce6a63
@ -1774,8 +1774,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 7989bbda70a24611c3b8af96a53114bb53d87a2e1145ec7ad4f1b4cbf8d6040c
Q +585c94db09d21ce5c5275537014ba5cfe75d4df9274d6fd8d07f754e4aa2c640
R 3505f0f95a3c0f6a209b5970a7392158
P 3cc01a0eaf54e3d5adf206825cfcab15edf73bd5aea10dfc497efd78071a17d0
R 16663463465bb3df141de41e8b146893
U drh
Z 0539ca60fda1fb5b50f26b7720439a51
Z cc57e679441568ddef0c9613510d7c7c

View File

@ -1 +1 @@
3cc01a0eaf54e3d5adf206825cfcab15edf73bd5aea10dfc497efd78071a17d0
90b2a684f775e1468d63bf950119cf0aaa62b5a449f518e7cc513c314191dd14

View File

@ -3434,7 +3434,9 @@ static const char *(azHelp[]) = {
".open ?OPTIONS? ?FILE? Close existing database and reopen FILE",
" Options:",
" --append Use appendvfs to append database to the end of FILE",
#ifdef SQLITE_ENABLE_DESERIALIZE
" --deserialize Load into memory useing sqlite3_deserialize()",
#endif
" --new Initialize FILE to an empty database",
" --readonly Open FILE readonly",
" --zip FILE is a ZIP archive",
@ -3783,7 +3785,9 @@ static void open_db(ShellState *p, int openFlags){
"CREATE VIRTUAL TABLE zip USING zipfile(%Q);", p->zDbFilename);
sqlite3_exec(p->db, zSql, 0, 0, 0);
sqlite3_free(zSql);
}else if( p->openMode==SHELL_OPEN_DESERIALIZE ){
}
#ifdef SQLITE_ENABLE_DESERIALIZE
else if( p->openMode==SHELL_OPEN_DESERIALIZE ){
int nData = 0;
unsigned char *aData = (unsigned char*)readFile(p->zDbFilename, &nData);
int rc = sqlite3_deserialize(p->db, "main", aData, nData, nData,
@ -3793,6 +3797,7 @@ static void open_db(ShellState *p, int openFlags){
utf8_printf(stderr, "Error: sqlite3_deserialize() returns %d\n", rc);
}
}
#endif
}
}
@ -6673,8 +6678,10 @@ static int do_meta_command(char *zLine, ShellState *p){
p->openMode = SHELL_OPEN_APPENDVFS;
}else if( optionMatch(z, "readonly") ){
p->openMode = SHELL_OPEN_READONLY;
#ifdef SQLITE_ENABLE_DESERIALIZE
}else if( optionMatch(z, "deserialize") ){
p->openMode = SHELL_OPEN_DESERIALIZE;
#endif
}else if( z[0]=='-' ){
utf8_printf(stderr, "unknown option: %s\n", z);
rc = 1;
@ -8643,8 +8650,10 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
#endif
}else if( strcmp(z,"-append")==0 ){
data.openMode = SHELL_OPEN_APPENDVFS;
#ifdef SQLITE_ENABLE_DESERIALIZE
}else if( strcmp(z,"-deserialize")==0 ){
data.openMode = SHELL_OPEN_DESERIALIZE;
#endif
}else if( strcmp(z,"-readonly")==0 ){
data.openMode = SHELL_OPEN_READONLY;
#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_HAVE_ZLIB)
@ -8740,8 +8749,10 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
#endif
}else if( strcmp(z,"-append")==0 ){
data.openMode = SHELL_OPEN_APPENDVFS;
#ifdef SQLITE_ENABLE_DESERIALIZE
}else if( strcmp(z,"-deserialize")==0 ){
data.openMode = SHELL_OPEN_DESERIALIZE;
#endif
}else if( strcmp(z,"-readonly")==0 ){
data.openMode = SHELL_OPEN_READONLY;
}else if( strcmp(z,"-ascii")==0 ){