/ Check-in [c785cd78]
Login

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

Overview
Comment:Merge in last-minute patches for the 3.10.0 beta.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sessions
Files: files | file ages | folders
SHA1: c785cd7813e4ef6d6f2cb362a0f822713db6bcea
User & Date: drh 2016-01-04 19:02:47
Context
2016-01-06
15:14
Merge changes for version 3.10.0. check-in: fa4705c9 user: drh tags: sessions
2016-01-04
19:02
Merge in last-minute patches for the 3.10.0 beta. check-in: c785cd78 user: drh tags: sessions
13:06
Fix the conflict2.test module which was broken by check-in [e30062e9f6c]. check-in: b779ca8a user: drh tags: trunk
2016-01-01
13:25
Merge the latest enhancements from trunk. check-in: c0be246a user: drh tags: sessions
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/build.c.

  1770   1770     assert( pPk!=0 );
  1771   1771     nPk = pPk->nKeyCol;
  1772   1772   
  1773   1773     /* Make sure every column of the PRIMARY KEY is NOT NULL.  (Except,
  1774   1774     ** do not enforce this for imposter tables.) */
  1775   1775     if( !db->init.imposterTable ){
  1776   1776       for(i=0; i<nPk; i++){
  1777         -      pTab->aCol[pPk->aiColumn[i]].notNull = 1;
         1777  +      pTab->aCol[pPk->aiColumn[i]].notNull = OE_Abort;
  1778   1778       }
  1779   1779       pPk->uniqNotNull = 1;
  1780   1780     }
  1781   1781   
  1782   1782     /* The root page of the PRIMARY KEY is the table root page */
  1783   1783     pPk->tnum = pTab->tnum;
  1784   1784   

Changes to src/shell.c.

   378    378   static void SQLITE_CDECL iotracePrintf(const char *zFormat, ...){
   379    379     va_list ap;
   380    380     char *z;
   381    381     if( iotrace==0 ) return;
   382    382     va_start(ap, zFormat);
   383    383     z = sqlite3_vmprintf(zFormat, ap);
   384    384     va_end(ap);
   385         -  utf8_printf(iotrace, "%s", z);
          385  +  fprintf(iotrace, "%s", z);
   386    386     sqlite3_free(z);
   387    387   }
   388    388   #endif
   389    389   
   390    390   
   391    391   /*
   392    392   ** Determines if a string is a number of not.

Changes to src/sqliteInt.h.

  2736   2736     int iRangeReg;       /* First register in temporary register block */
  2737   2737     int nErr;            /* Number of errors seen */
  2738   2738     int nTab;            /* Number of previously allocated VDBE cursors */
  2739   2739     int nMem;            /* Number of memory cells used so far */
  2740   2740     int nSet;            /* Number of sets used so far */
  2741   2741     int nOnce;           /* Number of OP_Once instructions so far */
  2742   2742     int nOpAlloc;        /* Number of slots allocated for Vdbe.aOp[] */
         2743  +  int szOpAlloc;       /* Bytes of memory space allocated for Vdbe.aOp[] */
  2743   2744     int iFixedOp;        /* Never back out opcodes iFixedOp-1 or earlier */
  2744   2745     int ckBase;          /* Base register of data during check constraints */
  2745   2746     int iSelfTab;        /* Table of an index whose exprs are being coded */
  2746   2747     int iCacheLevel;     /* ColCache valid when aColCache[].iLevel<=iCacheLevel */
  2747   2748     int iCacheCnt;       /* Counter used to generate aColCache[].lru values */
  2748   2749     int nLabel;          /* Number of labels used */
  2749   2750     int *aLabel;         /* Space to hold the labels */
