diff options
author | drh <drh@noemail.net> | 2015-11-11 15:28:52 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2015-11-11 15:28:52 +0000 |
commit | 3d38cec99a5e635b2a69ca0ca8adfdeb99b96006 (patch) | |
tree | fbfd7f70a6378d9fc56ed9673199bf1d996be70e /src/shell.c | |
parent | 0c4105ee1930c56b0b1fce4fa7a27c13f838086d (diff) | |
download | sqlite-3d38cec99a5e635b2a69ca0ca8adfdeb99b96006.tar.gz sqlite-3d38cec99a5e635b2a69ca0ca8adfdeb99b96006.zip |
Improvements to the SQLITE_CONFIG_PAGECACHE documentation. Enhance the
command-line shell to be able to take advantage of the full range of
SQLITE_CONFIG_PAGECACHE capabilities, such as setting pMem==NULL and N<0.
FossilOrigin-Name: 2518d5c971c4b32d9227b3bb7259162e3e27b00b
Diffstat (limited to 'src/shell.c')
-rw-r--r-- | src/shell.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shell.c b/src/shell.c index f79087122..7c5399579 100644 --- a/src/shell.c +++ b/src/shell.c @@ -4601,10 +4601,10 @@ int SQLITE_CDECL main(int argc, char **argv){ int n, sz; sz = (int)integerValue(cmdline_option_value(argc,argv,++i)); if( sz>70000 ) sz = 70000; - if( sz<800 ) sz = 800; + if( sz<0 ) sz = 0; n = (int)integerValue(cmdline_option_value(argc,argv,++i)); - if( n<10 ) n = 10; - sqlite3_config(SQLITE_CONFIG_PAGECACHE, malloc(n*sz+1), sz, n); + sqlite3_config(SQLITE_CONFIG_PAGECACHE, + (n>0 && sz>0) ? malloc(n*sz) : 0, sz, n); data.shellFlgs |= SHFLG_Pagecache; }else if( strcmp(z,"-lookaside")==0 ){ int n, sz; |