/ Check-in [3649a77b]
Login

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

Overview
Comment:In the CLI, give better error messages if something goes wrong with the ".dbinfo" command.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3649a77b79001ea6c5defe882f9934521b20b9d36aab26d03b5d42006c7fa228
User & Date: drh 2019-03-20 18:22:51
Context
2019-03-21
21:18
Add an extra test for database corruption to defragmentPage(). check-in: 80e951fc user: dan tags: trunk
17:22
Merge latest trunk changes with this branch. check-in: 3196f5f4 user: dan tags: reuse-schema
2019-03-20
20:27
Experimental change to apply affinity before running CHECK constraints on an INSERT. Note that in the CHECK constraints, REAL affinity really is REAL affinity, and not numeric affinity. This causes failures in some tests that are assuming affinity is applied after CHECK constraints. Leaf check-in: 9ef69d18 user: drh tags: apply-affinity-first
18:22
In the CLI, give better error messages if something goes wrong with the ".dbinfo" command. check-in: 3649a77b user: drh tags: trunk
16:58
Fix a potential dangling pointer deference in an ALTER TABLE run on a schema that contains constructs of the form "PRIMARY KEY(column COLLATE collation)". check-in: b9e2393c user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.in.

  4769   4769        { "number of triggers:",
  4770   4770          "SELECT count(*) FROM %s WHERE type='trigger'" },
  4771   4771        { "number of views:",
  4772   4772          "SELECT count(*) FROM %s WHERE type='view'" },
  4773   4773        { "schema size:",
  4774   4774          "SELECT total(length(sql)) FROM %s" },
  4775   4775     };
  4776         -  int i;
         4776  +  int i, rc;
  4777   4777     unsigned iDataVersion;
  4778   4778     char *zSchemaTab;
  4779   4779     char *zDb = nArg>=2 ? azArg[1] : "main";
  4780   4780     sqlite3_stmt *pStmt = 0;
  4781   4781     unsigned char aHdr[100];
  4782   4782     open_db(p, 0);
  4783   4783     if( p->db==0 ) return 1;
  4784         -  sqlite3_prepare_v2(p->db,"SELECT data FROM sqlite_dbpage(?1) WHERE pgno=1",
  4785         -                     -1, &pStmt, 0);
         4784  +  rc = sqlite3_prepare_v2(p->db,
         4785  +             "SELECT data FROM sqlite_dbpage(?1) WHERE pgno=1",
         4786  +             -1, &pStmt, 0);
         4787  +  if( rc ){
         4788  +    if( !sqlite3_compileoption_used("ENABLE_DBPAGE_VTAB") ){
         4789  +      utf8_printf(stderr, "the \".dbinfo\" command requires the "
         4790  +                          "-DSQLITE_ENABLE_DBPAGE_VTAB compile-time options\n");
         4791  +    }else{
         4792  +      utf8_printf(stderr, "error: %s\n", sqlite3_errmsg(p->db));
         4793  +    }
         4794  +    sqlite3_finalize(pStmt);
         4795  +    return 1;
         4796  +  }
  4786   4797     sqlite3_bind_text(pStmt, 1, zDb, -1, SQLITE_STATIC);
  4787   4798     if( sqlite3_step(pStmt)==SQLITE_ROW
  4788   4799      && sqlite3_column_bytes(pStmt,0)>100
  4789   4800     ){
  4790   4801       memcpy(aHdr, sqlite3_column_blob(pStmt,0), 100);
  4791   4802       sqlite3_finalize(pStmt);
  4792   4803     }else{