SQLite

Changes On Branch stat-vtab-in-shell
Login

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

Changes In Branch stat-vtab-in-shell Excluding Merge-Ins

This is equivalent to a diff from 60174cf5 to 7ed86dd3

2015-04-30
20:35
Enhance the CLI to initialize the dbstat virtual table if compiled using SQLITE_ENABLE_STAT_VTAB. (check-in: 822dfc00 user: drh tags: trunk)
2015-04-28
12:44
Shift the Mem.pScopyFrom pointer in the correct direction in OP_Move. Fix for a defective check-in [a2135ad13049] and ticket [d6352363751]. Debugging code only - does not affect normal operation. (check-in: add4e043 user: drh tags: trunk)
12:27
Add code to the shell to optionally initialize the dbstat virtual table. (Closed-Leaf check-in: 7ed86dd3 user: drh tags: stat-vtab-in-shell)
01:28
Fix comment typos. No code changes. (check-in: 60174cf5 user: drh tags: trunk)
00:53
Add a TCL script that can be run to generate the fuzzdata1.txt file. (check-in: fdc79fd1 user: drh tags: trunk)

Changes to src/shell.c.

1905
1906
1907
1908
1909
1910
1911






1912
1913
1914
1915
1916
1917
1918
** Make sure the database is open.  If it is not, then open it.  If
** the database fails to open, print an error message and exit.
*/
static void open_db(ShellState *p, int keepAlive){
  if( p->db==0 ){
    sqlite3_initialize();
    sqlite3_open(p->zDbFilename, &p->db);






    globalDb = p->db;
    if( p->db && sqlite3_errcode(p->db)==SQLITE_OK ){
      sqlite3_create_function(p->db, "shellstatic", 0, SQLITE_UTF8, 0,
          shellstaticFunc, 0, 0);
    }
    if( p->db==0 || SQLITE_OK!=sqlite3_errcode(p->db) ){
      fprintf(stderr,"Error: unable to open database \"%s\": %s\n", 







>
>
>
>
>
>







1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
** Make sure the database is open.  If it is not, then open it.  If
** the database fails to open, print an error message and exit.
*/
static void open_db(ShellState *p, int keepAlive){
  if( p->db==0 ){
    sqlite3_initialize();
    sqlite3_open(p->zDbFilename, &p->db);
#ifdef SQLITE_ENABLE_STAT_VTAB_EXPERIMENTAL
    if( p->db ){
      int sqlite3_dbstat_register(sqlite3*);
      sqlite3_dbstat_register(p->db);
    }
#endif
    globalDb = p->db;
    if( p->db && sqlite3_errcode(p->db)==SQLITE_OK ){
      sqlite3_create_function(p->db, "shellstatic", 0, SQLITE_UTF8, 0,
          shellstaticFunc, 0, 0);
    }
    if( p->db==0 || SQLITE_OK!=sqlite3_errcode(p->db) ){
      fprintf(stderr,"Error: unable to open database \"%s\": %s\n",