Fossil

Check-in [277774b4]
Login

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

Overview
Comment:Update the shell.c file from upstream (SQLite) so that the ".databases" command works with arbitrary-length filenames.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 277774b49e810b8a487f85fbeab4e312bfc728b9
User & Date: drh 2016-12-24 18:19:44
Context
2016-12-24
19:38
Update the built-in SQLite to include the change that makes "main" an acceptable alias for the primary database, even if the primary database has been renamed to "repository" or "localdb". check-in: 0d28198d user: drh tags: trunk
18:19
Update the shell.c file from upstream (SQLite) so that the ".databases" command works with arbitrary-length filenames. check-in: 277774b4 user: drh tags: trunk
18:07
Improve the "fossil sql" command so that it opens all database - repository, localdb, and configdb. Use the latest command-line shell code from the SQLite project so that the ".tables" command correctly shows all tables. check-in: 07081558 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/shell.c.

3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712

3713
3714
3715
3716
3717
3718
3719
3720
  }else

  if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 ){
    ShellState data;
    char *zErrMsg = 0;
    open_db(p, 0);
    memcpy(&data, p, sizeof(data));
    data.showHeader = 1;
    data.cMode = data.mode = MODE_Column;
    data.colWidth[0] = 3;
    data.colWidth[1] = 0;
    data.colWidth[2] = 0;
    data.cnt = 0;

    sqlite3_exec(p->db, "PRAGMA database_list; ", callback, &data, &zErrMsg);
    if( zErrMsg ){
      utf8_printf(stderr,"Error: %s\n", zErrMsg);
      sqlite3_free(zErrMsg);
      rc = 1;
    }
  }else








|
|
|
<
<

>
|







3700
3701
3702
3703
3704
3705
3706
3707
3708
3709


3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
  }else

  if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 ){
    ShellState data;
    char *zErrMsg = 0;
    open_db(p, 0);
    memcpy(&data, p, sizeof(data));
    data.showHeader = 0;
    data.cMode = data.mode = MODE_List;
    sqlite3_snprintf(sizeof(data.colSeparator),data.colSeparator,": ");


    data.cnt = 0;
    sqlite3_exec(p->db, "SELECT name, file FROM pragma_database_list",
                 callback, &data, &zErrMsg);
    if( zErrMsg ){
      utf8_printf(stderr,"Error: %s\n", zErrMsg);
      sqlite3_free(zErrMsg);
      rc = 1;
    }
  }else