/ Check-in [18c3ab47]
Login

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

Overview
Comment:Merge the master-journal optimization and other recent changes from trunk.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | apple-osx
Files: files | file ages | folders
SHA1: 18c3ab4784a4efab2cc583ef712c4db9d127418a
User & Date: drh 2016-02-22 16:32:39
Context
2016-02-26
16:14
Merge all recent enhancements from trunk, and in particular the SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER change. check-in: 4fb4aee8 user: drh tags: apple-osx
2016-02-22
16:32
Merge the master-journal optimization and other recent changes from trunk. check-in: 18c3ab47 user: drh tags: apple-osx
16:04
Always use the sqlite3VdbeDeleteAuxdata() routine for clearing auxdata on function parameter, rather than having a separate deleteAuxdataFromFrame() for doing the job for trigger frames. check-in: 64386fa3 user: drh tags: trunk
2016-02-18
14:53
Merge the tokenizer buffer overrun bug-fix from trunk. check-in: 82e7e31b user: drh tags: apple-osx
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.msc.

   215    215   !IFNDEF SQLITE3H
   216    216   SQLITE3H = sqlite3.h
   217    217   !ENDIF
   218    218   
   219    219   # This is the name to use for the SQLite dynamic link library (DLL).
   220    220   #
   221    221   !IFNDEF SQLITE3DLL
          222  +!IF $(FOR_WIN10)!=0
          223  +SQLITE3DLL = winsqlite3.dll
          224  +!ELSE
   222    225   SQLITE3DLL = sqlite3.dll
          226  +!ENDIF
   223    227   !ENDIF
   224    228   
   225    229   # This is the name to use for the SQLite import library (LIB).
   226    230   #
   227    231   !IFNDEF SQLITE3LIB
          232  +!IF $(FOR_WIN10)!=0
          233  +SQLITE3LIB = winsqlite3.lib
          234  +!ELSE
   228    235   SQLITE3LIB = sqlite3.lib
          236  +!ENDIF
   229    237   !ENDIF
   230    238   
   231    239   # This is the name to use for the SQLite shell executable (EXE).
   232    240   #
   233    241   !IFNDEF SQLITE3EXE
          242  +!IF $(FOR_WIN10)!=0
          243  +SQLITE3EXE = winsqlite3shell.exe
          244  +!ELSE
   234    245   SQLITE3EXE = sqlite3.exe
          246  +!ENDIF
   235    247   !ENDIF
   236    248   
   237    249   # This is the argument used to set the program database (PDB) file for the
   238    250   # SQLite shell executable (EXE).
   239    251   #
   240    252   !IFNDEF SQLITE3EXEPDB
          253  +!IF $(FOR_WIN10)!=0
          254  +SQLITE3EXEPDB =
          255  +!ELSE
   241    256   SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
          257  +!ENDIF
   242    258   !ENDIF
   243    259   
   244    260   # These are the "standard" SQLite compilation options used when compiling for
   245    261   # the Windows platform.
   246    262   #
   247    263   !IFNDEF OPT_FEATURE_FLAGS
   248    264   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
................................................................................
   413    429   !ELSE
   414    430   TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
   415    431   !ENDIF
   416    432   
   417    433   TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise
   418    434   RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src $(RCOPTS) $(RCCOPTS)
   419    435   
   420         -# Adjust the names of the primary targets for use with Windows 10.
   421         -#
   422         -!IF $(FOR_WIN10)!=0
   423         -SQLITE3DLL = winsqlite3.dll
   424         -SQLITE3LIB = winsqlite3.lib
   425         -SQLITE3EXE = winsqlite3shell.exe
   426         -SQLITE3EXEPDB =
   427         -!ENDIF
   428         -
   429    436   # Check if we want to use the "stdcall" calling convention when compiling.
   430    437   # This is not supported by the compilers for non-x86 platforms.  It should
   431    438   # also be noted here that building any target with these "stdcall" options
   432    439   # will most likely fail if the Tcl library is also required.  This is due
   433    440   # to how the Tcl library functions are declared and exported (i.e. without
   434    441   # an explicit calling convention, which results in "cdecl").
   435    442   #