................................................................................
  2971   2972   ** An objected used to accumulate the text of a string where we
  2972   2973   ** do not necessarily know how big the string will be in the end.
  2973   2974   */
  2974   2975   struct StrAccum {
  2975   2976     sqlite3 *db;         /* Optional database for lookaside.  Can be NULL */
  2976   2977     char *zBase;         /* A base allocation.  Not from malloc. */
  2977   2978     char *zText;         /* The string collected so far */
  2978         -  int  nChar;          /* Length of the string so far */
  2979         -  int  nAlloc;         /* Amount of space allocated in zText */
  2980         -  int  mxAlloc;        /* Maximum allowed allocation.  0 for no malloc usage */
         2979  +  u32  nChar;          /* Length of the string so far */
         2980  +  u32  nAlloc;         /* Amount of space allocated in zText */
         2981  +  u32  mxAlloc;        /* Maximum allowed allocation.  0 for no malloc usage */
  2981   2982     u8   accError;       /* STRACCUM_NOMEM or STRACCUM_TOOBIG */
  2982   2983     u8   bMalloced;      /* zText points to allocated space */
  2983   2984   };
  2984   2985   #define STRACCUM_NOMEM   1
  2985   2986   #define STRACCUM_TOOBIG  2
  2986   2987   
  2987   2988   /*

Changes to src/vdbe.c.

  2530   2530         if( (zHdr>=zEndHdr && (zHdr>zEndHdr || offset64!=pC->payloadSize))
  2531   2531          || (offset64 > pC->payloadSize)
  2532   2532         ){
  2533   2533           rc = SQLITE_CORRUPT_BKPT;
  2534   2534           goto op_column_error;
  2535   2535         }
  2536   2536       }else{
  2537         -      VVA_ONLY( t = 0; ) /* Only needed by assert() statements */
         2537  +      t = 0;
  2538   2538       }
  2539   2539   
  2540   2540       /* If after trying to extract new entries from the header, nHdrParsed is
  2541   2541       ** still not up to p2, that means that the record has fewer than p2
  2542   2542       ** columns.  So the result will be either the default value or a NULL.
  2543   2543       */
  2544   2544       if( pC->nHdrParsed<=p2 ){
................................................................................
  3408   3408     ** since moved into the btree layer.  */  
  3409   3409     pCur->isTable = pOp->p4type!=P4_KEYINFO;
  3410   3410   
  3411   3411   open_cursor_set_hints:
  3412   3412     assert( OPFLAG_BULKCSR==BTREE_BULKLOAD );
  3413   3413     assert( OPFLAG_SEEKEQ==BTREE_SEEK_EQ );
  3414   3414     testcase( pOp->p5 & OPFLAG_BULKCSR );
  3415         -#ifdef SQLITE_ENABLE_CURSOR_HINT
         3415  +#ifdef SQLITE_ENABLE_CURSOR_HINTS
  3416   3416     testcase( pOp->p2 & OPFLAG_SEEKEQ );
  3417   3417   #endif
  3418   3418     sqlite3BtreeCursorHintFlags(pCur->uc.pCursor,
  3419   3419                                  (pOp->p5 & (OPFLAG_BULKCSR|OPFLAG_SEEKEQ)));
  3420   3420     break;
  3421   3421   }
  3422   3422   

Changes to src/vdbeaux.c.

    31     31     p->pPrev = 0;
    32     32     db->pVdbe = p;
    33     33     p->magic = VDBE_MAGIC_INIT;
    34     34     p->pParse = pParse;
    35     35     assert( pParse->aLabel==0 );
    36     36     assert( pParse->nLabel==0 );
    37     37     assert( pParse->nOpAlloc==0 );
           38  +  assert( pParse->szOpAlloc==0 );
    38     39     return p;
    39     40   }
    40     41   
    41     42   /*
    42     43   ** Change the error string stored in Vdbe.zErrMsg
    43     44   */
    44     45   void sqlite3VdbeError(Vdbe *p, const char *zFormat, ...){
................................................................................
   121    122     UNUSED_PARAMETER(nOp);
   122    123   #endif
   123    124   
   124    125     assert( nOp<=(1024/sizeof(Op)) );
   125    126     assert( nNew>=(p->nOpAlloc+nOp) );
   126    127     pNew = sqlite3DbRealloc(p->db, v->aOp, nNew*sizeof(Op));
   127    128     if( pNew ){
   128         -    p->nOpAlloc = sqlite3DbMallocSize(p->db, pNew)/sizeof(Op);
          129  +    p->szOpAlloc = sqlite3DbMallocSize(p->db, pNew);
          130  +    p->nOpAlloc = p->szOpAlloc/sizeof(Op);
   129    131       v->aOp = pNew;
   130    132     }
   131    133     return (pNew ? SQLITE_OK : SQLITE_NOMEM);
   132    134   }
   133    135   
   134    136   #ifdef SQLITE_DEBUG
   135    137   /* This routine is just a convenient place to set a breakpoint that will
................................................................................
  1846   1848     ** See also: allocateCursor().
  1847   1849     */
  1848   1850     nMem += nCursor;
  1849   1851   
  1850   1852     /* Allocate space for memory registers, SQL variables, VDBE cursors and 
  1851   1853     ** an array to marshal SQL function arguments in.
  1852   1854     */
  1853         -  zCsr = (u8*)&p->aOp[p->nOp];            /* Memory avaliable for allocation */
  1854         -  assert( pParse->nOpAlloc*sizeof(Op) <= 0x7fffff00 );
  1855         -  nFree = (pParse->nOpAlloc - p->nOp)*sizeof(p->aOp[0]); /* Available space */
         1855  +  zCsr = ((u8*)p->aOp) + ROUND8(sizeof(Op)*p->nOp);      /* Available space */
         1856  +  nFree = pParse->szOpAlloc - ROUND8(sizeof(Op)*p->nOp); /* Size of zCsr */
  1856   1857   
  1857   1858     resolveP2Values(p, &nArg);
  1858   1859     p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort);
  1859   1860     if( pParse->explain && nMem<10 ){
  1860   1861       nMem = 10;
  1861   1862     }
  1862   1863     memset(zCsr, 0, nFree);

