From: dan Date: Wed, 11 Feb 2015 17:05:17 +0000 (+0000) Subject: Merge the ota-update-no-pager_ota_mode branch into this one. X-Git-Tag: version-3.8.11~252^2~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01325e86e62fa950096f7b3c1e52ab08a128ba75;p=thirdparty%2Fsqlite.git Merge the ota-update-no-pager_ota_mode branch into this one. FossilOrigin-Name: 71887cd9b38def398d48eaf0ec34eeac3c7c5177 --- 01325e86e62fa950096f7b3c1e52ab08a128ba75 diff --cc ext/ota/sqlite3ota.c index 20b9ede75b,c6b9cb59c0..de7f1250c5 --- a/ext/ota/sqlite3ota.c +++ b/ext/ota/sqlite3ota.c @@@ -1434,15 -1480,28 +1476,27 @@@ static int otaGetUpdateStmt ** error occurs, leave an error code and message in the OTA handle. */ static void otaOpenDatabase(sqlite3ota *p){ + int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE; assert( p->rc==SQLITE_OK ); - sqlite3_close(p->db); - p->db = 0; + assert( p->db==0 ); - p->rc = sqlite3_open(p->zTarget, &p->db); + p->rc = sqlite3_open_v2(p->zTarget, &p->db, flags, p->zVfsName); if( p->rc ){ p->zErrmsg = sqlite3_mprintf("%s", sqlite3_errmsg(p->db)); + }else{ + otaMPrintfExec(p, "ATTACH %Q AS ota", p->zOta); - /* sqlite3_trace(p->db, otaSqlTrace, 0); */ + + /* Mark the database file just opened as an OTA target database. If + ** this call returns SQLITE_NOTFOUND, then the OTA vfs is not in use. + ** This is an error. */ + if( p->rc==SQLITE_OK ){ + p->rc = sqlite3_file_control(p->db, "main", SQLITE_FCNTL_OTA, (void*)p); + if( p->rc==SQLITE_NOTFOUND ){ + p->rc = SQLITE_ERROR; + p->zErrmsg = sqlite3_mprintf("ota vfs not found"); + } + } } - otaMPrintfExec(p, "ATTACH %Q AS ota", p->zOta); } /* diff --cc manifest index 4d69256b43,ea88ff70dd..630a43ce13 --- a/manifest +++ b/manifest @@@ -1,5 -1,5 +1,5 @@@ - C Merge\sthe\scommand-line\sshell\senhancements\sfrom\strunk. - D 2015-02-06T15:03:45.342 -C Merge\slatest\strunk\schanges\swith\sthis\sbranch. -D 2015-02-11T16:54:48.127 ++C Merge\sthe\sota-update-no-pager_ota_mode\sbranch\sinto\sthis\sone. ++D 2015-02-11T17:05:17.871 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 6b9e7677829aa94b9f30949656e27312aefb9a46 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@@ -135,9 -133,10 +133,10 @@@ F ext/ota/ota6.test 1fbba5fd46e3e0bfa5a F ext/ota/ota7.test 1fe2c5761705374530e29f70c39693076028221a F ext/ota/ota8.test cd70e63a0c29c45c0906692827deafa34638feda F ext/ota/ota9.test d3eee95dd836824d07a22e5efcdb7bf6e869358b + F ext/ota/otaA.test 95566a8d193113867b960eadf85b310937f2fe03 F ext/ota/otafault.test 508ba87c83d632670ac0f94371a465d4bb4d49dd - F ext/ota/sqlite3ota.c bf417242a191617841cc1ab0815071b49444c9c8 - F ext/ota/sqlite3ota.h b4c54c7df5d223f2ee40efa5ba363188daa3ad37 -F ext/ota/sqlite3ota.c 0ef0f189344b169c9c166bd9fb85793ae2c5968b ++F ext/ota/sqlite3ota.c 466546d41d9b09136216349db98647d0afd77816 + F ext/ota/sqlite3ota.h 1cc7201086fe65a36957740381485a24738c4077 F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761 F ext/rtree/rtree.c 14e6239434d4e3f65d3e90320713f26aa24e167f F ext/rtree/rtree.h 834dbcb82dc85b2481cde6a07cdadfddc99e9b9e @@@ -1255,7 -1254,7 +1254,7 @@@ F tool/vdbe_profile.tcl 67746953071a9f8 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f - P 7f10a0eaf1fedfa020cbd7019ec9342ffdc3b9b0 0f65a7e2e09f801b66897479d501607caeae4abf - R 1ef390b8e8775fda79ba88277a4a2044 - U drh - Z f716caa3559c7f56ae8a7035846f96fb -P 6fc5d4d26a603b3906f02ceea0f507780d0c35eb 24e78b8d65734a6a8ae21a20542cd1839e756fb1 -R fb939d4eb119b38004785cfc38a020ff ++P c3931db560ab4a2601c7f7318fb02c8d5e6862b1 0b63e8dcbaec5043e353734e684c2a46552a3409 ++R f20bdc7a7c21af7b4cb60f763acf418a + U dan -Z ef20780a933decd4d3a7bbad742f919b ++Z 0a34d9bc8960589f0668f7402b31b0ce diff --cc manifest.uuid index 67420b8cdc,9c8fb7f918..f1db10b5fb --- a/manifest.uuid +++ b/manifest.uuid @@@ -1,1 -1,1 +1,1 @@@ - c3931db560ab4a2601c7f7318fb02c8d5e6862b1 -0b63e8dcbaec5043e353734e684c2a46552a3409 ++71887cd9b38def398d48eaf0ec34eeac3c7c5177