Fix a problem in the "ota" utility program causing it to crash if SQLite failed to open the target database.

FossilOrigin-Name: a1a2b4a2eff4f641fa80e8ffa805c97afb73be95
This commit is contained in:
dan 2015-04-23 19:38:20 +00:00
parent e11afed562
commit 6758959ec3
4 changed files with 14 additions and 10 deletions

View File

@ -48,8 +48,8 @@ void report_default_vfs(){
}
void report_ota_vfs(sqlite3ota *pOta){
if( pOta ){
sqlite3 *db = sqlite3ota_db(pOta, 0);
sqlite3 *db = sqlite3ota_db(pOta, 0);
if( db ){
char *zName = 0;
sqlite3_file_control(db, "main", SQLITE_FCNTL_VFSNAME, &zName);
if( zName ){

View File

@ -295,6 +295,10 @@ sqlite3ota *sqlite3ota_open(const char *zTarget, const char *zOta);
** * If the application uses the "ota_delta()" feature described above,
** it must use sqlite3_create_function() or similar to register the
** ota_delta() implementation with the target database handle.
**
** If an error has occurred, either while opening or stepping the OTA object,
** this function may return NULL. The error code and message may be collected
** when sqlite3ota_close() is called.
*/
sqlite3 *sqlite3ota_db(sqlite3ota*, int bOta);

View File

@ -1,5 +1,5 @@
C Merge\slatest\strunk\schanges\sinto\sthis\sbranch.
D 2015-04-23T19:32:19.839
C Fix\sa\sproblem\sin\sthe\s"ota"\sutility\sprogram\scausing\sit\sto\scrash\sif\sSQLite\sfailed\sto\sopen\sthe\starget\sdatabase.
D 2015-04-23T19:38:20.522
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 34ca00e764c293f3a75208b607b4083a90a1bccf
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -123,7 +123,7 @@ F ext/misc/totype.c 4a167594e791abeed95e0a8db028822b5e8fe512
F ext/misc/vfslog.c fe40fab5c077a40477f7e5eba994309ecac6cc95
F ext/misc/vtshim.c babb0dc2bf116029e3e7c9a618b8a1377045303e
F ext/misc/wholenumber.c 784b12543d60702ebdd47da936e278aa03076212
F ext/ota/ota.c feb0a11f720a8f30d2bebb835bba3c131a725685
F ext/ota/ota.c c47352838b967384a81eda5de75c352922a0dd6e
F ext/ota/ota1.test 960418e4171a989426f8b1ad8ee31770e0f94fb8
F ext/ota/ota10.test 85e0f6e7964db5007590c1b299e75211ed4240d4
F ext/ota/ota11.test 2f606cd2b4af260a86b549e91b9f395450fc75cb
@ -140,7 +140,7 @@ F ext/ota/otacrash.test 8346192b2d46cbe7787d5d65904d81d3262a3cbf
F ext/ota/otafault.test 8c43586c2b96ca16bbce00b5d7e7d67316126db8
F ext/ota/otafault2.test fa202a98ca221faec318f3e5c5f39485b1256561
F ext/ota/sqlite3ota.c 5bfd677bd956d0ea9f0022b010ac70409e8e9bf6
F ext/ota/sqlite3ota.h c0d32e46aa52cce3b16899399639deaff1f27b2f
F ext/ota/sqlite3ota.h 7faa45e080b9c136e666c383187ff6e39d88135b
F ext/ota/test_ota.c e34c801c665d64b4b9e00b71f1acf8c652404b2b
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
F ext/rtree/rtree.c 14e6239434d4e3f65d3e90320713f26aa24e167f
@ -1272,7 +1272,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 fa62093b2531424846ea500c4155170d1bc7110e b5e43602833249aa4b73337bf85b7f308450dab6
R c95117e2851354f4fbc699c1409b62e5
P 1506e99eca19f72fb59b55ec9e2534505dfa7a6e
R 5fcb34c1c4f5453896bfec967f317705
U dan
Z 4eaccde899eceec56aac43725e359315
Z 1b150381fd804dab419a02d028d557d7

View File

@ -1 +1 @@
1506e99eca19f72fb59b55ec9e2534505dfa7a6e
a1a2b4a2eff4f641fa80e8ffa805c97afb73be95