/ Check-in Differences
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.

Difference From 1774f1c3baf0bc3d To d75e67654aa9620b

2018-03-16
23:59
Detect corruption in the form of the sqlite_sequence table pointing to the wrong type of btree. check-in: 525deb7a user: drh tags: trunk
23:53
Fix a duplicate test number and cleanup a bit of Makefile whitespace. check-in: 56d11c25 user: mistachkin tags: testFixes
20:23
Detect databases whose schema is corrupted using a CREATE TABLE AS statement and issue an appropriate error message. check-in: d75e6765 user: drh tags: trunk
20:15
Better error message text when the schema is corrupted by a CREATE TABLE AS entry. Closed-Leaf check-in: e13993cf user: drh tags: corrupt-schema
19:10
Fix a parsing issue associated with a corrupt sqlite_master table. check-in: 5f779ff6 user: mistachkin tags: corrupt-schema
18:46
Avoid writing the sqlite_sequence table when it has not actually changed. Closed-Leaf check-in: 3e3849a9 user: drh tags: autoinc-enhancement
07:49
Fix a problem in test script thread001.test causing a spurious "-1 files were left open" error when run separately. Cherrypick of [1774f1c3b]. check-in: 6cf8172d user: dan tags: branch-3.19
07:48
Fix a problem in test script thread001.test causing a spurious "-1 files were left open" error when run separately. check-in: 1774f1c3 user: dan tags: trunk
2018-03-15
17:46
Fix a typo in a comment used to generate documentation. No code changes. check-in: f1784aff user: drh tags: trunk

Changes to src/build.c.

  1866   1866     if( pEnd==0 && pSelect==0 ){
  1867   1867       return;
  1868   1868     }
  1869   1869     assert( !db->mallocFailed );
  1870   1870     p = pParse->pNewTable;
  1871   1871     if( p==0 ) return;
  1872   1872   
  1873         -  assert( !db->init.busy || !pSelect );
  1874         -
  1875   1873     /* If the db->init.busy is 1 it means we are reading the SQL off the
  1876   1874     ** "sqlite_master" or "sqlite_temp_master" table on the disk.
  1877   1875     ** So do not write to the disk again.  Extract the root page number
  1878   1876     ** for the table from the db->init.newTnum field.  (The page number
  1879   1877     ** should have been put there by the sqliteOpenCb routine.)
  1880   1878     **
  1881   1879     ** If the root page number is 1, that means this is the sqlite_master
  1882   1880     ** table itself.  So mark it read-only.
  1883   1881     */
  1884   1882     if( db->init.busy ){
         1883  +    if( pSelect ){
         1884  +      sqlite3ErrorMsg(pParse, "");
         1885  +      return;
         1886  +    }
  1885   1887       p->tnum = db->init.newTnum;
  1886   1888       if( p->tnum==1 ) p->tabFlags |= TF_Readonly;
  1887   1889     }
  1888   1890   
  1889   1891     /* Special processing for WITHOUT ROWID Tables */
  1890   1892     if( tabOpts & TF_WithoutRowid ){
  1891   1893       if( (p->tabFlags & TF_Autoincrement) ){

Changes to src/prepare.c.

    25     25     const char *zExtra   /* Error information */
    26     26   ){
    27     27     sqlite3 *db = pData->db;
    28     28     if( !db->mallocFailed && (db->flags & SQLITE_WriteSchema)==0 ){
    29     29       char *z;
    30     30       if( zObj==0 ) zObj = "?";
    31     31       z = sqlite3MPrintf(db, "malformed database schema (%s)", zObj);
    32         -    if( zExtra ) z = sqlite3MPrintf(db, "%z - %s", z, zExtra);
           32  +    if( zExtra && zExtra[0] ) z = sqlite3MPrintf(db, "%z - %s", z, zExtra);
    33     33       sqlite3DbFree(db, *pData->pzErrMsg);
    34     34       *pData->pzErrMsg = z;
    35     35     }
    36     36     pData->rc = db->mallocFailed ? SQLITE_NOMEM_BKPT : SQLITE_CORRUPT_BKPT;
    37     37   }
    38     38   
    39     39   /*