/ Check-in [5f779ff6]
Login

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

Overview
Comment:Fix a parsing issue associated with a corrupt sqlite_master table.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | corrupt-schema
Files: files | file ages | folders
SHA3-256: 5f779ff6b48ec97efacd49b1715b7e5272694fa839be349c90667812bbffe22b
User & Date: mistachkin 2018-03-16 19:10:05
Context
2018-03-16
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
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
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/parse.y.

   165    165   temp(A) ::= TEMP.  {A = 1;}
   166    166   %endif  SQLITE_OMIT_TEMPDB
   167    167   temp(A) ::= .      {A = 0;}
   168    168   create_table_args ::= LP columnlist conslist_opt(X) RP(E) table_options(F). {
   169    169     sqlite3EndTable(pParse,&X,&E,F,0);
   170    170   }
   171    171   create_table_args ::= AS select(S). {
   172         -  sqlite3EndTable(pParse,0,0,0,S);
   173         -  sqlite3SelectDelete(pParse->db, S);
          172  +  if( pParse->db->init.busy==0 ){
          173  +    sqlite3EndTable(pParse,0,0,0,S);
          174  +    sqlite3SelectDelete(pParse->db, S);
          175  +  }else{
          176  +    sqlite3SelectDelete(pParse->db, S);
          177  +    sqlite3ErrorMsg(pParse, "corrupt schema");
          178  +  }
   174    179   }
   175    180   %type table_options {int}
   176    181   table_options(A) ::= .    {A = 0;}
   177    182   table_options(A) ::= WITHOUT nm(X). {
   178    183     if( X.n==5 && sqlite3_strnicmp(X.z,"rowid",5)==0 ){
   179    184       A = TF_WithoutRowid | TF_NoVisibleRowid;
   180    185     }else{