................................................................................
  1382   1389   #
  1383   1390   dll: $(SQLITE3DLL)
  1384   1391   
  1385   1392   # Shell executable.
  1386   1393   #
  1387   1394   shell: $(SQLITE3EXE)
  1388   1395   
         1396  +# <<mark>>
  1389   1397   libsqlite3.lib:	$(LIBOBJ)
  1390   1398   	$(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
  1391   1399   
  1392         -# <<mark>>
  1393   1400   libtclsqlite3.lib:	tclsqlite.lo libsqlite3.lib
  1394   1401   	$(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
  1395   1402   # <</mark>>
  1396   1403   
  1397   1404   $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
  1398   1405   	$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
  1399   1406   
................................................................................
  2021   2028   rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H)
  2022   2029   	$(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU -Fe$@ \
  2023   2030   		$(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
  2024   2031   # <</mark>>
  2025   2032   
  2026   2033   clean:
  2027   2034   	del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
  2028         -	del /Q *.bsc *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
         2035  +	del /Q *.bsc *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
         2036  +	del /Q $(SQLITE3EXE) $(SQLITE3DLL) 2>NUL
  2029   2037   # <<mark>>
  2030   2038   	del /Q $(SQLITE3C) $(SQLITE3H) opcodes.c opcodes.h 2>NUL
  2031   2039   	del /Q lemon.* lempar.c parse.* 2>NUL
  2032   2040   	del /Q mkkeywordhash.* keywordhash.h 2>NUL
  2033   2041   	del /Q notasharedlib.* 2>NUL
  2034   2042   	-rmdir /Q/S .deps 2>NUL
  2035   2043   	-rmdir /Q/S .libs 2>NUL
................................................................................
  2040   2048   	del /Q .target_source 2>NUL
  2041   2049   	del /Q tclsqlite3.exe 2>NUL
  2042   2050   	del /Q testloadext.dll 2>NUL
  2043   2051   	del /Q testfixture.exe test.db 2>NUL
  2044   2052   	del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe 2>NUL
  2045   2053   	del /Q showjournal.exe showstat4.exe showwal.exe speedtest1.exe 2>NUL
  2046   2054   	del /Q mptester.exe wordcount.exe rbu.exe srcck1.exe 2>NUL
  2047         -	del /Q $(SQLITE3EXE) $(SQLITE3DLL) sqlite3.def 2>NUL
  2048   2055   	del /Q sqlite3.c sqlite3-*.c 2>NUL
  2049   2056   	del /Q sqlite3rc.h 2>NUL
  2050   2057   	del /Q shell.c sqlite3ext.h 2>NUL
  2051   2058   	del /Q sqlite3_analyzer.exe sqlite3_analyzer.c 2>NUL
  2052   2059   	del /Q sqlite-*-output.vsix 2>NUL
  2053   2060   	del /Q fuzzershell.exe fuzzcheck.exe sqldiff.exe 2>NUL
  2054   2061   	del /Q fts5.* fts5parse.* 2>NUL
  2055   2062   # <</mark>>

Changes to autoconf/Makefile.msc.

   200    200   !IFNDEF SQLITE3H
   201    201   SQLITE3H = sqlite3.h
   202    202   !ENDIF
   203    203   
   204    204   # This is the name to use for the SQLite dynamic link library (DLL).
   205    205   #
   206    206   !IFNDEF SQLITE3DLL
          207  +!IF $(FOR_WIN10)!=0
          208  +SQLITE3DLL = winsqlite3.dll
          209  +!ELSE
   207    210   SQLITE3DLL = sqlite3.dll
          211  +!ENDIF
   208    212   !ENDIF
   209    213   
   210    214   # This is the name to use for the SQLite import library (LIB).
   211    215   #
   212    216   !IFNDEF SQLITE3LIB
          217  +!IF $(FOR_WIN10)!=0
          218  +SQLITE3LIB = winsqlite3.lib
          219  +!ELSE
   213    220   SQLITE3LIB = sqlite3.lib
          221  +!ENDIF
   214    222   !ENDIF
   215    223   
   216    224   # This is the name to use for the SQLite shell executable (EXE).
   217    225   #
   218    226   !IFNDEF SQLITE3EXE
          227  +!IF $(FOR_WIN10)!=0
          228  +SQLITE3EXE = winsqlite3shell.exe
          229  +!ELSE
   219    230   SQLITE3EXE = sqlite3.exe
          231  +!ENDIF
   220    232   !ENDIF
   221    233   
   222    234   # This is the argument used to set the program database (PDB) file for the
   223    235   # SQLite shell executable (EXE).
   224    236   #
   225    237   !IFNDEF SQLITE3EXEPDB
          238  +!IF $(FOR_WIN10)!=0
          239  +SQLITE3EXEPDB =
          240  +!ELSE
   226    241   SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
          242  +!ENDIF
   227    243   !ENDIF
   228    244   
   229    245   # These are the "standard" SQLite compilation options used when compiling for
   230    246   # the Windows platform.
   231    247   #
   232    248   !IFNDEF OPT_FEATURE_FLAGS
   233    249   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
................................................................................
   398    414   !ELSE
   399    415   TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
   400    416   !ENDIF
   401    417   
   402    418   TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -fp:precise
   403    419   RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) $(RCOPTS) $(RCCOPTS)
   404    420   
   405         -# Adjust the names of the primary targets for use with Windows 10.
   406         -#
   407         -!IF $(FOR_WIN10)!=0
   408         -SQLITE3DLL = winsqlite3.dll
   409         -SQLITE3LIB = winsqlite3.lib
   410         -SQLITE3EXE = winsqlite3shell.exe
   411         -SQLITE3EXEPDB =
   412         -!ENDIF
   413         -
   414    421   # Check if we want to use the "stdcall" calling convention when compiling.
   415    422   # This is not supported by the compilers for non-x86 platforms.  It should
   416    423   # also be noted here that building any target with these "stdcall" options
   417    424   # will most likely fail if the Tcl library is also required.  This is due
   418    425   # to how the Tcl library functions are declared and exported (i.e. without
   419    426   # an explicit calling convention, which results in "cdecl").
   420    427   #
................................................................................
   859    866   SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS
   860    867   !ENDIF
   861    868   
   862    869   
   863    870   # This is the default Makefile target.  The objects listed here
   864    871   # are what get build when you type just "make" with no arguments.
   865    872   #
   866         -all:	dll libsqlite3.lib shell
          873  +all:	dll shell
   867    874   
   868    875   # Dynamic link library section.
   869    876   #
   870    877   dll: $(SQLITE3DLL)
   871    878   
   872    879   # Shell executable.
   873    880   #
   874    881   shell: $(SQLITE3EXE)
   875    882   
   876         -libsqlite3.lib:	$(LIBOBJ)
   877         -	$(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
   878         -
   879    883   
   880    884   $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
   881    885   	$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
   882    886   
   883    887   
   884    888   $(SQLITE3EXE):	$(TOP)\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)
   885    889   	$(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\shell.c $(SHELL_CORE_SRC) \
................................................................................
   914    918   	echo #endif >> sqlite3rc.h
   915    919   	$(LTRCOMPILE) -fo $(LIBRESOBJS) -DRC_VERONLY $(TOP)\sqlite3.rc
   916    920   !ENDIF
   917    921   
   918    922   
   919    923   clean:
   920    924   	del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
   921         -	del /Q *.bsc *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
          925  +	del /Q *.bsc *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
          926  +	del /Q $(SQLITE3EXE) $(SQLITE3DLL) 2>NUL

Changes to ext/fts3/fts3_test.c.

   522    522     Tcl_Interp *interp,
   523    523     int objc,
   524    524     Tcl_Obj *CONST objv[]
   525    525   ){
   526    526   #ifdef SQLITE_ENABLE_FTS3
   527    527     char aBuf[24];
   528    528     int rc;
   529         -  Tcl_WideInt w, w2;
          529  +  Tcl_WideInt w;
          530  +  sqlite3_int64 w2;
   530    531     int nByte, nByte2;
   531    532   
   532    533     if( objc!=2 ){
   533    534       Tcl_WrongNumArgs(interp, 1, objv, "INTEGER");
   534    535       return TCL_ERROR;
   535    536     }
   536    537   

Changes to ext/fts5/fts5_test_mi.c.

    44     44   #ifdef SQLITE_ENABLE_FTS5
    45     45   
    46     46   #include "fts5.h"
    47     47   #include <assert.h>
    48     48   #include <string.h>
    49     49   
    50     50   typedef struct Fts5MatchinfoCtx Fts5MatchinfoCtx;
           51  +
           52  +#ifndef SQLITE_AMALGAMATION
    51     53   typedef unsigned int u32;
           54  +#endif
    52     55   
    53     56   struct Fts5MatchinfoCtx {
    54     57     int nCol;                       /* Number of cols in FTS5 table */
    55     58     int nPhrase;                    /* Number of phrases in FTS5 query */
    56     59     char *zArg;                     /* nul-term'd copy of 2nd arg */
    57     60     int nRet;                       /* Number of elements in aRet[] */
    58     61     u32 *aRet;                      /* Array of 32-bit unsigned ints to return */

Changes to ext/rbu/sqlite3rbu.c.

  3700   3700   ** either the xOpen() or xAccess() VFS method, return a pointer to the
  3701   3701   ** file-handle opened by the same database connection on the corresponding
  3702   3702   ** database file.
  3703   3703   */
  3704   3704   static rbu_file *rbuFindMaindb(rbu_vfs *pRbuVfs, const char *zWal){
  3705   3705     rbu_file *pDb;
  3706   3706     sqlite3_mutex_enter(pRbuVfs->mutex);
  3707         -  for(pDb=pRbuVfs->pMain; pDb && pDb->zWal!=zWal; pDb=pDb->pMainNext);
         3707  +  for(pDb=pRbuVfs->pMain; pDb && pDb->zWal!=zWal; pDb=pDb->pMainNext){}
  3708   3708     sqlite3_mutex_leave(pRbuVfs->mutex);
  3709   3709     return pDb;
  3710   3710   }
  3711   3711   
  3712   3712   /*
  3713   3713   ** Open an rbu file handle.
  3714   3714   */

Changes to src/main.c.

  2957   2957     }
  2958   2958     sqlite3BtreeEnter(db->aDb[0].pBt);
  2959   2959     db->aDb[0].pSchema = sqlite3SchemaGet(db, db->aDb[0].pBt);
  2960   2960     if( !db->mallocFailed ) ENC(db) = SCHEMA_ENC(db);
  2961   2961     sqlite3BtreeLeave(db->aDb[0].pBt);
  2962   2962     db->aDb[1].pSchema = sqlite3SchemaGet(db, 0);
  2963   2963   
  2964         -  /* The default safety_level for the main database is 'full'; for the temp
  2965         -  ** database it is 'NONE'. This matches the pager layer defaults.  
         2964  +  /* The default safety_level for the main database is FULL; for the temp
         2965  +  ** database it is OFF. This matches the pager layer defaults.  
  2966   2966     */
  2967   2967     db->aDb[0].zName = "main";
  2968         -  db->aDb[0].safety_level = 3;
         2968  +  db->aDb[0].safety_level = PAGER_SYNCHRONOUS_FULL;
  2969   2969     db->aDb[1].zName = "temp";
  2970         -  db->aDb[1].safety_level = 1;
         2970  +  db->aDb[1].safety_level = PAGER_SYNCHRONOUS_OFF;
  2971   2971   
  2972   2972     db->magic = SQLITE_MAGIC_OPEN;
  2973   2973     if( db->mallocFailed ){
  2974   2974       goto opendb_out;
  2975   2975     }
  2976   2976   
  2977   2977     /* Register all built-in functions, but do not attempt to read the

Changes to src/test1.c.

  3150   3150     void * clientData,
  3151   3151     Tcl_Interp *interp,
  3152   3152     int objc,
  3153   3153     Tcl_Obj *CONST objv[]
  3154   3154   ){
  3155   3155     sqlite3_stmt *pStmt;
  3156   3156     int idx;
  3157         -  i64 n;
         3157  +  Tcl_WideInt n;
  3158   3158     int rc;
  3159   3159   
  3160   3160     if( objc!=4 ){
  3161   3161       Tcl_WrongNumArgs(interp, 1, objv, "STMT IDX N");
  3162   3162       return TCL_ERROR;
  3163   3163     }
  3164   3164   

Changes to src/test_blob.c.

   101    101     int objc,                       /* Number of arguments */
   102    102     Tcl_Obj *CONST objv[]           /* Command arguments */
   103    103   ){
   104    104     sqlite3 *db;
   105    105     const char *zDb;
   106    106     const char *zTable;
   107    107     const char *zColumn;
   108         -  sqlite_int64 iRowid;
          108  +  Tcl_WideInt iRowid;
   109    109     int flags;
   110    110     const char *zVarname;
   111    111     int nVarname;
   112    112   
   113    113     sqlite3_blob *pBlob = (sqlite3_blob*)0xFFFFFFFF;
   114    114     int rc;
   115    115   

Changes to src/util.c.

  1112   1112     testcase( p[0]&0x80 );
  1113   1113     return ((unsigned)p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];
  1114   1114   #endif
  1115   1115   }
  1116   1116   void sqlite3Put4byte(unsigned char *p, u32 v){
  1117   1117   #if SQLITE_BYTEORDER==4321
  1118   1118     memcpy(p,&v,4);
  1119         -#elif SQLITE_BYTEORDER==1234 && defined(__GNUC__) && GCC_VERSION>=4003000
         1119  +#elif SQLITE_BYTEORDER==1234 && !defined(SQLITE_DISABLE_INTRINSIC) \
         1120  +    && defined(__GNUC__) && GCC_VERSION>=4003000
  1120   1121     u32 x = __builtin_bswap32(v);
  1121   1122     memcpy(p,&x,4);
  1122         -#elif SQLITE_BYTEORDER==1234 && defined(_MSC_VER) && _MSC_VER>=1300
         1123  +#elif SQLITE_BYTEORDER==1234 && !defined(SQLITE_DISABLE_INTRINSIC) \
         1124  +    && defined(_MSC_VER) && _MSC_VER>=1300
  1123   1125     u32 x = _byteswap_ulong(v);
  1124   1126     memcpy(p,&x,4);
  1125   1127   #else
  1126   1128     p[0] = (u8)(v>>24);
  1127   1129     p[1] = (u8)(v>>16);
  1128   1130     p[2] = (u8)(v>>8);
  1129   1131     p[3] = (u8)v;

Changes to src/vdbe.c.

  1676   1676   
  1677   1677     /* If the function returned an error, throw an exception */
  1678   1678     if( pCtx->fErrorOrAux ){
  1679   1679       if( pCtx->isError ){
  1680   1680         sqlite3VdbeError(p, "%s", sqlite3_value_text(pCtx->pOut));
  1681   1681         rc = pCtx->isError;
  1682   1682       }
  1683         -    sqlite3VdbeDeleteAuxData(p, pCtx->iOp, pOp->p1);
         1683  +    sqlite3VdbeDeleteAuxData(db, &p->pAuxData, pCtx->iOp, pOp->p1);
  1684   1684       if( rc ) goto abort_due_to_error;
  1685   1685     }
  1686   1686   
  1687   1687     /* Copy the result of the function into register P3 */
  1688   1688     if( pOut->flags & (MEM_Str|MEM_Blob) ){
  1689   1689       sqlite3VdbeChangeEncoding(pCtx->pOut, encoding);
  1690   1690       if( sqlite3VdbeMemTooBig(pCtx->pOut) ) goto too_big;
................................................................................
  5693   5693     }
  5694   5694   
  5695   5695     p->nFrame++;
  5696   5696     pFrame->pParent = p->pFrame;
  5697   5697     pFrame->lastRowid = lastRowid;
  5698   5698     pFrame->nChange = p->nChange;
  5699   5699     pFrame->nDbChange = p->db->nChange;
         5700  +  assert( pFrame->pAuxData==0 );
         5701  +  pFrame->pAuxData = p->pAuxData;
         5702  +  p->pAuxData = 0;
  5700   5703     p->nChange = 0;
  5701   5704     p->pFrame = pFrame;
  5702   5705     p->aMem = aMem = &VdbeFrameMem(pFrame)[-1];
  5703   5706     p->nMem = pFrame->nChildMem;
  5704   5707     p->nCursor = (u16)pFrame->nChildCsr;
  5705   5708     p->apCsr = (VdbeCursor **)&aMem[p->nMem+1];
  5706   5709     p->aOp = aOp = pProgram->aOp;

Changes to src/vdbeInt.h.

   157    157     Op *aOp;                /* Program instructions for parent frame */
   158    158     i64 *anExec;            /* Event counters from parent frame */
   159    159     Mem *aMem;              /* Array of memory cells for parent frame */
   160    160     u8 *aOnceFlag;          /* Array of OP_Once flags for parent frame */
   161    161     VdbeCursor **apCsr;     /* Array of Vdbe cursors for parent frame */
   162    162     void *token;            /* Copy of SubProgram.token */
   163    163     i64 lastRowid;          /* Last insert rowid (sqlite3.lastRowid) */
          164  +  AuxData *pAuxData;      /* Linked list of auxdata allocations */
   164    165     int nCursor;            /* Number of entries in apCsr */
   165    166     int pc;                 /* Program Counter in parent (calling) frame */
   166    167     int nOp;                /* Size of aOp array */
   167    168     int nMem;               /* Number of entries in aMem */
   168    169     int nOnceFlag;          /* Number of entries in aOnceFlag */
   169    170     int nChildMem;          /* Number of memory cells for child frame */
   170    171     int nChildCsr;          /* Number of cursors for child frame */
................................................................................
   439    440   void sqlite3VdbePrintOp(FILE*, int, Op*);
   440    441   #endif
   441    442   u32 sqlite3VdbeSerialTypeLen(u32);
   442    443   u8 sqlite3VdbeOneByteSerialTypeLen(u8);
   443    444   u32 sqlite3VdbeSerialType(Mem*, int, u32*);
   444    445   u32 sqlite3VdbeSerialPut(unsigned char*, Mem*, u32);
   445    446   u32 sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
   446         -void sqlite3VdbeDeleteAuxData(Vdbe*, int, int);
          447  +void sqlite3VdbeDeleteAuxData(sqlite3*, AuxData**, int, int);
   447    448   
   448    449   int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *);
   449    450   int sqlite3VdbeIdxKeyCompare(sqlite3*,VdbeCursor*,UnpackedRecord*,int*);
   450    451   int sqlite3VdbeIdxRowid(sqlite3*, BtCursor*, i64*);
   451    452   int sqlite3VdbeExec(Vdbe*);
   452    453   int sqlite3VdbeList(Vdbe*);
   453    454   int sqlite3VdbeHalt(Vdbe*);

Changes to src/vdbeaux.c.

  1484   1484     int i;
  1485   1485     Mem *aMem = VdbeFrameMem(p);
  1486   1486     VdbeCursor **apCsr = (VdbeCursor **)&aMem[p->nChildMem];
  1487   1487     for(i=0; i<p->nChildCsr; i++){
  1488   1488       sqlite3VdbeFreeCursor(p->v, apCsr[i]);
  1489   1489     }
  1490   1490     releaseMemArray(aMem, p->nChildMem);
         1491  +  sqlite3VdbeDeleteAuxData(p->v->db, &p->pAuxData, -1, 0);
  1491   1492     sqlite3DbFree(p->v->db, p);
  1492   1493   }
  1493   1494   
  1494   1495   #ifndef SQLITE_OMIT_EXPLAIN
  1495   1496   /*
  1496   1497   ** Give a listing of the program in the virtual machine.
  1497   1498   **
................................................................................
  2012   2013     v->aMem = pFrame->aMem;
  2013   2014     v->nMem = pFrame->nMem;
  2014   2015     v->apCsr = pFrame->apCsr;
  2015   2016     v->nCursor = pFrame->nCursor;
  2016   2017     v->db->lastRowid = pFrame->lastRowid;
  2017   2018     v->nChange = pFrame->nChange;
  2018   2019     v->db->nChange = pFrame->nDbChange;
         2020  +  sqlite3VdbeDeleteAuxData(v->db, &v->pAuxData, -1, 0);
         2021  +  v->pAuxData = pFrame->pAuxData;
         2022  +  pFrame->pAuxData = 0;
  2019   2023     return pFrame->pc;
  2020   2024   }
  2021   2025   
  2022   2026   /*
  2023   2027   ** Close all cursors.
  2024   2028   **
  2025   2029   ** Also release any dynamic memory held by the VM in the Vdbe.aMem memory 
................................................................................
  2043   2047     while( p->pDelFrame ){
  2044   2048       VdbeFrame *pDel = p->pDelFrame;
  2045   2049       p->pDelFrame = pDel->pParent;
  2046   2050       sqlite3VdbeFrameDelete(pDel);
  2047   2051     }
  2048   2052   
  2049   2053     /* Delete any auxdata allocations made by the VM */
  2050         -  if( p->pAuxData ) sqlite3VdbeDeleteAuxData(p, -1, 0);
         2054  +  if( p->pAuxData ) sqlite3VdbeDeleteAuxData(p->db, &p->pAuxData, -1, 0);
  2051   2055     assert( p->pAuxData==0 );
  2052   2056   }
  2053   2057   
  2054   2058   /*
  2055   2059   ** Clean up the VM after a single run.
  2056   2060   */
  2057   2061   static void Cleanup(Vdbe *p){
................................................................................
  2132   2136   ** A read or write transaction may or may not be active on database handle
  2133   2137   ** db. If a transaction is active, commit it. If there is a
  2134   2138   ** write-transaction spanning more than one database file, this routine
  2135   2139   ** takes care of the master journal trickery.
  2136   2140   */
  2137   2141   static int vdbeCommit(sqlite3 *db, Vdbe *p){
  2138   2142     int i;
  2139         -  int nTrans = 0;  /* Number of databases with an active write-transaction */
         2143  +  int nTrans = 0;  /* Number of databases with an active write-transaction
         2144  +                   ** that are candidates for a two-phase commit using a
         2145  +                   ** master-journal */
  2140   2146     int rc = SQLITE_OK;
  2141   2147     int needXcommit = 0;
  2142   2148   
  2143   2149   #ifdef SQLITE_OMIT_VIRTUALTABLE
  2144   2150     /* With this option, sqlite3VtabSync() is defined to be simply 
  2145   2151     ** SQLITE_OK so p is not used. 
  2146   2152     */
................................................................................
  2160   2166     ** including the temp database. (b) is important because if more than 
  2161   2167     ** one database file has an open write transaction, a master journal
  2162   2168     ** file is required for an atomic commit.
  2163   2169     */ 
  2164   2170     for(i=0; rc==SQLITE_OK && i<db->nDb; i++){ 
  2165   2171       Btree *pBt = db->aDb[i].pBt;
  2166   2172       if( sqlite3BtreeIsInTrans(pBt) ){
         2173  +      /* Whether or not a database might need a master journal depends upon
         2174  +      ** its journal mode (among other things).  This matrix determines which
         2175  +      ** journal modes use a master journal and which do not */
         2176  +      static const u8 aMJNeeded[] = {
         2177  +        /* DELETE   */  1,
         2178  +        /* PERSIST   */ 1,
         2179  +        /* OFF       */ 0,
         2180  +        /* TRUNCATE  */ 1,
         2181  +        /* MEMORY    */ 0,
         2182  +        /* WAL       */ 0
         2183  +      };
         2184  +      Pager *pPager;   /* Pager associated with pBt */
  2167   2185         needXcommit = 1;
  2168         -      if( i!=1 ) nTrans++;
  2169   2186         sqlite3BtreeEnter(pBt);
  2170         -      rc = sqlite3PagerExclusiveLock(sqlite3BtreePager(pBt));
         2187  +      pPager = sqlite3BtreePager(pBt);
         2188  +      if( db->aDb[i].safety_level!=PAGER_SYNCHRONOUS_OFF
         2189  +       && aMJNeeded[sqlite3PagerGetJournalMode(pPager)]
         2190  +      ){ 
         2191  +        assert( i!=1 );
         2192  +        nTrans++;
         2193  +      }
         2194  +      rc = sqlite3PagerExclusiveLock(pPager);
  2171   2195         sqlite3BtreeLeave(pBt);
  2172   2196       }
  2173   2197     }
  2174   2198     if( rc!=SQLITE_OK ){
  2175   2199       return rc;
  2176   2200     }
  2177   2201   
................................................................................
  2871   2895   **
  2872   2896   **    * the associated function parameter is the 32nd or later (counting
  2873   2897   **      from left to right), or
  2874   2898   **
  2875   2899   **    * the corresponding bit in argument mask is clear (where the first
  2876   2900   **      function parameter corresponds to bit 0 etc.).
  2877   2901   */
  2878         -void sqlite3VdbeDeleteAuxData(Vdbe *pVdbe, int iOp, int mask){
  2879         -  AuxData **pp = &pVdbe->pAuxData;
         2902  +void sqlite3VdbeDeleteAuxData(sqlite3 *db, AuxData **pp, int iOp, int mask){
  2880   2903     while( *pp ){
  2881   2904       AuxData *pAux = *pp;
  2882   2905       if( (iOp<0)
  2883   2906        || (pAux->iOp==iOp && (pAux->iArg>31 || !(mask & MASKBIT32(pAux->iArg))))
  2884   2907       ){
  2885   2908         testcase( pAux->iArg==31 );
  2886   2909         if( pAux->xDelete ){
  2887   2910           pAux->xDelete(pAux->pAux);
  2888   2911         }
  2889   2912         *pp = pAux->pNext;
  2890         -      sqlite3DbFree(pVdbe->db, pAux);
         2913  +      sqlite3DbFree(db, pAux);
  2891   2914       }else{
  2892   2915         pp= &pAux->pNext;
  2893   2916       }
  2894   2917     }
  2895   2918   }
  2896   2919   
  2897   2920   /*

Changes to src/vdbesort.c.

  2293   2293     int i;
  2294   2294     int rc = SQLITE_OK;
  2295   2295   
  2296   2296     *ppOut = pNew = vdbeMergeEngineNew(nPMA);
  2297   2297     if( pNew==0 ) rc = SQLITE_NOMEM_BKPT;
  2298   2298   
  2299   2299     for(i=0; i<nPMA && rc==SQLITE_OK; i++){
  2300         -    i64 nDummy;
         2300  +    i64 nDummy = 0;
  2301   2301       PmaReader *pReadr = &pNew->aReadr[i];
  2302   2302       rc = vdbePmaReaderInit(pTask, &pTask->file, iOff, pReadr, &nDummy);
  2303   2303       iOff = pReadr->iEof;
  2304   2304     }
  2305   2305   
  2306   2306     if( rc!=SQLITE_OK ){
  2307   2307       vdbeMergeEngineFree(pNew);

Changes to src/whereexpr.c.

   529    529     */
   530    530     assert( (pTerm->wtFlags & (TERM_DYNAMIC|TERM_ORINFO|TERM_ANDINFO))==0 );
   531    531     assert( pExpr->op==TK_OR );
   532    532     pTerm->u.pOrInfo = pOrInfo = sqlite3DbMallocZero(db, sizeof(*pOrInfo));
   533    533     if( pOrInfo==0 ) return;
   534    534     pTerm->wtFlags |= TERM_ORINFO;
   535    535     pOrWc = &pOrInfo->wc;
          536  +  memset(pOrWc->aStatic, 0, sizeof(pOrWc->aStatic));
   536    537     sqlite3WhereClauseInit(pOrWc, pWInfo);
   537    538     sqlite3WhereSplit(pOrWc, pExpr, TK_OR);
   538    539     sqlite3WhereExprAnalyze(pSrc, pOrWc);
   539    540     if( db->mallocFailed ) return;
   540    541     assert( pOrWc->nTerm>=2 );
   541    542   
   542    543     /*
................................................................................
   555    556           WhereTerm *pAndTerm;
   556    557           int j;
   557    558           Bitmask b = 0;
   558    559           pOrTerm->u.pAndInfo = pAndInfo;
   559    560           pOrTerm->wtFlags |= TERM_ANDINFO;
   560    561           pOrTerm->eOperator = WO_AND;
   561    562           pAndWC = &pAndInfo->wc;
          563  +        memset(pAndWC->aStatic, 0, sizeof(pAndWC->aStatic));
   562    564           sqlite3WhereClauseInit(pAndWC, pWC->pWInfo);
   563    565           sqlite3WhereSplit(pAndWC, pOrTerm->pExpr, TK_AND);
   564    566           sqlite3WhereExprAnalyze(pSrc, pAndWC);
   565    567           pAndWC->pOuter = pWC;
   566    568           if( !db->mallocFailed ){
   567    569             for(j=0, pAndTerm=pAndWC->a; j<pAndWC->nTerm; j++, pAndTerm++){
   568    570               assert( pAndTerm->pExpr );

Changes to test/pager1.test.

   525    525   # file-system is saved just before the xDelete() call to remove the 
   526    526   # master journal file from the file-system.
   527    527   #
   528    528   set pwd [get_pwd]
   529    529   testvfs tv -default 1
   530    530   tv script copy_on_mj_delete
   531    531   set ::mj_filename_length 0
          532  +set ::mj_delete_cnt 0
   532    533   proc copy_on_mj_delete {method filename args} {
   533    534     if {[string match *mj* [file tail $filename]]} { 
   534    535       #
   535    536       # NOTE: Is the file name relative?  If so, add the length of the current
   536    537       #       directory.
   537    538       #
   538    539       if {[is_relative_file $filename]} {
   539    540         set ::mj_filename_length \
   540    541           [expr {[string length $filename] + [string length $::pwd]}]
   541    542       } else {
   542    543         set ::mj_filename_length [string length $filename]
   543    544       }
   544    545       faultsim_save 
          546  +    incr ::mj_delete_cnt
   545    547     }
   546    548     return SQLITE_OK
   547    549   }
   548    550   
   549    551   if {![forced_proxy_locking]} {
   550    552     # proxy locking uses can't deal with auto proxy file paths longer than MAXPATHLEN
   551    553   foreach {tn1 tcl} {
................................................................................
   577    579       }
   578    580   
   579    581       set padding [string repeat x [expr $nPadding %32]]
   580    582       set prefix "test.db${padding}"
   581    583     }
   582    584   } {
   583    585     eval $tcl
   584         -  foreach {tn2 sql} {
          586  +  foreach {tn2 sql usesMJ} {
   585    587       o { 
   586    588         PRAGMA main.synchronous=OFF;
   587    589         PRAGMA aux.synchronous=OFF;
   588    590         PRAGMA journal_mode = DELETE;
   589         -    }
          591  +    } 0
   590    592       o512 { 
   591    593         PRAGMA main.synchronous=OFF;
   592    594         PRAGMA aux.synchronous=OFF;
   593    595         PRAGMA main.page_size = 512;
   594    596         PRAGMA aux.page_size = 512;
   595    597         PRAGMA journal_mode = DELETE;
   596         -    }
          598  +    } 0
   597    599       n { 
   598    600         PRAGMA main.synchronous=NORMAL;
   599    601         PRAGMA aux.synchronous=NORMAL;
   600    602         PRAGMA journal_mode = DELETE;
   601         -    }
          603  +    } 1
   602    604       f { 
   603    605         PRAGMA main.synchronous=FULL;
   604    606         PRAGMA aux.synchronous=FULL;
   605    607         PRAGMA journal_mode = DELETE;
   606         -    }
          608  +    } 1
          609  +    w1 { 
          610  +      PRAGMA main.synchronous=NORMAL;
          611  +      PRAGMA aux.synchronous=NORMAL;
          612  +      PRAGMA journal_mode = WAL;
          613  +    } 0
          614  +    w2 { 
          615  +      PRAGMA main.synchronous=NORMAL;
          616  +      PRAGMA aux.synchronous=NORMAL;
          617  +      PRAGMA main.journal_mode=DELETE;
          618  +      PRAGMA aux.journal_mode=WAL;
          619  +    } 0
          620  +    o1a { 
          621  +      PRAGMA main.synchronous=FULL;
          622  +      PRAGMA aux.synchronous=OFF;
          623  +      PRAGMA journal_mode=DELETE;
          624  +    } 0
          625  +    o1b { 
          626  +      PRAGMA main.synchronous=OFF;
          627  +      PRAGMA aux.synchronous=NORMAL;
          628  +      PRAGMA journal_mode=DELETE;
          629  +    } 0
          630  +    m1 { 
          631  +      PRAGMA main.synchronous=NORMAL;
          632  +      PRAGMA aux.synchronous=NORMAL;
          633  +      PRAGMA main.journal_mode=DELETE;
          634  +      PRAGMA aux.journal_mode = MEMORY;
          635  +    } 0
          636  +    t1 { 
          637  +      PRAGMA main.synchronous=NORMAL;
          638  +      PRAGMA aux.synchronous=NORMAL;
          639  +      PRAGMA main.journal_mode=DELETE;
          640  +      PRAGMA aux.journal_mode = TRUNCATE;
          641  +    } 1
          642  +    p1 { 
          643  +      PRAGMA main.synchronous=NORMAL;
          644  +      PRAGMA aux.synchronous=NORMAL;
          645  +      PRAGMA main.journal_mode=DELETE;
          646  +      PRAGMA aux.journal_mode = PERSIST;
          647  +    } 1
   607    648     } {
   608    649   
   609    650       set tn "${tn1}.${tn2}"
   610    651     
   611    652       # Set up a connection to have two databases, test.db (main) and 
   612    653       # test.db2 (aux). Then run a multi-file transaction on them. The
   613    654       # VFS will snapshot the file-system just before the master-journal
   614    655       # file is deleted to commit the transaction.
   615    656       #
   616    657       tv filter xDelete
   617    658       do_test pager1-4.4.$tn.1 {
          659  +      set ::mj_delete_cnt 0
   618    660         faultsim_delete_and_reopen $prefix
   619    661         execsql "
   620    662           ATTACH '${prefix}2' AS aux;
   621    663           $sql
   622    664           CREATE TABLE a(x);
   623    665           CREATE TABLE aux.b(x);
   624    666           INSERT INTO a VALUES('double-you');
................................................................................
   632    674           BEGIN;
   633    675             INSERT INTO a SELECT * FROM b WHERE rowid<=3;
   634    676             INSERT INTO b SELECT * FROM a WHERE rowid<=3;
   635    677           COMMIT;
   636    678         }
   637    679       } {}
   638    680       tv filter {}
          681  +
          682  +    # Verify that a master journal was deleted only for those cases where
          683  +    # master journals really ought to be used
          684  +    #
          685  +    do_test pager1-4.4.$tn.1b {
          686  +      set ::mj_delete_cnt
          687  +    } $usesMJ
   639    688       
   640    689       # Check that the transaction was committed successfully.
   641    690       #
   642    691       do_execsql_test pager1-4.4.$tn.2 {
   643    692         SELECT * FROM a
   644    693       } {double-you why zed won too free}
   645    694       do_execsql_test pager1-4.4.$tn.3 {
   646    695         SELECT * FROM b
   647    696       } {won too free double-you why zed}
   648    697       
   649         -    # Restore the file-system and reopen the databases. Check that it now
   650         -    # appears that the transaction was not committed (because the file-system
   651         -    # was restored to the state where it had not been).
   652         -    #
   653         -    do_test pager1-4.4.$tn.4 {
   654         -      faultsim_restore_and_reopen $prefix
   655         -      execsql "ATTACH '${prefix}2' AS aux"
   656         -    } {}
   657         -    do_execsql_test pager1-4.4.$tn.5 {SELECT * FROM a} {double-you why zed}
   658         -    do_execsql_test pager1-4.4.$tn.6 {SELECT * FROM b} {won too free}
          698  +    if {$usesMJ} {
          699  +      # Restore the file-system and reopen the databases. Check that it now
          700  +      # appears that the transaction was not committed (because the file-system
          701  +      # was restored to the state where it had not been).
          702  +      #
          703  +      do_test pager1-4.4.$tn.4 {
          704  +        faultsim_restore_and_reopen $prefix
          705  +        execsql "ATTACH '${prefix}2' AS aux"
          706  +      } {}
          707  +      do_execsql_test pager1-4.4.$tn.5 {SELECT * FROM a} {double-you why zed}
          708  +      do_execsql_test pager1-4.4.$tn.6 {SELECT * FROM b} {won too free}
          709  +    }
   659    710       
   660    711       # Restore the file-system again. This time, before reopening the databases,
   661    712       # delete the master-journal file from the file-system. It now appears that
   662    713       # the transaction was committed (no master-journal file == no rollback).
   663    714       #
   664    715       do_test pager1-4.4.$tn.7 {
   665         -      faultsim_restore_and_reopen $prefix
   666         -      foreach f [glob ${prefix}-mj*] { forcedelete $f }
          716  +      if {$::mj_delete_cnt>0} {
          717  +        faultsim_restore_and_reopen $prefix
          718  +        foreach f [glob ${prefix}-mj*] { forcedelete $f }
          719  +      } else {
          720  +        db close
          721  +        sqlite3 db $prefix
          722  +      }
   667    723         execsql "ATTACH '${prefix}2' AS aux"
          724  +      glob -nocomplain ${prefix}-mj*
   668    725       } {}
   669    726       do_execsql_test pager1-4.4.$tn.8 {
   670    727         SELECT * FROM a
   671    728       } {double-you why zed won too free}
   672    729       do_execsql_test pager1-4.4.$tn.9 {
   673    730         SELECT * FROM b
   674    731       } {won too free double-you why zed}
................................................................................
   676    733   
   677    734     cd $pwd
   678    735   }
   679    736   db close
   680    737   tv delete
   681    738   forcedelete $dirname
   682    739   }
   683         -
   684    740   
   685    741   # Set up a VFS to make a copy of the file-system just before deleting a
   686    742   # journal file to commit a transaction. The transaction modifies exactly
   687    743   # two database pages (and page 1 - the change counter).
   688    744   #
   689    745   testvfs tv -default 1
   690    746   tv sectorsize 512

Added test/regexp2.test.

            1  +# 2016 February 19
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
            9  +#
           10  +#***********************************************************************
           11  +# 
           12  +# This file implements tests for the REGEXP operator in ext/misc/regexp.c.
           13  +# It focuses on the use of the sqlite3_set_auxdata()/get_auxdata() APIs.
           14  +#
           15  +
           16  +set testdir [file dirname $argv0]
           17  +source $testdir/tester.tcl
           18  +set testprefix regexp2
           19  +
           20  +load_static_extension db regexp
           21  +
           22  +#-------------------------------------------------------------------------
           23  +# Test that triggers do not become confused and use aux-data created by
           24  +# a different trigger for a different REGEXP invocation.
           25  +#
           26  +do_execsql_test 1.0 {
           27  +  CREATE TABLE t1(a, b, c);
           28  +  CREATE TABLE x1(x, y, z);
           29  +  CREATE TABLE x2(x, y, z);
           30  +
           31  +  CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
           32  +    INSERT INTO x1 VALUES(
           33  +        new.a REGEXP 'abc',
           34  +        new.b REGEXP 'abc',
           35  +        new.c REGEXP 'abc'
           36  +    );
           37  +  END;
           38  +
           39  +  CREATE TRIGGER tr2 AFTER INSERT ON t1 BEGIN
           40  +    INSERT INTO x2 VALUES(
           41  +        new.a REGEXP 'def',
           42  +        new.b REGEXP 'def',
           43  +        new.c REGEXP 'def'
           44  +    );
           45  +  END;
           46  +
           47  +  INSERT INTO t1 VALUES('abc', 'def', 'abc');
           48  +  SELECT * FROM t1;
           49  +} {abc def abc}
           50  +
           51  +do_execsql_test 1.1 { SELECT * FROM x1 } {1 0 1}
           52  +do_execsql_test 1.2 { SELECT * FROM x2 } {0 1 0}
           53  +
           54  +#-------------------------------------------------------------------------
           55  +# Test that if an exception is thrown several triggers deep, all aux-data
           56  +# objects are cleaned up correctly.
           57  +#
           58  +proc sql_error {} {
           59  +  error "SQL error!"
           60  +}
           61  +db func error sql_error
           62  +do_execsql_test 2.0 {
           63  +  CREATE TABLE t2(a, b);
           64  +  CREATE TABLE t3(c, d);
           65  +  CREATE TABLE t4(e, f);
           66  +
           67  +  CREATE TRIGGER t2_tr1 AFTER UPDATE ON t2 BEGIN
           68  +    UPDATE t3 SET d = new.b WHERE c = old.a;
           69  +  END;
           70  +
           71  +  CREATE TRIGGER t3_tr1 AFTER UPDATE ON t3 BEGIN
           72  +    UPDATE t4 SET f = new.d WHERE e = old.c AND new.d REGEXP 'a.*';
           73  +  END;
           74  +
           75  +  CREATE TRIGGER t4_tr1 AFTER UPDATE ON t4 BEGIN
           76  +    SELECT CASE WHEN new.f REGEXP '.*y.*' THEN error() ELSE 1 END;
           77  +  END;
           78  +
           79  +  INSERT INTO t2 VALUES(1, 'a_x_1');
           80  +  INSERT INTO t2 VALUES(2, 'a_y_1');
           81  +
           82  +  INSERT INTO t3 VALUES(1, 'b1');
           83  +  INSERT INTO t3 VALUES(2, 'b2');
           84  +
           85  +  INSERT INTO t4 VALUES(1, 'b1');
           86  +  INSERT INTO t4 VALUES(2, 'b2');
           87  +} {}
           88  +
           89  +do_catchsql_test 2.1 {
           90  +  UPDATE t2 SET a=a+1 WHERE b REGEXP 'a.*' AND b REGEXP '.*1';
           91  +} {1 {SQL error!}}
           92  +
           93  +# Test that the triggers used in the test above work as expected.
           94  +#
           95  +do_execsql_test 2.2 {
           96  +  UPDATE t2 SET b = 'a_abc_1';
           97  +} {}
           98  +do_execsql_test 2.3 {
           99  +  SELECT * FROM t2;
          100  +  SELECT * FROM t3;
          101  +  SELECT * FROM t4;
          102  +} {1 a_abc_1 2 a_abc_1 1 a_abc_1 2 a_abc_1 1 a_abc_1 2 a_abc_1}
          103  +
          104  +#-------------------------------------------------------------------------
          105  +# Test that trigger parameters (i.e. new.* and old.*) refs are not 
          106  +# considered to be constant across separate invocations of the trigger.
          107  +#
          108  +do_execsql_test 3.0 {
          109  +  CREATE TABLE t5(a);
          110  +  CREATE TABLE t6(x);
          111  +
          112  +  CREATE TRIGGER t5tr AFTER DELETE ON t5 BEGIN
          113  +    DELETE FROM t6 WHERE t6.x REGEXP old.a;
          114  +  END;
          115  +
          116  +  INSERT INTO t5 VALUES ('^a.*'), ('^b.*'), ('^c.*');
          117  +  INSERT INTO t6 VALUES ('eab'), ('abc'), ('bcd'), ('cde'), ('dea');
          118  +
          119  +  DELETE FROM t5;
          120  +  SELECT * FROM t6;
          121  +} {eab dea}
          122  +
          123  +
          124  +finish_test
          125  +

Changes to test/speedtest1.c.

  1192   1192     void *pLook = 0;              /* Allocated lookaside space */
  1193   1193     void *pPCache = 0;            /* Allocated storage for pcache */
  1194   1194     void *pScratch = 0;           /* Allocated storage for scratch */
  1195   1195     int iCur, iHi;                /* Stats values, current and "highwater" */
  1196   1196     int i;                        /* Loop counter */
  1197   1197     int rc;                       /* API return code */
  1198   1198   
         1199  +  /* Display the version of SQLite being tested */
         1200  +  printf("Speedtest1 for SQLite %s %.50s\n", sqlite3_libversion(), sqlite3_sourceid());
         1201  +
  1199   1202     /* Process command-line arguments */
  1200   1203     g.zWR = "";
  1201   1204     g.zNN = "";
  1202   1205     g.zPK = "UNIQUE";
  1203   1206     g.szTest = 100;
  1204   1207     for(i=1; i<argc; i++){
  1205   1208       const char *z = argv[i];

Changes to tool/build-all-msvc.bat.

    18     18   REM name of an existing directory to be used as the final destination directory
    19     19   REM for the generated output files, which will be placed in sub-directories
    20     20   REM created therein.  Ideally, the directory specified should be empty.
    21     21   REM
    22     22   REM Example:
    23     23   REM
    24     24   REM                        CD /D C:\dev\sqlite\core
    25         -REM                        tool\build-all-msvc.bat C:\Temp
           25  +REM                        CALL tool\build-all-msvc.bat C:\Temp
    26     26   REM
    27     27   REM In the example above, "C:\dev\sqlite\core" represents the root of the
    28     28   REM source tree for SQLite and "C:\Temp" represents the final destination
    29     29   REM directory for the generated output files.
    30     30   REM
    31     31   REM Please note that the SQLite build process performed by the Makefile
    32     32   REM associated with this batch script requires a Tcl shell to be present
................................................................................
    50     50   REM may be necessary, depending on the platforms to be built.  These values in
    51     51   REM these three variables should be surrounded by double quotes if they contain
    52     52   REM spaces.
    53     53   REM
    54     54   REM There are a few other environment variables that impact the build process
    55     55   REM when set ^(to anything^), they are:
    56     56   REM
           57  +REM                        USE_AUTOCONF_MAKEFILE
           58  +REM
           59  +REM When set, the "autoconf" Makefile for MSVC will be used instead of the main
           60  +REM Makefile for MSVC.  It must exist at "%ROOT%\autoconf\Makefile.msc".
           61  +REM
    57     62   REM                        NOCLEAN
    58     63   REM
    59     64   REM When set, the "clean" target will not be used during each build iteration.
    60     65   REM However, the target binaries, if any, will still be deleted manually prior
    61     66   REM to being rebuilt.  Setting this environment variable is only rarely needed
    62     67   REM and could cause issues in some circumstances; therefore, setting it is not
    63     68   REM recommended.
................................................................................
    64     69   REM
    65     70   REM                        NOSYMBOLS
    66     71   REM
    67     72   REM When set, copying of symbol files ^(*.pdb^) created during the build will
    68     73   REM be skipped and they will not appear in the final destination directory.
    69     74   REM Setting this environment variable is never strictly needed and could cause
    70     75   REM issues in some circumstances; therefore, setting it is not recommended.
           76  +REM
           77  +REM                        NOMEMDEBUG
           78  +REM
           79  +REM When set, disables use of MEMDEBUG when building binaries for the "Debug"
           80  +REM configuration.
    71     81   REM
    72     82   REM                        BUILD_ALL_SHELL
    73     83   REM
    74     84   REM When set, the command line shell will be built for each selected platform
    75     85   REM and configuration as well.  In addition, the command line shell binaries
    76     86   REM will be copied, with their symbols, to the final destination directory.
    77     87   REM
................................................................................
    84     94   REM                        USE_WINV100_NSDKLIBPATH
    85     95   REM
    86     96   REM When set, modifies how the NSDKLIBPATH environment variable is built, based
    87     97   REM on the WindowsSdkDir environment variable.  It causes this batch script to
    88     98   REM assume the Windows 10.0 SDK location should be used.
    89     99   REM
    90    100   REM                        NMAKE_ARGS
          101  +REM                        NMAKE_ARGS_DEBUG
          102  +REM                        NMAKE_ARGS_RETAIL
    91    103   REM
    92         -REM When set, the value is expanded and passed to the NMAKE command line, after
    93         -REM its other arguments.  This is used to specify additional NMAKE options, for
    94         -REM example:
          104  +REM When set, these values are expanded and passed to the NMAKE command line,
          105  +REM after its other arguments.  These may be used to specify additional NMAKE
          106  +REM options, for example:
    95    107   REM
    96    108   REM                        SET NMAKE_ARGS=FOR_WINRT=1
          109  +REM                        SET NMAKE_ARGS_DEBUG=MEMDEBUG=1
          110  +REM                        SET NMAKE_ARGS_RETAIL=WIN32HEAP=1
    97    111   REM
    98    112   REM Using the above command before running this tool will cause the compiled
    99    113   REM binaries to target the WinRT environment, which provides a subset of the
   100    114   REM Win32 API.
          115  +REM
          116  +REM                        DLL_FILE_NAME
          117  +REM                        DLL_PDB_FILE_NAME
          118  +REM                        LIB_FILE_NAME
          119  +REM                        EXE_FILE_NAME
          120  +REM                        EXE_PDB_FILE_NAME
          121  +REM
          122  +REM When set, these values will override the associated target file name used
          123  +REM for the build.
   101    124   REM
   102    125   SETLOCAL
   103    126   
   104    127   REM SET __ECHO=ECHO
   105    128   REM SET __ECHO2=ECHO
   106    129   REM SET __ECHO3=ECHO
   107    130   IF NOT DEFINED _AECHO (SET _AECHO=REM)
................................................................................
   200    223   %_VECHO% Configurations = '%CONFIGURATIONS%'
   201    224   
   202    225   REM
   203    226   REM NOTE: If the command used to invoke NMAKE is not already set, use the
   204    227   REM       default.
   205    228   REM
   206    229   IF NOT DEFINED NMAKE_CMD (
   207         -  SET NMAKE_CMD=nmake -B -f Makefile.msc
          230  +  IF DEFINED USE_AUTOCONF_MAKEFILE (
          231  +    SET NMAKE_CMD=nmake -B -f autoconf\Makefile.msc
          232  +  ) ELSE (
          233  +    SET NMAKE_CMD=nmake -B -f Makefile.msc
          234  +  )
   208    235   )
   209    236   
   210    237   %_VECHO% NmakeCmd = '%NMAKE_CMD%'
   211    238   %_VECHO% NmakeArgs = '%NMAKE_ARGS%'
          239  +%_VECHO% NmakeArgsDebug = '%NMAKE_ARGS_DEBUG%'
          240  +%_VECHO% NmakeArgsRetail = '%NMAKE_ARGS_RETAIL%'
   212    241   
   213    242   REM
   214    243   REM NOTE: Setup environment variables to translate between the MSVC platform
   215    244   REM       names and the names to be used for the platform-specific binary
   216    245   REM       directories.
   217    246   REM
   218    247   SET amd64_NAME=x64
................................................................................
   250    279   REM NOTE: A Tcl shell executable is required during the SQLite build process
   251    280   REM       unless a pre-existing amalgamation file is used.
   252    281   REM
   253    282   IF NOT DEFINED %TCLSH_FILE%_PATH (
   254    283     ECHO The Tcl shell executable "%TCLSH_FILE%" is required to be in the PATH.
   255    284     GOTO errors
   256    285   )
          286  +
          287  +REM
          288  +REM NOTE: Setup the default names for the build targets we are creating.  Any
          289  +REM       ^(or all^) of these may end up being overridden.
          290  +REM
          291  +IF NOT DEFINED DLL_FILE_NAME (
          292  +  SET DLL_FILE_NAME=sqlite3.dll
          293  +)
          294  +
          295  +IF NOT DEFINED DLL_PDB_FILE_NAME (
          296  +  SET DLL_PDB_FILE_NAME=sqlite3.pdb
          297  +)
          298  +
          299  +IF NOT DEFINED LIB_FILE_NAME (
          300  +  SET LIB_FILE_NAME=sqlite3.lib
          301  +)
          302  +
          303  +IF NOT DEFINED EXE_FILE_NAME (
          304  +  SET EXE_FILE_NAME=sqlite3.exe
          305  +)
          306  +
          307  +IF NOT DEFINED EXE_PDB_FILE_NAME (
          308  +  SET EXE_PDB_FILE_NAME=sqlite3sh.pdb
          309  +)
   257    310   
   258    311   REM
   259    312   REM NOTE: Set the TOOLPATH variable to contain all the directories where the
   260    313   REM       external tools were found in the search above.
   261    314   REM
   262    315   CALL :fn_CopyVariable %TCLSH_FILE%_PATH TOOLPATH
   263    316   
................................................................................
   430    483           REM
   431    484           SET DEBUG=3
   432    485   
   433    486           REM
   434    487           REM NOTE: Setting this to non-zero should enable the SQLITE_MEMDEBUG
   435    488           REM       define.
   436    489           REM
   437         -        SET MEMDEBUG=1
          490  +        IF NOT DEFINED NOMEMDEBUG (
          491  +          SET MEMDEBUG=1
          492  +        )
   438    493         ) ELSE (
   439    494           CALL :fn_UnsetVariable DEBUG
   440    495           CALL :fn_UnsetVariable MEMDEBUG
   441    496         )
   442    497   
          498  +      REM
          499  +      REM NOTE: Copy the extra NMAKE arguments for this configuration into the
          500  +      REM       common variable used by the actual commands.
          501  +      REM
          502  +      CALL :fn_CopyVariable NMAKE_ARGS_%%B NMAKE_ARGS_CFG
          503  +
   443    504         REM
   444    505         REM NOTE: Launch a nested command shell to perform the following steps:
   445    506         REM
   446    507         REM       1. Setup the MSVC environment for this platform using the
   447    508         REM          official batch file.
   448    509         REM
   449    510         REM       2. Make sure that no stale build output files are present.
................................................................................
   542    603           REM
   543    604           REM NOTE: Unless prevented from doing so, invoke NMAKE with the MSVC
   544    605           REM       makefile to clean any stale build output from previous
   545    606           REM       iterations of this loop and/or previous runs of this batch
   546    607           REM       file, etc.
   547    608           REM
   548    609           IF NOT DEFINED NOCLEAN (
   549         -          %__ECHO% %NMAKE_CMD% clean
          610  +          CALL :fn_MakeClean %%D
   550    611   
   551    612             IF ERRORLEVEL 1 (
   552    613               ECHO Failed to clean for platform %%P.
   553    614               GOTO errors
   554    615             )
   555    616           ) ELSE (
   556    617             REM
   557    618             REM NOTE: Even when the cleaning step has been disabled, we still
   558    619             REM       need to remove the build output for all the files we are
   559    620             REM       specifically wanting to build for each platform.
   560    621             REM
   561    622             %_AECHO% Cleaning final core library output files only...
   562         -          %__ECHO% DEL /Q *.lo sqlite3.dll sqlite3.lib sqlite3.pdb 2%REDIRECT% NUL
          623  +          %__ECHO% DEL /Q *.lo "%DLL_FILE_NAME%" "%LIB_FILE_NAME%" "%DLL_PDB_FILE_NAME%" 2%REDIRECT% NUL
   563    624           )
   564    625   
   565    626           REM
   566    627           REM NOTE: Call NMAKE with the MSVC makefile to build the "sqlite3.dll"
   567    628           REM       binary.  The x86 compiler will be used to compile the native
   568    629           REM       command line tools needed during the build process itself.
   569    630           REM       Also, disable looking for and/or linking to the native Tcl
   570    631           REM       runtime library.
   571    632           REM
   572         -        %__ECHO% %NMAKE_CMD% sqlite3.dll XCOMPILE=1 USE_NATIVE_LIBPATHS=1 NO_TCL=1 %NMAKE_ARGS%
          633  +        CALL :fn_MakeDll %%D
   573    634   
   574    635           IF ERRORLEVEL 1 (
   575         -          ECHO Failed to build %%B "sqlite3.dll" for platform %%P.
          636  +          ECHO Failed to build %%B "%DLL_FILE_NAME%" for platform %%P.
   576    637             GOTO errors
   577    638           )
   578    639   
   579    640           REM
   580    641           REM NOTE: Copy the "sqlite3.dll" file to the appropriate directory for
   581    642           REM       the build and platform beneath the binary directory.
   582    643           REM
   583         -        %__ECHO% XCOPY sqlite3.dll "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
          644  +        %__ECHO% XCOPY "%DLL_FILE_NAME%" "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
   584    645   
   585    646           IF ERRORLEVEL 1 (
   586         -          ECHO Failed to copy "sqlite3.dll" to "%BINARYDIRECTORY%\%%B\%%D\".
          647  +          ECHO Failed to copy "%DLL_FILE_NAME%" to "%BINARYDIRECTORY%\%%B\%%D\".
   587    648             GOTO errors
   588    649           )
   589    650   
   590    651           REM
   591    652           REM NOTE: Copy the "sqlite3.lib" file to the appropriate directory for
   592    653           REM       the build and platform beneath the binary directory.
   593    654           REM
   594         -        %__ECHO% XCOPY sqlite3.lib "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
          655  +        %__ECHO% XCOPY "%LIB_FILE_NAME%" "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
   595    656   
   596    657           IF ERRORLEVEL 1 (
   597         -          ECHO Failed to copy "sqlite3.lib" to "%BINARYDIRECTORY%\%%B\%%D\".
          658  +          ECHO Failed to copy "%LIB_FILE_NAME%" to "%BINARYDIRECTORY%\%%B\%%D\".
   598    659             GOTO errors
   599    660           )
   600    661   
   601    662           REM
   602    663           REM NOTE: Copy the "sqlite3.pdb" file to the appropriate directory for
   603    664           REM       the build and platform beneath the binary directory unless we
   604    665           REM       are prevented from doing so.
   605    666           REM
   606    667           IF NOT DEFINED NOSYMBOLS (
   607         -          %__ECHO% XCOPY sqlite3.pdb "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
          668  +          %__ECHO% XCOPY "%DLL_PDB_FILE_NAME%" "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
   608    669   
   609    670             IF ERRORLEVEL 1 (
   610         -            ECHO Failed to copy "sqlite3.pdb" to "%BINARYDIRECTORY%\%%B\%%D\".
          671  +            ECHO Failed to copy "%DLL_PDB_FILE_NAME%" to "%BINARYDIRECTORY%\%%B\%%D\".
   611    672               GOTO errors
   612    673             )
   613    674           )
   614    675   
   615    676           REM
   616    677           REM NOTE: If requested, also build the shell executable.
   617    678           REM
................................................................................
   623    684             IF DEFINED NOCLEAN (
   624    685               REM
   625    686               REM NOTE: Even when the cleaning step has been disabled, we still
   626    687               REM       need to remove the build output for all the files we are
   627    688               REM       specifically wanting to build for each platform.
   628    689               REM
   629    690               %_AECHO% Cleaning final shell executable output files only...
   630         -            %__ECHO% DEL /Q sqlite3.exe sqlite3sh.pdb 2%REDIRECT% NUL
          691  +            %__ECHO% DEL /Q "%EXE_FILE_NAME%" "%EXE_PDB_FILE_NAME%" 2%REDIRECT% NUL
   631    692             )
   632    693   
   633    694             REM
   634    695             REM NOTE: Call NMAKE with the MSVC makefile to build the "sqlite3.exe"
   635    696             REM       binary.  The x86 compiler will be used to compile the native
   636    697             REM       command line tools needed during the build process itself.
   637    698             REM       Also, disable looking for and/or linking to the native Tcl
   638    699             REM       runtime library.
   639    700             REM
   640         -          %__ECHO% %NMAKE_CMD% sqlite3.exe XCOMPILE=1 USE_NATIVE_LIBPATHS=1 NO_TCL=1 %NMAKE_ARGS%
          701  +          CALL :fn_MakeExe %%D
   641    702   
   642    703             IF ERRORLEVEL 1 (
   643         -            ECHO Failed to build %%B "sqlite3.exe" for platform %%P.
          704  +            ECHO Failed to build %%B "%EXE_FILE_NAME%" for platform %%P.
   644    705               GOTO errors
   645    706             )
   646    707   
   647    708             REM
   648    709             REM NOTE: Copy the "sqlite3.exe" file to the appropriate directory
   649    710             REM       for the build and platform beneath the binary directory.
   650    711             REM
   651         -          %__ECHO% XCOPY sqlite3.exe "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
          712  +          %__ECHO% XCOPY "%EXE_FILE_NAME%" "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
   652    713   
   653    714             IF ERRORLEVEL 1 (
   654         -            ECHO Failed to copy "sqlite3.exe" to "%BINARYDIRECTORY%\%%B\%%D\".
          715  +            ECHO Failed to copy "%EXE_FILE_NAME%" to "%BINARYDIRECTORY%\%%B\%%D\".
   655    716               GOTO errors
   656    717             )
   657    718   
   658    719             REM
   659    720             REM NOTE: Copy the "sqlite3sh.pdb" file to the appropriate directory
   660    721             REM       for the build and platform beneath the binary directory
   661    722             REM       unless we are prevented from doing so.
   662    723             REM
   663    724             IF NOT DEFINED NOSYMBOLS (
   664         -            %__ECHO% XCOPY sqlite3sh.pdb "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
          725  +            %__ECHO% XCOPY "%EXE_PDB_FILE_NAME%" "%BINARYDIRECTORY%\%%B\%%D\" %FFLAGS% %DFLAGS%
   665    726   
   666    727               IF ERRORLEVEL 1 (
   667         -              ECHO Failed to copy "sqlite3sh.pdb" to "%BINARYDIRECTORY%\%%B\%%D\".
          728  +              ECHO Failed to copy "%EXE_PDB_FILE_NAME%" to "%BINARYDIRECTORY%\%%B\%%D\".
   668    729                 GOTO errors
   669    730               )
   670    731             )
   671    732           )
   672    733         )
   673    734       )
   674    735     )
