/ Check-in [a0028d48]
Login

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

Overview
Comment:In the CLI, always "dump" the sqlite_sequence table last. Ticket #3867 (CVS 6663)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:a0028d4808275cb1d020d56344d90b2a04603f4d
User & Date: drh 2009-05-21 14:51:03
References
2017-08-28
10:57 New ticket [02f0f4c5] The ".dump" comman crashes following PRAGMA empty_result_callbacks=1. artifact: db4451b8 user: drh
Context
2009-05-21
15:15
In the CLI in the ".dump" command, do not attempt to clear the sqlite_sequence table until the first row of content of that table is seen. Ticket #3867 (CVS 6664) check-in: bedd5ad1 user: drh tags: trunk
14:51
In the CLI, always "dump" the sqlite_sequence table last. Ticket #3867 (CVS 6663) check-in: a0028d48 user: drh tags: trunk
04:42
Add conditional 'extern "C"' block to sqlite3async.h. Ticket #3866. (CVS 6662) check-in: e4d1b117 user: danielk1977 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.207 2009/03/16 10:59:44 drh Exp $
           15  +** $Id: shell.c,v 1.208 2009/05/21 14:51:03 drh Exp $
    16     16   */
    17     17   #if defined(_WIN32) || defined(WIN32)
    18     18   /* This needs to come before any includes for MSVC compiler */
    19     19   #define _CRT_SECURE_NO_WARNINGS
    20     20   #endif
    21     21   
    22     22   #include <stdlib.h>
................................................................................
  2076   2076       open_db(p);
  2077   2077       fprintf(p->out, "BEGIN TRANSACTION;\n");
  2078   2078       p->writableSchema = 0;
  2079   2079       sqlite3_exec(p->db, "PRAGMA writable_schema=ON", 0, 0, 0);
  2080   2080       if( nArg==1 ){
  2081   2081         run_schema_dump_query(p, 
  2082   2082           "SELECT name, type, sql FROM sqlite_master "
  2083         -        "WHERE sql NOT NULL AND type=='table'", 0
         2083  +        "WHERE sql NOT NULL AND type=='table' AND name!='sqlite_sequence'", 0
         2084  +      );
         2085  +      run_schema_dump_query(p, 
         2086  +        "SELECT name, type, sql FROM sqlite_master "
         2087  +        "WHERE name=='sqlite_sequence'", 0
  2084   2088         );
  2085   2089         run_table_dump_query(p->out, p->db,
  2086   2090           "SELECT sql FROM sqlite_master "
  2087   2091           "WHERE sql NOT NULL AND type IN ('index','trigger','view')"
  2088   2092         );
  2089   2093       }else{
  2090   2094         int i;