diff options
author | drh <drh@noemail.net> | 2015-11-19 19:40:40 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2015-11-19 19:40:40 +0000 |
commit | 769dc6e2a22b3104583ad357b01f31a22e146a5c (patch) | |
tree | f88612242437ec891ead4c010c94a20b1d4587ee /src/shell.c | |
parent | 98a0e0083f33ae62a8104be5c074daa123cffc84 (diff) | |
parent | 18f8e73453be7c7a2394824739e890a4d4e8cad0 (diff) | |
download | sqlite-769dc6e2a22b3104583ad357b01f31a22e146a5c.tar.gz sqlite-769dc6e2a22b3104583ad357b01f31a22e146a5c.zip |
Merge the latest enhancements from trunk.
FossilOrigin-Name: 7d6cfc79e7e5534ebacd980479917bc528a638f7
Diffstat (limited to 'src/shell.c')
-rw-r--r-- | src/shell.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/shell.c b/src/shell.c index ec76eeea9..7822919ec 100644 --- a/src/shell.c +++ b/src/shell.c @@ -165,7 +165,7 @@ static sqlite3_int64 timeOfDay(void){ static sqlite3_vfs *clockVfs = 0; sqlite3_int64 t; if( clockVfs==0 ) clockVfs = sqlite3_vfs_find(0); - if( clockVfs->iVersion>=1 && clockVfs->xCurrentTimeInt64!=0 ){ + if( clockVfs->iVersion>=2 && clockVfs->xCurrentTimeInt64!=0 ){ clockVfs->xCurrentTimeInt64(clockVfs, &t); }else{ double r; @@ -2649,7 +2649,7 @@ static int shell_dbinfo_command(ShellState *p, int nArg, char **azArg){ { "schema size:", "SELECT total(length(sql)) FROM %s" }, }; - sqlite3_file *pFile; + sqlite3_file *pFile = 0; int i; char *zSchemaTab; char *zDb = nArg>=2 ? azArg[1] : "main"; @@ -4882,10 +4882,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; |