SQLite

Check-in [2b8fd3b497]
Login

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

Overview
Comment:Make sure the open_db() routine in the CLI does not invoke access() with a NULL filename.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | geojson
Files: files | file ages | folders
SHA3-256: 2b8fd3b49724a613d95e1fe2c6898b6f82188b680a668c9e9b4189156cb84a5e
User & Date: drh 2018-05-11 14:00:17.295
Context
2018-05-11
15:10
Make sure the open_db() routine in the CLI does not invoke access() with a NULL filename. (check-in: 20a8c61122 user: drh tags: trunk)
14:02
Fix a typo in the help message from the ".sha3sum" command in the CLI. (check-in: e76f676c12 user: drh tags: geojson)
14:00
Make sure the open_db() routine in the CLI does not invoke access() with a NULL filename. (check-in: 2b8fd3b497 user: drh tags: geojson)
2018-05-09
15:27
The translation in and out of GeoJSON automatically adds or removes the redundant last vertex, as necessary. (check-in: 2653bedd9f user: drh tags: geojson)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/shell.c.in.
3569
3570
3571
3572
3573
3574
3575
3576



3577

3578
3579
3580
3581
3582
3583
3584

/*
** Make sure the database is open.  If it is not, then open it.  If
** the database fails to open, print an error message and exit.
*/
static void open_db(ShellState *p, int keepAlive){
  if( p->db==0 ){
    if( p->openMode==SHELL_OPEN_UNSPEC && access(p->zDbFilename,0)==0 ){



      p->openMode = (u8)deduceDatabaseType(p->zDbFilename, 0);

    }
    switch( p->openMode ){
      case SHELL_OPEN_APPENDVFS: {
        sqlite3_open_v2(p->zDbFilename, &p->db, 
           SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "apndvfs");
        break;
      }







|
>
>
>
|
>







3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588

/*
** Make sure the database is open.  If it is not, then open it.  If
** the database fails to open, print an error message and exit.
*/
static void open_db(ShellState *p, int keepAlive){
  if( p->db==0 ){
    if( p->openMode==SHELL_OPEN_UNSPEC ){
      if( p->zDbFilename==0 || p->zDbFilename[0]==0 ){
        p->openMode = SHELL_OPEN_NORMAL;
      }else if( access(p->zDbFilename,0)==0 ){
        p->openMode = (u8)deduceDatabaseType(p->zDbFilename, 0);
      }
    }
    switch( p->openMode ){
      case SHELL_OPEN_APPENDVFS: {
        sqlite3_open_v2(p->zDbFilename, &p->db, 
           SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "apndvfs");
        break;
      }