................................................................................
   691    752     GOTO errors
   692    753   )
   693    754   
   694    755   REM
   695    756   REM NOTE: If we get to this point, we have succeeded.
   696    757   REM
   697    758   GOTO no_errors
          759  +
          760  +:fn_MakeClean
          761  +  %__ECHO% %NMAKE_CMD% clean "PLATFORM=%1" XCOMPILE=1 USE_NATIVE_LIBPATHS=1 NO_TCL=1 %NMAKE_ARGS% %NMAKE_ARGS_CFG%
          762  +  GOTO :EOF
          763  +
          764  +:fn_MakeDll
          765  +  %__ECHO% %NMAKE_CMD% "%DLL_FILE_NAME%" "PLATFORM=%1" XCOMPILE=1 USE_NATIVE_LIBPATHS=1 NO_TCL=1 %NMAKE_ARGS% %NMAKE_ARGS_CFG%
          766  +  GOTO :EOF
          767  +
          768  +:fn_MakeExe
          769  +  %__ECHO% %NMAKE_CMD% "%EXE_FILE_NAME%" "PLATFORM=%1" XCOMPILE=1 USE_NATIVE_LIBPATHS=1 NO_TCL=1 %NMAKE_ARGS% %NMAKE_ARGS_CFG%
          770  +  GOTO :EOF
   698    771   
   699    772   :fn_ShowVariable
   700    773     SETLOCAL
   701    774     SET __ECHO_CMD=ECHO %%%2%%
   702    775     FOR /F "delims=" %%V IN ('%__ECHO_CMD%') DO (
   703    776       IF NOT "%%V" == "" (
   704    777         IF NOT "%%V" == "%%%2%%" (

Changes to tool/lempar.c.

    83     83   #ifndef INTERFACE
    84     84   # define INTERFACE 1
    85     85   #endif
    86     86   /************* Begin control #defines *****************************************/
    87     87   %%
    88     88   /************* End control #defines *******************************************/
    89     89   
    90         -/* The yyzerominor constant is used to initialize instances of
    91         -** YYMINORTYPE objects to zero. */
    92         -static const YYMINORTYPE yyzerominor = { 0 };
    93         -
    94     90   /* Define the yytestcase() macro to be a no-op if is not already defined
    95     91   ** otherwise.
    96     92   **
    97     93   ** Applications can choose to define yytestcase() in the %include section
    98     94   ** to a macro that can assist in verifying code coverage.  For production
    99     95   ** code the yytestcase() macro should be turned off.  But it is useful
   100     96   ** for testing.

Changes to tool/mkmsvcmin.tcl.

    88     88         {# <<block${i}>>\n.*?# <</block${i}>>\n}] \
    89     89         $data [escapeSubSpec $blocks($i)] data
    90     90   }
    91     91   
    92     92   set data [string map [list " -I\$(TOP)\\src" ""] $data]
    93     93   set data [string map [list " /DEF:sqlite3.def" ""] $data]
    94     94   set data [string map [list " sqlite3.def" ""] $data]
           95  +set data [string map [list " libsqlite3.lib" ""] $data]
    95     96   set data [string map [list " \$(ALL_TCL_TARGETS)" ""] $data]
    96     97   set data [string map [list "\$(TOP)\\src\\" "\$(TOP)\\"] $data]
    97     98   
    98     99   writeFile $toFileName $data

Changes to tool/mkvsix.tcl.

   459    459     if {$vsVersion ne "2015"} then {
   460    460       fail [appendArgs \
   461    461           "unsupported combination, package flavor " $packageFlavor \
   462    462           " is only supported with Visual Studio 2015"]
   463    463     }
   464    464     set shortName $shortNames($packageFlavor,$vsVersion)
   465    465     set displayName $displayNames($packageFlavor,$vsVersion)
   466         -  set targetPlatformIdentifier UWP
          466  +  set targetPlatformIdentifier UAP; # NOTE: Not "UWP".
   467    467     set targetPlatformVersion v0.8.0.0
   468    468     set minVsVersion [getMinVsVersionXmlChunk $vsVersion]
   469    469     set maxPlatformVersion \
   470    470         [getMaxPlatformVersionXmlChunk $packageFlavor $vsVersion]
   471    471     set extraSdkPath "\\..\\$targetPlatformIdentifier"
   472    472     set extraFileListAttributes \
   473    473         [getExtraFileListXmlChunk $packageFlavor $vsVersion]