/ Check-in [47353f62]
Login

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

Overview
Comment:Report any error which occurs in closing the database at exit. Free a couple of strings which were leaking. (CVS 3340)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 47353f62ca7635b693718997e792358d16bd117b
User & Date: adamd 2006-07-28 20:16:14
Context
2006-07-30
20:50
Reset the schema before checking for outstanding statements inside sqlite3_close() so that virtual tables will be disconnected. (CVS 3341) check-in: af05c3ca user: drh tags: trunk
2006-07-28
20:16
Report any error which occurs in closing the database at exit. Free a couple of strings which were leaking. (CVS 3340) check-in: 47353f62 user: adamd tags: trunk
2006-07-26
16:22
Disallow writing to, creating or dropping virtual tables from within xSync() callbacks. (CVS 3339) check-in: e705d232 user: danielk1977 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/shell.c.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
....
1810
1811
1812
1813
1814
1815
1816

1817

1818
1819
1820
1821
1822

1823



1824
1825
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** This file contains code to implement the "sqlite" command line
** utility for accessing SQLite databases.
**
** $Id: shell.c,v 1.144 2006/06/27 20:39:04 drh Exp $
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "sqlite3.h"
#include <ctype.h>
................................................................................
#if defined(HAVE_READLINE) && HAVE_READLINE==1
      if( zHistory ) read_history(zHistory);
#endif
      process_input(&data, 0);
      if( zHistory ){
        stifle_history(100);
        write_history(zHistory);

      }

    }else{
      process_input(&data, stdin);
    }
  }
  set_table_name(&data, 0);

  if( db ) sqlite3_close(db);



  return 0;
}







|







 







>

>





>
|
>
>
>


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
....
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** This file contains code to implement the "sqlite" command line
** utility for accessing SQLite databases.
**
** $Id: shell.c,v 1.145 2006/07/28 20:16:14 adamd Exp $
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "sqlite3.h"
#include <ctype.h>
................................................................................
#if defined(HAVE_READLINE) && HAVE_READLINE==1
      if( zHistory ) read_history(zHistory);
#endif
      process_input(&data, 0);
      if( zHistory ){
        stifle_history(100);
        write_history(zHistory);
        free(zHistory);
      }
      free(zHome);
    }else{
      process_input(&data, stdin);
    }
  }
  set_table_name(&data, 0);
  if( db ){
    if( sqlite3_close(db)!=SQLITE_OK ){
      fprintf(stderr,"error closing database: %s\n", sqlite3_errmsg(db));
    }
  }
  return 0;
}