Changes to test/analyzeF.test.

   102    102   proc throw_error {err} { error $err }
   103    103   db func error -deterministic throw_error
   104    104   do_catchsql_test 4.1 {
   105    105     SELECT * FROM t1 WHERE x = error('error one') AND y = 4;
   106    106   } {1 {error one}}
   107    107   
   108    108   do_catchsql_test 4.2 {
   109         -  SELECT * FROM t1 WHERE x = zeroblob(2000000000) AND y = 4;
          109  +  SELECT * FROM t1 WHERE x = zeroblob(2200000000) AND y = 4;
   110    110   } {1 {string or blob too big}}
   111    111   
   112    112   sqlite3_limit db SQLITE_LIMIT_LENGTH 1000000
   113    113   proc dstr {} { return [string repeat x 1100000] }
   114    114   db func dstr -deterministic dstr
   115    115   do_catchsql_test 4.3 {
   116    116     SELECT * FROM t1 WHERE x = dstr() AND y = 11;
................................................................................
   118    118   
   119    119   do_catchsql_test 4.4 {
   120    120     SELECT * FROM t1 WHERE x = test_zeroblob(1100000) AND y = 4;
   121    121   } {1 {string or blob too big}}
   122    122   
   123    123   
   124    124   finish_test
   125         -
   126         -
   127         -

Changes to test/conflict2.test.

   285    285   #   t4     Number of temporary files for statement journals
   286    286   #
   287    287   # Update: Since temporary table files are now opened lazily, and none
   288    288   # of the following tests use large quantities of data, t3 is always 0.
   289    289   #
   290    290   foreach {i conf1 cmd t0 t1 t2 t3 t4} {
   291    291     1 {}       UPDATE                  1 {6 7 8 9}  1 0 1
   292         -  2 REPLACE  UPDATE                  0 {7 6 9}    1 0 0
   293         -  3 IGNORE   UPDATE                  0 {6 7 3 9}  1 0 0
   294         -  4 FAIL     UPDATE                  1 {6 7 3 4}  1 0 0
          292  +  2 REPLACE  UPDATE                  0 {7 6 9}    1 0 1
          293  +  3 IGNORE   UPDATE                  0 {6 7 3 9}  1 0 1
          294  +  4 FAIL     UPDATE                  1 {6 7 3 4}  1 0 1
   295    295     5 ABORT    UPDATE                  1 {1 2 3 4}  1 0 1
   296         -  6 ROLLBACK UPDATE                  1 {1 2 3 4}  0 0 0
          296  +  6 ROLLBACK UPDATE                  1 {1 2 3 4}  0 0 1
   297    297     7 REPLACE  {UPDATE OR IGNORE}      0 {6 7 3 9}  1 0 0
   298    298     8 IGNORE   {UPDATE OR REPLACE}     0 {7 6 9}    1 0 1
   299    299     9 FAIL     {UPDATE OR IGNORE}      0 {6 7 3 9}  1 0 0
   300    300    10 ABORT    {UPDATE OR REPLACE}     0 {7 6 9}    1 0 1
   301    301    11 ROLLBACK {UPDATE OR IGNORE}      0 {6 7 3 9}  1 0 0
   302    302    12 {}       {UPDATE OR IGNORE}      0 {6 7 3 9}  1 0 0
   303    303    13 {}       {UPDATE OR REPLACE}     0 {7 6 9}    1 0 1

Changes to test/cursorhint.test.

    42     42     }
    43     43     return $res
    44     44   }
    45     45   
    46     46   # Run EXPLAIN on $sql.  Return a list of P5 values for all $opcode
    47     47   # opcodes that contain regexp $comment in their comment
    48     48   #
    49         -proc p5_of_opcode {db opcode comment sql} {
           49  +proc p5_of_opcode {db opcode sql} {
    50     50     set res {}
    51     51     $db eval "EXPLAIN $sql" x {
    52         -    if {$x(opcode)==$opcode && [regexp $comment $x(comment)]} {
           52  +    if {$x(opcode)==$opcode} {
    53     53         lappend res $x(p5)
    54     54       }
    55     55     }
    56     56     return $res
    57     57   }
    58     58   
    59     59   # Verify that when t1 is in the outer loop and t2 is in the inner loop,
................................................................................
    62     62   #
    63     63   do_test 1.1 {
    64     64     p4_of_opcode db CursorHint {
    65     65        SELECT * FROM t1 CROSS JOIN t2 WHERE a=x
    66     66     }
    67     67   } {{EQ(r[1],c0)}}
    68     68   do_test 1.2 {
    69         -  p5_of_opcode db OpenRead . {
           69  +  p5_of_opcode db OpenRead {
    70     70        SELECT * FROM t1 CROSS JOIN t2 WHERE a=x
    71     71     }
    72     72   } {00 00}
    73     73   
    74     74   # Do the same test the other way around.
    75     75   #
    76     76   do_test 2.1 {
    77     77     p4_of_opcode db CursorHint {
    78     78        SELECT * FROM t2 CROSS JOIN t1 WHERE a=x
    79     79     }
    80     80   } {{EQ(c0,r[1])}}
    81     81   do_test 2.2 {
    82         -  p5_of_opcode db OpenRead . {
           82  +  p5_of_opcode db OpenRead {
    83     83        SELECT * FROM t2 CROSS JOIN t1 WHERE a=x
    84     84     }
    85     85   } {00 00}
    86     86   
    87     87   # Various expressions captured by CursorHint
    88     88   #
    89     89   do_test 3.1 {
................................................................................
   110    110   } {}
   111    111   do_test 4.1desc {
   112    112     p4_of_opcode db CursorHint {
   113    113       SELECT * FROM t1 WHERE b>11 ORDER BY b DESC;
   114    114     }
   115    115   } {GT(c0,11)}
   116    116   do_test 4.2 {
   117         -  p5_of_opcode db OpenRead . {
          117  +  p5_of_opcode db OpenRead {
   118    118       SELECT * FROM t1 WHERE b>11;
   119    119     }
   120    120   } {02 00}
   121    121   do_test 4.3asc {
   122    122     p4_of_opcode db CursorHint {
   123    123       SELECT c FROM t1 WHERE b<11 ORDER BY b ASC;
   124    124     }
................................................................................
   125    125   } {LT(c0,11)}
   126    126   do_test 4.3desc {
   127    127     p4_of_opcode db CursorHint {
   128    128       SELECT c FROM t1 WHERE b<11 ORDER BY b DESC;
   129    129     }
   130    130   } {}
   131    131   do_test 4.4 {
   132         -  p5_of_opcode db OpenRead . {
          132  +  p5_of_opcode db OpenRead {
   133    133       SELECT c FROM t1 WHERE b<11;
   134    134     }
   135    135   } {00}
   136    136   
   137    137   do_test 4.5asc {
   138    138     p4_of_opcode db CursorHint {
   139    139       SELECT c FROM t1 WHERE b>=10 AND b<=20 ORDER BY b ASC;

Changes to test/releasetest.tcl.

    82     82       -DSQLITE_SOUNDEX=1
    83     83     }
    84     84     "Update-Delete-Limit" {
    85     85       -O2
    86     86       -DSQLITE_DEFAULT_FILE_FORMAT=4
    87     87       -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1
    88     88       -DSQLITE_ENABLE_STMT_SCANSTATUS
           89  +    -DSQLITE_LIKE_DOESNT_MATCH_BLOBS
           90  +    -DSQLITE_ENABLE_CURSOR_HINTS
    89     91       --enable-json1
    90     92     }
    91     93     "Check-Symbols" {
    92     94       -DSQLITE_MEMDEBUG=1
    93     95       -DSQLITE_ENABLE_FTS3_PARENTHESIS=1
    94     96       -DSQLITE_ENABLE_FTS3=1
    95     97       -DSQLITE_ENABLE_RTREE=1
................................................................................
   826    828         -enable-* -
   827    829         -disable-* -
   828    830         *=* {
   829    831           lappend ::EXTRACONFIG [lindex $argv $i]
   830    832         }
   831    833   
   832    834         default {
   833         -        PUTSERR stderr ""
   834         -        PUTSERR stderr [string trim $::USAGE_MESSAGE]
          835  +        PUTSERR ""
          836  +        PUTSERR [string trim $::USAGE_MESSAGE]
   835    837           exit -1
   836    838         }
   837    839       }
   838    840     }
   839    841   
   840    842     if {0==[info exists ::Platforms($platform)]} {
   841    843       PUTS "Unknown platform: $platform"
................................................................................
   941    943     run_all_test_suites $all
   942    944   
   943    945     set elapsetime [expr {[clock seconds]-$STARTTIME}]
   944    946     set hr [expr {$elapsetime/3600}]
   945    947     set min [expr {($elapsetime/60)%60}]
   946    948     set sec [expr {$elapsetime%60}]
   947    949     set etime [format (%02d:%02d:%02d) $hr $min $sec]
          950  +  if {$::JOBS>1} {append etime " $::JOBS cores"}
          951  +  if {[catch {exec hostname} HNAME]==0} {append etime " on $HNAME"}
   948    952     PUTS [string repeat * 79]
   949    953     incr ::NERRCASE $::NERR
   950    954     PUTS "$::NERRCASE failures out of $::NTESTCASE tests in $etime"
   951    955     if {$::SQLITE_VERSION ne ""} {
   952    956       PUTS "SQLite $::SQLITE_VERSION"
   953    957     }
   954    958   }
   955    959   
   956    960   main $argv

Changes to test/vtabH.test.

   138    138         }
   139    139         return $res
   140    140       } else {
   141    141         return [glob -nocomplain $pattern]
   142    142       }
   143    143     }
   144    144   
   145         -  # Read the first 5 entries from the root directory.
          145  +  # Read the first 5 entries from the root directory.  Except, ignore
          146  +  # files that contain the "$" character in their names as these are
          147  +  # special files on some Windows platforms.
   146    148     #
   147    149     set res [list]
   148    150     foreach p [lrange [list_root_files] 0 4] {
   149    151       if {$::tcl_platform(platform) eq "windows"} {
   150         -      lappend res $p
          152  +      if {![regexp {\$} $p]} {lappend res $p}
   151    153       } else {
   152    154         lappend res "/$p"
   153    155       }
   154    156     }
   155    157     do_execsql_test 3.1 {
   156         -    SELECT path FROM fstree LIMIT 5;
          158  +    SELECT path FROM fstree WHERE path NOT GLOB '*$*' LIMIT 5;
   157    159     } $res
   158    160     
   159    161     # Read all entries in the current directory.
   160    162     #
   161    163     proc contents {pattern} {
   162    164       set res [list]
   163    165       foreach f [list_files $pattern] {

Changes to test/without_rowid5.test.

   128    128   # PRIMARY KEY" do not apply on WITHOUT ROWID tables.
   129    129   #
   130    130   do_execsql_test without_rowid5-5.1 {
   131    131     CREATE TABLE ipk(key INTEGER PRIMARY KEY, val TEXT) WITHOUT ROWID;
   132    132     INSERT INTO ipk VALUES('rival','bonus'); -- ok to insert non-integer key
   133    133     SELECT * FROM ipk;
   134    134   } {rival bonus}
   135         -do_catchsql_test without_rowid5-5.2 {
          135  +do_catchsql_test without_rowid5-5.2a {
          136  +  BEGIN;
   136    137     INSERT INTO ipk VALUES(NULL,'sample'); -- no automatic generation of keys
   137    138   } {1 {NOT NULL constraint failed: ipk.key}}
          139  +do_execsql_test without_rowid5-5.2b {
          140  +  ROLLBACK;
          141  +} {}
   138    142   
   139    143   # EVIDENCE-OF: R-33142-02092 AUTOINCREMENT does not work on WITHOUT
   140    144   # ROWID tables.
   141    145   #
   142    146   # EVIDENCE-OF: R-53084-07740 An error is raised if the "AUTOINCREMENT"
   143    147   # keyword is used in the CREATE TABLE statement for a WITHOUT ROWID
   144    148   # table.