/ Check-in [29292169]
Login

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

Overview
Comment:Merge fixes from the 3.21 branch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 292921692c8919d29f0a67d03ca953d5c1c4900d8c8567cceab27513732be598
User & Date: drh 2017-10-12 13:21:56
Context
2017-10-12
13:47
The src/shell.c file is now generated from src/shell.c.in, so remove shell.c from version control and update the makefiles to build it automatically. check-in: 36acc0a9 user: drh tags: trunk
13:21
Merge fixes from the 3.21 branch. check-in: 29292169 user: drh tags: trunk
11:33
Fix a potential crash that may follow an OOM or other system error in the shell tool. check-in: c36761e1 user: dan tags: trunk
10:28
Make sure the tableColumnList() routine of the command-line shell does not cause a null-pointer dereference in an error condition. check-in: 5d0ceb8d user: drh tags: branch-3.21
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.msc.

  1504   1504     $(TOP)\test\fuzzdata5.db
  1505   1505   # <</mark>>
  1506   1506   
  1507   1507   # Additional compiler options for the shell.  These are only effective
  1508   1508   # when the shell is not being dynamically linked.
  1509   1509   #
  1510   1510   !IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
  1511         -SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_STMTVTAB
         1511  +SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_STMTVTAB
  1512   1512   !ENDIF
  1513   1513   
  1514   1514   # <<mark>>
  1515   1515   # Extra compiler options for various test tools.
  1516   1516   #
  1517         -MPTESTER_COMPILE_OPTS = -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS5
         1517  +MPTESTER_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5
  1518   1518   FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1
  1519   1519   FUZZCHECK_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ -DSQLITE_MAX_MEMORY=50000000
  1520   1520   FUZZCHECK_SRC = $(TOP)\test\fuzzcheck.c $(TOP)\test\ossfuzz.c
  1521   1521   OSSSHELL_SRC = $(TOP)\test\ossshell.c $(TOP)\test\ossfuzz.c
  1522   1522   DBFUZZ_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION
  1523   1523   KV_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_DIRECT_OVERFLOW_READ
  1524   1524   DBSELFTEST_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5

Changes to autoconf/Makefile.msc.

   923    923   !ENDIF
   924    924   
   925    925   
   926    926   # Additional compiler options for the shell.  These are only effective
   927    927   # when the shell is not being dynamically linked.
   928    928   #
   929    929   !IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
   930         -SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_STMTVTAB
          930  +SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_STMTVTAB
   931    931   !ENDIF
   932    932   
   933    933   
   934    934   # This is the default Makefile target.  The objects listed here
   935    935   # are what get build when you type just "make" with no arguments.
   936    936   #
   937    937   all:	dll shell

Changes to src/btree.c.

  2036   2036   ** error, return ((unsigned int)-1).
  2037   2037   */
  2038   2038   static Pgno btreePagecount(BtShared *pBt){
  2039   2039     return pBt->nPage;
  2040   2040   }
  2041   2041   u32 sqlite3BtreeLastPage(Btree *p){
  2042   2042     assert( sqlite3BtreeHoldsMutex(p) );
  2043         -  assert( ((p->pBt->nPage)&0x8000000)==0 );
         2043  +  assert( ((p->pBt->nPage)&0x80000000)==0 );
  2044   2044     return btreePagecount(p->pBt);
  2045   2045   }
  2046   2046   
  2047   2047   /*
  2048   2048   ** Get a page from the pager and initialize it.
  2049   2049   **
  2050   2050   ** If pCur!=0 then the page is being fetched as part of a moveToChild()

Changes to src/shell.c.

  3797   3797           isIPK = 1;
  3798   3798         }else{
  3799   3799           isIPK = 0;
  3800   3800         }
  3801   3801       }
  3802   3802     }
  3803   3803     sqlite3_finalize(pStmt);
  3804         -  if( !azCol ) return 0;
         3804  +  if( azCol==0 ) return 0;
  3805   3805     azCol[0] = 0;
  3806   3806     azCol[nCol+1] = 0;
  3807   3807   
  3808   3808     /* The decision of whether or not a rowid really needs to be preserved
  3809   3809     ** is tricky.  We never need to preserve a rowid for a WITHOUT ROWID table
  3810   3810     ** or a table with an INTEGER PRIMARY KEY.  We are unable to preserve
  3811   3811     ** rowids on tables where the rowid is inaccessible because there are other

Changes to src/shell.c.in.

  2437   2437           isIPK = 1;
  2438   2438         }else{
  2439   2439           isIPK = 0;
  2440   2440         }
  2441   2441       }
  2442   2442     }
  2443   2443     sqlite3_finalize(pStmt);
         2444  +  if( azCol==0 ) return 0;
  2444   2445     azCol[0] = 0;
  2445   2446     azCol[nCol+1] = 0;
  2446   2447   
  2447   2448     /* The decision of whether or not a rowid really needs to be preserved
  2448   2449     ** is tricky.  We never need to preserve a rowid for a WITHOUT ROWID table
  2449   2450     ** or a table with an INTEGER PRIMARY KEY.  We are unable to preserve
  2450   2451     ** rowids on tables where the rowid is inaccessible because there are other