From c19bc9b6b04bb9c3aa2ca3076dfdf7bbf1b40533 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 22 May 2015 23:50:19 +0000 Subject: [PATCH] Improved error messages in fuzzershell when unable to open the database. FossilOrigin-Name: c404fcace83613a50015f15097b7f28123c221c3 --- manifest | 12 ++++++------ manifest.uuid | 2 +- tool/fuzzershell.c | 9 ++++++--- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 4d0c1f61ad..ee169cdc43 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sbug\sin\sfuzzershell\scaused\sby\san\suninitialized\slocal\svariable. -D 2015-05-22T23:45:56.266 +C Improved\serror\smessages\sin\sfuzzershell\swhen\sunable\sto\sopen\sthe\sdatabase. +D 2015-05-22T23:50:19.667 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 0a6ae26396ec696221021780dffbb894ff3cead7 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -1230,7 +1230,7 @@ F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b F tool/extract.c 054069d81b095fbdc189a6f5d4466e40380505e2 F tool/fast_vacuum.c 5ba0d6f5963a0a63bdc42840f678bad75b2ebce1 F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439 -F tool/fuzzershell.c 0b49a78e93feee0596f692c766cdff14186ae36c +F tool/fuzzershell.c f2fc86dd22df654b28851b85019d3bd007361751 F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4 F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5 F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce @@ -1278,7 +1278,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 89f0bbfde4d86a7b15e93aab9c487b4355c6fb2d -R 65016f3b238dc9d4aaf76f46b4ac610e +P 745deab87adc378a5376aaa9451fb9485bc2f4c4 +R 7f1ec43795b4d42a65936d3bb7f0111c U drh -Z 79f3d7dfd072e74dd2fd5db7858a213f +Z e4cfba910ab91f4d7a3f152da8ecf0bd diff --git a/manifest.uuid b/manifest.uuid index 3a72298708..18711cc258 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -745deab87adc378a5376aaa9451fb9485bc2f4c4 \ No newline at end of file +c404fcace83613a50015f15097b7f28123c221c3 \ No newline at end of file diff --git a/tool/fuzzershell.c b/tool/fuzzershell.c index c026cf370d..2778c9d2f7 100644 --- a/tool/fuzzershell.c +++ b/tool/fuzzershell.c @@ -701,14 +701,17 @@ int main(int argc, char **argv){ do{ if( zDbName ){ rc = sqlite3_open_v2(zDbName, &db, SQLITE_OPEN_READWRITE, 0); + if( rc!=SQLITE_OK ){ + abendError("Cannot open database file %s", zDbName); + } }else{ rc = sqlite3_open_v2( "main.db", &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_MEMORY, 0); - } - if( rc!=SQLITE_OK ){ - abendError("Unable to open the in-memory database"); + if( rc!=SQLITE_OK ){ + abendError("Unable to open the in-memory database"); + } } if( pLook ){ rc = sqlite3_db_config(db, SQLITE_DBCONFIG_LOOKASIDE,pLook,szLook,nLook);