Skip to content

Commit

Permalink
Make the ".schema" command in the CLI resistant to corrupt database f…
Browse files Browse the repository at this point in the history
…iles.
  • Loading branch information
D. Richard Hipp committed May 9, 2019
1 parent 31e1689 commit ec7fdef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/shell.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -1681,6 +1681,8 @@ static int shellAuth(
** in FTS3/4/5 into CREATE TABLE IF NOT EXISTS statements.
*/
static void printSchemaLine(FILE *out, const char *z, const char *zTail){
if( z==0 ) return;
if( zTail==0 ) return;
if( sqlite3_strglob("CREATE TABLE ['\"]*", z)==0 ){
utf8_printf(out, "CREATE TABLE IF NOT EXISTS %s%s", z+13, zTail);
}else{
Expand Down

0 comments on commit ec7fdef

Please sign in to comment.