/ Check-in [a1a2b4a2]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a problem in the "ota" utility program causing it to crash if SQLite failed to open the target database.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ota-update
Files: files | file ages | folders
SHA1: a1a2b4a2eff4f641fa80e8ffa805c97afb73be95
User & Date: dan 2015-04-23 19:38:20
Context
2015-05-14
08:58
Merge latest trunk changes with this branch. check-in: 299ed55c user: dan tags: ota-update
2015-04-23
19:38
Fix a problem in the "ota" utility program causing it to crash if SQLite failed to open the target database. check-in: a1a2b4a2 user: dan tags: ota-update
19:32
Merge latest trunk changes into this branch. check-in: 1506e99e user: dan tags: ota-update
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ext/ota/ota.c.

44
45
46
47
48
49
50
51
52

53
54
55
56
57
58
59

void report_default_vfs(){
  sqlite3_vfs *pVfs = sqlite3_vfs_find(0);
  fprintf(stdout, "default vfs is \"%s\"\n", pVfs->zName);
}

void report_ota_vfs(sqlite3ota *pOta){
  if( pOta ){
    sqlite3 *db = sqlite3ota_db(pOta, 0);

    char *zName = 0;
    sqlite3_file_control(db, "main", SQLITE_FCNTL_VFSNAME, &zName);
    if( zName ){
      fprintf(stdout, "using vfs \"%s\"\n", zName);
    }else{
      fprintf(stdout, "vfs name not available\n");
    }







<
|
>







44
45
46
47
48
49
50

51
52
53
54
55
56
57
58
59

void report_default_vfs(){
  sqlite3_vfs *pVfs = sqlite3_vfs_find(0);
  fprintf(stdout, "default vfs is \"%s\"\n", pVfs->zName);
}

void report_ota_vfs(sqlite3ota *pOta){

  sqlite3 *db = sqlite3ota_db(pOta, 0);
  if( db ){
    char *zName = 0;
    sqlite3_file_control(db, "main", SQLITE_FCNTL_VFSNAME, &zName);
    if( zName ){
      fprintf(stdout, "using vfs \"%s\"\n", zName);
    }else{
      fprintf(stdout, "vfs name not available\n");
    }

Changes to ext/ota/sqlite3ota.h.

291
292
293
294
295
296
297




298
299
300
301
302
303
304
**     tables, the application may need to call sqlite3_create_module() on
**     the ota update db handle to any required virtual table
**     implementations.
**
**   * 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.




*/
sqlite3 *sqlite3ota_db(sqlite3ota*, int bOta);

/*
** Do some work towards applying the OTA update to the target db. 
**
** Return SQLITE_DONE if the update has been completely applied, or 







>
>
>
>







291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
**     tables, the application may need to call sqlite3_create_module() on
**     the ota update db handle to any required virtual table
**     implementations.
**
**   * 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);

/*
** Do some work towards applying the OTA update to the target db. 
**
** Return SQLITE_DONE if the update has been completely applied, or