/ Check-in [ebd44f0b]
Login

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

Overview
Comment:Make the command-line shell ".dump" command more resilient in the face of database corruption. (CVS 3496)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ebd44f0b5e229b990910bb44565de9a5c06cb5bc
User & Date: drh 2006-10-31 18:08:28
Context
2006-10-31
18:13
Fix a pair of memory leaks. These were turned up by running valgrind memcheck with various 10k doc insert, update, delete, and query tests. (CVS 3497) check-in: 3cd9b64b user: shess tags: trunk
18:08
Make the command-line shell ".dump" command more resilient in the face of database corruption. (CVS 3496) check-in: ebd44f0b user: drh tags: trunk
2006-10-30
13:37
Changes to support non-ASCII characters in win95 filenames. Ticket #2047. (CVS 3495) check-in: 9fa3ae58 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains code to implement the "sqlite" command line
    13     13   ** utility for accessing SQLite databases.
    14     14   **
    15         -** $Id: shell.c,v 1.153 2006/10/27 14:21:54 drh Exp $
           15  +** $Id: shell.c,v 1.154 2006/10/31 18:08:28 drh Exp $
    16     16   */
    17     17   #include <stdlib.h>
    18     18   #include <string.h>
    19     19   #include <stdio.h>
    20     20   #include <assert.h>
    21     21   #include "sqlite3.h"
    22     22   #include <ctype.h>
................................................................................
   764    764   
   765    765       rc = run_table_dump_query(p->out, p->db, zSelect);
   766    766       if( rc==SQLITE_CORRUPT ){
   767    767         zSelect = appendText(zSelect, " ORDER BY rowid DESC", 0);
   768    768         rc = run_table_dump_query(p->out, p->db, zSelect);
   769    769       }
   770    770       if( zSelect ) free(zSelect);
   771         -    if( rc!=SQLITE_OK ){
   772         -      return 1;
   773         -    }
   774    771     }
   775    772     return 0;
   776    773   }
   777    774   
   778    775   /*
   779    776   ** Run zQuery.  Update dump_callback() as the callback routine.
   780    777   ** If we get a SQLITE_CORRUPT error, rerun the query after appending