SQLite

Check-in [46fec9b1a1]
Login

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

Overview
Comment:Make sure the ANALYZE command allocates enough VDBE registers.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | sqlite_stat4
Files: files | file ages | folders
SHA1: 46fec9b1a1c4616df5a634dbf9235bd13408d3a9
User & Date: drh 2013-08-15 16:15:00.074
Context
2013-08-15
16:18
Change some assert() statements in vdbe.c to ensure that a memory cell used to store a VdbeCursor object is not also used for some other purpose. (check-in: 71070c9fce user: dan tags: sqlite_stat4)
16:15
Make sure the ANALYZE command allocates enough VDBE registers. (check-in: 46fec9b1a1 user: drh tags: sqlite_stat4)
14:39
Add tests for sqlite_stat4 sample selection. And a fix for the same. (check-in: 1fb4d9d6f2 user: dan tags: sqlite_stat4)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/analyze.c.
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
  int regChng = iMem++;        /* Index of changed index field */
  int regTemp = iMem++;        /* Temporary use register */
  int regTabname = iMem++;     /* Register containing table name */
  int regIdxname = iMem++;     /* Register containing index name */
  int regStat1 = iMem++;       /* Value for the stat column of sqlite_stat1 */
  int regPrev = iMem;          /* MUST BE LAST (see below) */

  pParse->nMem = MAX(pParse->nMem, regChng);
  v = sqlite3GetVdbe(pParse);
  if( v==0 || NEVER(pTab==0) ){
    return;
  }
  if( pTab->tnum==0 ){
    /* Do not gather statistics on views or virtual tables */
    return;







|







780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
  int regChng = iMem++;        /* Index of changed index field */
  int regTemp = iMem++;        /* Temporary use register */
  int regTabname = iMem++;     /* Register containing table name */
  int regIdxname = iMem++;     /* Register containing index name */
  int regStat1 = iMem++;       /* Value for the stat column of sqlite_stat1 */
  int regPrev = iMem;          /* MUST BE LAST (see below) */

  pParse->nMem = MAX(pParse->nMem, iMem);
  v = sqlite3GetVdbe(pParse);
  if( v==0 || NEVER(pTab==0) ){
    return;
  }
  if( pTab->tnum==0 ){
    /* Do not gather statistics on views or virtual tables */
    return;