/ Check-in [db4e2cc3]
Login

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

Overview
Comment:Merge recent trunk enhancements.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | reuse-schema
Files: files | file ages | folders
SHA3-256: db4e2cc36acca2708e9bd2e0febb4e1b3d6a6a3fa60d9bd6f2a49f4a8d1bc523
User & Date: drh 2019-03-26 11:57:50
Wiki:reuse-schema
Context
2019-03-26
18:40
Add a few extra tests for SQLITE_STATUS_SCHEMA_USED with shared-schema databases. check-in: e399fede user: dan tags: reuse-schema
11:57
Merge recent trunk enhancements. check-in: db4e2cc3 user: drh tags: reuse-schema
2019-03-25
22:05
Fix an obsolete comment in the CLI. No code changes. check-in: fade103c user: drh tags: trunk
2019-03-21
17:22
Merge latest trunk changes with this branch. check-in: 3196f5f4 user: dan tags: reuse-schema
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to configure.

   859    859   pdfdir
   860    860   dvidir
   861    861   htmldir
   862    862   infodir
   863    863   docdir
   864    864   oldincludedir
   865    865   includedir
          866  +runstatedir
   866    867   localstatedir
   867    868   sharedstatedir
   868    869   sysconfdir
   869    870   datadir
   870    871   datarootdir
   871    872   libexecdir
   872    873   sbindir
................................................................................
   960    961   sbindir='${exec_prefix}/sbin'
   961    962   libexecdir='${exec_prefix}/libexec'
   962    963   datarootdir='${prefix}/share'
   963    964   datadir='${datarootdir}'
   964    965   sysconfdir='${prefix}/etc'
   965    966   sharedstatedir='${prefix}/com'
   966    967   localstatedir='${prefix}/var'
          968  +runstatedir='${localstatedir}/run'
   967    969   includedir='${prefix}/include'
   968    970   oldincludedir='/usr/include'
   969    971   docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
   970    972   infodir='${datarootdir}/info'
   971    973   htmldir='${docdir}'
   972    974   dvidir='${docdir}'
   973    975   pdfdir='${docdir}'
................................................................................
  1211   1213       ac_prev=psdir ;;
  1212   1214     -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
  1213   1215       psdir=$ac_optarg ;;
  1214   1216   
  1215   1217     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  1216   1218     | -silent | --silent | --silen | --sile | --sil)
  1217   1219       silent=yes ;;
         1220  +
         1221  +  -runstatedir | --runstatedir | --runstatedi | --runstated \
         1222  +  | --runstate | --runstat | --runsta | --runst | --runs \
         1223  +  | --run | --ru | --r)
         1224  +    ac_prev=runstatedir ;;
         1225  +  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
         1226  +  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
         1227  +  | --run=* | --ru=* | --r=*)
         1228  +    runstatedir=$ac_optarg ;;
  1218   1229   
  1219   1230     -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
  1220   1231       ac_prev=sbindir ;;
  1221   1232     -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  1222   1233     | --sbi=* | --sb=*)
  1223   1234       sbindir=$ac_optarg ;;
  1224   1235   
................................................................................
  1349   1360     esac
  1350   1361   fi
  1351   1362   
  1352   1363   # Check all directory arguments for consistency.
  1353   1364   for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
  1354   1365   		datadir sysconfdir sharedstatedir localstatedir includedir \
  1355   1366   		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
  1356         -		libdir localedir mandir
         1367  +		libdir localedir mandir runstatedir
  1357   1368   do
  1358   1369     eval ac_val=\$$ac_var
  1359   1370     # Remove trailing slashes.
  1360   1371     case $ac_val in
  1361   1372       */ )
  1362   1373         ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
  1363   1374         eval $ac_var=\$ac_val;;
................................................................................
  1502   1513   Fine tuning of the installation directories:
  1503   1514     --bindir=DIR            user executables [EPREFIX/bin]
  1504   1515     --sbindir=DIR           system admin executables [EPREFIX/sbin]
  1505   1516     --libexecdir=DIR        program executables [EPREFIX/libexec]
  1506   1517     --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  1507   1518     --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  1508   1519     --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
         1520  +  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
  1509   1521     --libdir=DIR            object code libraries [EPREFIX/lib]
  1510   1522     --includedir=DIR        C header files [PREFIX/include]
  1511   1523     --oldincludedir=DIR     C header files for non-gcc [/usr/include]
  1512   1524     --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  1513   1525     --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  1514   1526     --infodir=DIR           info documentation [DATAROOTDIR/info]
  1515   1527     --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
................................................................................
  3930   3942   { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
  3931   3943   $as_echo_n "checking the name lister ($NM) interface... " >&6; }
  3932   3944   if ${lt_cv_nm_interface+:} false; then :
  3933   3945     $as_echo_n "(cached) " >&6
  3934   3946   else
  3935   3947     lt_cv_nm_interface="BSD nm"
  3936   3948     echo "int some_variable = 0;" > conftest.$ac_ext
  3937         -  (eval echo "\"\$as_me:3937: $ac_compile\"" >&5)
         3949  +  (eval echo "\"\$as_me:3949: $ac_compile\"" >&5)
  3938   3950     (eval "$ac_compile" 2>conftest.err)
  3939   3951     cat conftest.err >&5
  3940         -  (eval echo "\"\$as_me:3940: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
         3952  +  (eval echo "\"\$as_me:3952: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
  3941   3953     (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
  3942   3954     cat conftest.err >&5
  3943         -  (eval echo "\"\$as_me:3943: output\"" >&5)
         3955  +  (eval echo "\"\$as_me:3955: output\"" >&5)
  3944   3956     cat conftest.out >&5
  3945   3957     if $GREP 'External.*some_variable' conftest.out > /dev/null; then
  3946   3958       lt_cv_nm_interface="MS dumpbin"
  3947   3959     fi
  3948   3960     rm -f conftest*
  3949   3961   fi
  3950   3962   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
................................................................................
  5142   5154   	;;
  5143   5155       esac
  5144   5156     fi
  5145   5157     rm -rf conftest*
  5146   5158     ;;
  5147   5159   *-*-irix6*)
  5148   5160     # Find out which ABI we are using.
  5149         -  echo '#line 5149 "configure"' > conftest.$ac_ext
         5161  +  echo '#line 5161 "configure"' > conftest.$ac_ext
  5150   5162     if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
  5151   5163     (eval $ac_compile) 2>&5
  5152   5164     ac_status=$?
  5153   5165     $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  5154   5166     test $ac_status = 0; }; then
  5155   5167       if test "$lt_cv_prog_gnu_ld" = yes; then
  5156   5168         case `/usr/bin/file conftest.$ac_objext` in
................................................................................
  6667   6679      # Note that $ac_compile itself does not contain backslashes and begins
  6668   6680      # with a dollar sign (not a hyphen), so the echo should work correctly.
  6669   6681      # The option is referenced via a variable to avoid confusing sed.
  6670   6682      lt_compile=`echo "$ac_compile" | $SED \
  6671   6683      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  6672   6684      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
  6673   6685      -e 's:$: $lt_compiler_flag:'`
  6674         -   (eval echo "\"\$as_me:6674: $lt_compile\"" >&5)
         6686  +   (eval echo "\"\$as_me:6686: $lt_compile\"" >&5)
  6675   6687      (eval "$lt_compile" 2>conftest.err)
  6676   6688      ac_status=$?
  6677   6689      cat conftest.err >&5
  6678         -   echo "$as_me:6678: \$? = $ac_status" >&5
         6690  +   echo "$as_me:6690: \$? = $ac_status" >&5
  6679   6691      if (exit $ac_status) && test -s "$ac_outfile"; then
  6680   6692        # The compiler can only warn and ignore the option if not recognized
  6681   6693        # So say no if there are warnings other than the usual output.
  6682   6694        $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
  6683   6695        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
  6684   6696        if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
  6685   6697          lt_cv_prog_compiler_rtti_exceptions=yes
................................................................................
  7006   7018      # Note that $ac_compile itself does not contain backslashes and begins
  7007   7019      # with a dollar sign (not a hyphen), so the echo should work correctly.
  7008   7020      # The option is referenced via a variable to avoid confusing sed.
  7009   7021      lt_compile=`echo "$ac_compile" | $SED \
  7010   7022      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  7011   7023      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
  7012   7024      -e 's:$: $lt_compiler_flag:'`
  7013         -   (eval echo "\"\$as_me:7013: $lt_compile\"" >&5)
         7025  +   (eval echo "\"\$as_me:7025: $lt_compile\"" >&5)
  7014   7026      (eval "$lt_compile" 2>conftest.err)
  7015   7027      ac_status=$?
  7016   7028      cat conftest.err >&5
  7017         -   echo "$as_me:7017: \$? = $ac_status" >&5
         7029  +   echo "$as_me:7029: \$? = $ac_status" >&5
  7018   7030      if (exit $ac_status) && test -s "$ac_outfile"; then
  7019   7031        # The compiler can only warn and ignore the option if not recognized
  7020   7032        # So say no if there are warnings other than the usual output.
  7021   7033        $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
  7022   7034        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
  7023   7035        if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
  7024   7036          lt_cv_prog_compiler_pic_works=yes
................................................................................
  7111   7123      # (2) before a word containing "conftest.", or (3) at the end.
  7112   7124      # Note that $ac_compile itself does not contain backslashes and begins
  7113   7125      # with a dollar sign (not a hyphen), so the echo should work correctly.
  7114   7126      lt_compile=`echo "$ac_compile" | $SED \
  7115   7127      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  7116   7128      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
  7117   7129      -e 's:$: $lt_compiler_flag:'`
  7118         -   (eval echo "\"\$as_me:7118: $lt_compile\"" >&5)
         7130  +   (eval echo "\"\$as_me:7130: $lt_compile\"" >&5)
  7119   7131      (eval "$lt_compile" 2>out/conftest.err)
  7120   7132      ac_status=$?
  7121   7133      cat out/conftest.err >&5
  7122         -   echo "$as_me:7122: \$? = $ac_status" >&5
         7134  +   echo "$as_me:7134: \$? = $ac_status" >&5
  7123   7135      if (exit $ac_status) && test -s out/conftest2.$ac_objext
  7124   7136      then
  7125   7137        # The compiler can only warn and ignore the option if not recognized
  7126   7138        # So say no if there are warnings
  7127   7139        $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
  7128   7140        $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
  7129   7141        if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
................................................................................
  7166   7178      # (2) before a word containing "conftest.", or (3) at the end.
  7167   7179      # Note that $ac_compile itself does not contain backslashes and begins
  7168   7180      # with a dollar sign (not a hyphen), so the echo should work correctly.
  7169   7181      lt_compile=`echo "$ac_compile" | $SED \
  7170   7182      -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  7171   7183      -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
  7172   7184      -e 's:$: $lt_compiler_flag:'`
  7173         -   (eval echo "\"\$as_me:7173: $lt_compile\"" >&5)
         7185  +   (eval echo "\"\$as_me:7185: $lt_compile\"" >&5)
  7174   7186      (eval "$lt_compile" 2>out/conftest.err)
  7175   7187      ac_status=$?
  7176   7188      cat out/conftest.err >&5
  7177         -   echo "$as_me:7177: \$? = $ac_status" >&5
         7189  +   echo "$as_me:7189: \$? = $ac_status" >&5
  7178   7190      if (exit $ac_status) && test -s out/conftest2.$ac_objext
  7179   7191      then
  7180   7192        # The compiler can only warn and ignore the option if not recognized
  7181   7193        # So say no if there are warnings
  7182   7194        $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
  7183   7195        $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
  7184   7196        if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
................................................................................
  9546   9558   else
  9547   9559     	  if test "$cross_compiling" = yes; then :
  9548   9560     lt_cv_dlopen_self=cross
  9549   9561   else
  9550   9562     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  9551   9563     lt_status=$lt_dlunknown
  9552   9564     cat > conftest.$ac_ext <<_LT_EOF
  9553         -#line 9553 "configure"
         9565  +#line 9565 "configure"
  9554   9566   #include "confdefs.h"
  9555   9567   
  9556   9568   #if HAVE_DLFCN_H
  9557   9569   #include <dlfcn.h>
  9558   9570   #endif
  9559   9571   
  9560   9572   #include <stdio.h>
................................................................................
  9642   9654   else
  9643   9655     	  if test "$cross_compiling" = yes; then :
  9644   9656     lt_cv_dlopen_self_static=cross
  9645   9657   else
  9646   9658     lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  9647   9659     lt_status=$lt_dlunknown
  9648   9660     cat > conftest.$ac_ext <<_LT_EOF
  9649         -#line 9649 "configure"
         9661  +#line 9661 "configure"
  9650   9662   #include "confdefs.h"
  9651   9663   
  9652   9664   #if HAVE_DLFCN_H
  9653   9665   #include <dlfcn.h>
  9654   9666   #endif
  9655   9667   
  9656   9668   #include <stdio.h>
................................................................................
  9991  10003   	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  9992  10004   /* end confdefs.h.  */
  9993  10005   #include <sys/types.h>
  9994  10006    /* Check that off_t can represent 2**63 - 1 correctly.
  9995  10007       We can't simply define LARGE_OFF_T to be 9223372036854775807,
  9996  10008       since some C++ compilers masquerading as C compilers
  9997  10009       incorrectly reject 9223372036854775807.  */
  9998         -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
        10010  +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
  9999  10011     int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 10000  10012   		       && LARGE_OFF_T % 2147483647 == 1)
 10001  10013   		      ? 1 : -1];
 10002  10014   int
 10003  10015   main ()
 10004  10016   {
 10005  10017   
................................................................................
 10037  10049     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 10038  10050   /* end confdefs.h.  */
 10039  10051   #include <sys/types.h>
 10040  10052    /* Check that off_t can represent 2**63 - 1 correctly.
 10041  10053       We can't simply define LARGE_OFF_T to be 9223372036854775807,
 10042  10054       since some C++ compilers masquerading as C compilers
 10043  10055       incorrectly reject 9223372036854775807.  */
 10044         -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
        10056  +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
 10045  10057     int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 10046  10058   		       && LARGE_OFF_T % 2147483647 == 1)
 10047  10059   		      ? 1 : -1];
 10048  10060   int
 10049  10061   main ()
 10050  10062   {
 10051  10063   
................................................................................
 10061  10073   /* end confdefs.h.  */
 10062  10074   #define _FILE_OFFSET_BITS 64
 10063  10075   #include <sys/types.h>
 10064  10076    /* Check that off_t can represent 2**63 - 1 correctly.
 10065  10077       We can't simply define LARGE_OFF_T to be 9223372036854775807,
 10066  10078       since some C++ compilers masquerading as C compilers
 10067  10079       incorrectly reject 9223372036854775807.  */
 10068         -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
        10080  +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
 10069  10081     int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 10070  10082   		       && LARGE_OFF_T % 2147483647 == 1)
 10071  10083   		      ? 1 : -1];
 10072  10084   int
 10073  10085   main ()
 10074  10086   {
 10075  10087   
................................................................................
 10106  10118     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 10107  10119   /* end confdefs.h.  */
 10108  10120   #include <sys/types.h>
 10109  10121    /* Check that off_t can represent 2**63 - 1 correctly.
 10110  10122       We can't simply define LARGE_OFF_T to be 9223372036854775807,
 10111  10123       since some C++ compilers masquerading as C compilers
 10112  10124       incorrectly reject 9223372036854775807.  */
 10113         -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
        10125  +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
 10114  10126     int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 10115  10127   		       && LARGE_OFF_T % 2147483647 == 1)
 10116  10128   		      ? 1 : -1];
 10117  10129   int
 10118  10130   main ()
 10119  10131   {
 10120  10132   
................................................................................
 10130  10142   /* end confdefs.h.  */
 10131  10143   #define _LARGE_FILES 1
 10132  10144   #include <sys/types.h>
 10133  10145    /* Check that off_t can represent 2**63 - 1 correctly.
 10134  10146       We can't simply define LARGE_OFF_T to be 9223372036854775807,
 10135  10147       since some C++ compilers masquerading as C compilers
 10136  10148       incorrectly reject 9223372036854775807.  */
 10137         -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
        10149  +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
 10138  10150     int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 10139  10151   		       && LARGE_OFF_T % 2147483647 == 1)
 10140  10152   		      ? 1 : -1];
 10141  10153   int
 10142  10154   main ()
 10143  10155   {
 10144  10156   

Changes to ext/misc/fileio.c.

   289    289   #endif
   290    290   }
   291    291   
   292    292   /*
   293    293   ** Argument zFile is the name of a file that will be created and/or written
   294    294   ** by SQL function writefile(). This function ensures that the directory
   295    295   ** zFile will be written to exists, creating it if required. The permissions
   296         -** for any path components created by this function are set to (mode&0777).
          296  +** for any path components created by this function are set in accordance
          297  +** with the current umask.
   297    298   **
   298    299   ** If an OOM condition is encountered, SQLITE_NOMEM is returned. Otherwise,
   299    300   ** SQLITE_OK is returned if the directory is successfully created, or
   300    301   ** SQLITE_ERROR otherwise.
   301    302   */
   302    303   static int makeDirectory(
   303         -  const char *zFile,
   304         -  mode_t mode
          304  +  const char *zFile
   305    305   ){
   306    306     char *zCopy = sqlite3_mprintf("%s", zFile);
   307    307     int rc = SQLITE_OK;
   308    308   
   309    309     if( zCopy==0 ){
   310    310       rc = SQLITE_NOMEM;
   311    311     }else{
................................................................................
   318    318   
   319    319         for(; zCopy[i]!='/' && i<nCopy; i++);
   320    320         if( i==nCopy ) break;
   321    321         zCopy[i] = '\0';
   322    322   
   323    323         rc2 = fileStat(zCopy, &sStat);
   324    324         if( rc2!=0 ){
   325         -        if( mkdir(zCopy, mode & 0777) ) rc = SQLITE_ERROR;
          325  +        if( mkdir(zCopy, 0777) ) rc = SQLITE_ERROR;
   326    326         }else{
   327    327           if( !S_ISDIR(sStat.st_mode) ) rc = SQLITE_ERROR;
   328    328         }
   329    329         zCopy[i] = '/';
   330    330         i++;
   331    331       }
   332    332   
................................................................................
   476    476     }
   477    477     if( argc==4 ){
   478    478       mtime = sqlite3_value_int64(argv[3]);
   479    479     }
   480    480   
   481    481     res = writeFile(context, zFile, argv[1], mode, mtime);
   482    482     if( res==1 && errno==ENOENT ){
   483         -    if( makeDirectory(zFile, mode)==SQLITE_OK ){
          483  +    if( makeDirectory(zFile)==SQLITE_OK ){
   484    484         res = writeFile(context, zFile, argv[1], mode, mtime);
   485    485       }
   486    486     }
   487    487   
   488    488     if( argc>2 && res!=0 ){
   489    489       if( S_ISLNK(mode) ){
   490    490         ctxErrorMsg(context, "failed to create symlink: %s", zFile);

Changes to src/btree.c.

  1451   1451           }
  1452   1452           if( iFree2 ){
  1453   1453             if( iFree+sz>iFree2 ) return SQLITE_CORRUPT_PAGE(pPage);
  1454   1454             sz2 = get2byte(&data[iFree2+2]);
  1455   1455             if( iFree2+sz2 > usableSize ) return SQLITE_CORRUPT_PAGE(pPage);
  1456   1456             memmove(&data[iFree+sz+sz2], &data[iFree+sz], iFree2-(iFree+sz));
  1457   1457             sz += sz2;
         1458  +        }else if( iFree+sz>usableSize ){
         1459  +          return SQLITE_CORRUPT_PAGE(pPage);
  1458   1460           }
         1461  +
  1459   1462           cbrk = top+sz;
  1460   1463           assert( cbrk+(iFree-top) <= usableSize );
  1461   1464           memmove(&data[cbrk], &data[top], iFree-top);
  1462   1465           for(pAddr=&data[cellOffset]; pAddr<pEnd; pAddr+=2){
  1463   1466             pc = get2byte(pAddr);
  1464   1467             if( pc<iFree ){ put2byte(pAddr, pc+sz); }
  1465   1468             else if( pc<iFree2 ){ put2byte(pAddr, pc+sz2); }
................................................................................
  6186   6189     int rc;                             /* Return Code */
  6187   6190     int nFree;                          /* Initial number of pages on free-list */
  6188   6191   
  6189   6192     assert( sqlite3_mutex_held(pBt->mutex) );
  6190   6193     assert( CORRUPT_DB || iPage>1 );
  6191   6194     assert( !pMemPage || pMemPage->pgno==iPage );
  6192   6195   
  6193         -  if( iPage<2 ) return SQLITE_CORRUPT_BKPT;
         6196  +  if( iPage<2 || iPage>pBt->nPage ){
         6197  +    return SQLITE_CORRUPT_BKPT;
         6198  +  }
  6194   6199     if( pMemPage ){
  6195   6200       pPage = pMemPage;
  6196   6201       sqlite3PagerRef(pPage->pDbPage);
  6197   6202     }else{
  6198   6203       pPage = btreePageLookup(pBt, iPage);
  6199   6204     }
  6200   6205   
................................................................................
  8159   8164       ** by smaller than the child due to the database header, and so all the
  8160   8165       ** free space needs to be up front.
  8161   8166       */
  8162   8167       assert( nNew==1 || CORRUPT_DB );
  8163   8168       rc = defragmentPage(apNew[0], -1);
  8164   8169       testcase( rc!=SQLITE_OK );
  8165   8170       assert( apNew[0]->nFree == 
  8166         -        (get2byte(&apNew[0]->aData[5])-apNew[0]->cellOffset-apNew[0]->nCell*2)
         8171  +        (get2byteNotZero(&apNew[0]->aData[5]) - apNew[0]->cellOffset
         8172  +          - apNew[0]->nCell*2)
  8167   8173         || rc!=SQLITE_OK
  8168   8174       );
  8169   8175       copyNodeContent(apNew[0], pParent, &rc);
  8170   8176       freePage(apNew[0], &rc);
  8171   8177     }else if( ISAUTOVACUUM && !leafCorrection ){
  8172   8178       /* Fix the pointer map entries associated with the right-child of each
  8173   8179       ** sibling page. All other pointer map entries have already been taken

Changes to src/build.c.

  3206   3206     }
  3207   3207     pDb = &db->aDb[iDb];
  3208   3208   
  3209   3209     assert( pTab!=0 );
  3210   3210     assert( pParse->nErr==0 );
  3211   3211     if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 
  3212   3212          && db->init.busy==0
         3213  +       && pTblName!=0
  3213   3214   #if SQLITE_USER_AUTHENTICATION
  3214   3215          && sqlite3UserAuthTable(pTab->zName)==0
  3215   3216   #endif
  3216   3217   #ifdef SQLITE_ALLOW_SQLITE_MASTER_INDEX
  3217   3218          && sqlite3StrICmp(&pTab->zName[7],"master")!=0
  3218   3219   #endif
  3219         -       && sqlite3StrNICmp(&pTab->zName[7],"altertab_",9)!=0
  3220   3220    ){
  3221   3221       sqlite3ErrorMsg(pParse, "table %s may not be indexed", pTab->zName);
  3222   3222       goto exit_create_index;
  3223   3223     }
  3224   3224   #ifndef SQLITE_OMIT_VIEW
  3225   3225     if( pTab->pSelect ){
  3226   3226       sqlite3ErrorMsg(pParse, "views may not be indexed");

Changes to src/main.c.

   839    839           { SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, SQLITE_Fts3Tokenizer  },
   840    840           { SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, SQLITE_LoadExtension  },
   841    841           { SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE,      SQLITE_NoCkptOnClose  },
   842    842           { SQLITE_DBCONFIG_ENABLE_QPSG,           SQLITE_EnableQPSG     },
   843    843           { SQLITE_DBCONFIG_TRIGGER_EQP,           SQLITE_TriggerEQP     },
   844    844           { SQLITE_DBCONFIG_RESET_DATABASE,        SQLITE_ResetDatabase  },
   845    845           { SQLITE_DBCONFIG_DEFENSIVE,             SQLITE_Defensive      },
          846  +        { SQLITE_DBCONFIG_WRITABLE_SCHEMA,       SQLITE_WriteSchema|
          847  +                                                 SQLITE_NoSchemaError  },
   846    848         };
   847    849         unsigned int i;
   848    850         rc = SQLITE_ERROR; /* IMP: R-42790-23372 */
   849    851         for(i=0; i<ArraySize(aFlagOp); i++){
   850    852           if( aFlagOp[i].op==op ){
   851    853             int onoff = va_arg(ap, int);
   852    854             int *pRes = va_arg(ap, int*);

Changes to src/shell.c.in.

  2744   2744     sqlite3SelectTrace = savedSelectTrace;
  2745   2745   #endif
  2746   2746   #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE)
  2747   2747     sqlite3WhereTrace = savedWhereTrace;
  2748   2748   #endif
  2749   2749   }
  2750   2750   
  2751         -/* Name of the TEMP table that holds bind parameter values */
  2752         -#define BIND_PARAM_TABLE "$Parameters"
  2753         -
  2754   2751   /* Create the TEMP table used to store parameter bindings */
  2755   2752   static void bind_table_init(ShellState *p){
         2753  +  int wrSchema = 0;
         2754  +  sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema);
         2755  +  sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0);
  2756   2756     sqlite3_exec(p->db,
  2757         -    "CREATE TABLE IF NOT EXISTS temp.[" BIND_PARAM_TABLE "](\n"
         2757  +    "CREATE TABLE IF NOT EXISTS temp.sqlite_parameters(\n"
  2758   2758       "  key TEXT PRIMARY KEY,\n"
  2759   2759       "  value ANY\n"
  2760   2760       ") WITHOUT ROWID;",
  2761   2761       0, 0, 0);
         2762  +  sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0);
  2762   2763   }
  2763   2764   
  2764   2765   /*
  2765   2766   ** Bind parameters on a prepared statement.
  2766   2767   **
  2767   2768   ** Parameter bindings are taken from a TEMP table of the form:
  2768   2769   **
  2769         -**    CREATE TEMP TABLE "$Parameters"(key TEXT PRIMARY KEY, value)
         2770  +**    CREATE TEMP TABLE sqlite_parameters(key TEXT PRIMARY KEY, value)
  2770   2771   **    WITHOUT ROWID;
  2771   2772   **
  2772   2773   ** No bindings occur if this table does not exist.  The special character '$'
  2773   2774   ** is included in the table name to help prevent collisions with actual tables.
  2774   2775   ** The table must be in the TEMP schema.
  2775   2776   */
  2776   2777   static void bind_prepared_stmt(ShellState *pArg, sqlite3_stmt *pStmt){
................................................................................
  2777   2778     int nVar;
  2778   2779     int i;
  2779   2780     int rc;
  2780   2781     sqlite3_stmt *pQ = 0;
  2781   2782   
  2782   2783     nVar = sqlite3_bind_parameter_count(pStmt);
  2783   2784     if( nVar==0 ) return;  /* Nothing to do */
  2784         -  if( sqlite3_table_column_metadata(pArg->db, "TEMP", BIND_PARAM_TABLE,
         2785  +  if( sqlite3_table_column_metadata(pArg->db, "TEMP", "sqlite_parameters",
  2785   2786                                       "key", 0, 0, 0, 0, 0)!=SQLITE_OK ){
  2786   2787       return; /* Parameter table does not exist */
  2787   2788     }
  2788   2789     rc = sqlite3_prepare_v2(pArg->db,
  2789         -          "SELECT value FROM temp.\"" BIND_PARAM_TABLE "\""
         2790  +          "SELECT value FROM temp.sqlite_parameters"
  2790   2791             " WHERE key=?1", -1, &pQ, 0);
  2791   2792     if( rc || pQ==0 ) return;
  2792   2793     for(i=1; i<=nVar; i++){
  2793   2794       char zNum[30];
  2794   2795       const char *zVar = sqlite3_bind_parameter_name(pStmt, i);
  2795   2796       if( zVar==0 ){
  2796   2797         sqlite3_snprintf(sizeof(zNum),zNum,"?%d",i);
................................................................................
  3774   3775   ** start of the description of what that command does.
  3775   3776   */
  3776   3777   static const char *(azHelp[]) = {
  3777   3778   #if defined(SQLITE_HAVE_ZLIB) && !defined(SQLITE_OMIT_VIRTUALTABLE)
  3778   3779     ".archive ...             Manage SQL archives",
  3779   3780     "   Each command must have exactly one of the following options:",
  3780   3781     "     -c, --create               Create a new archive",
  3781         -  "     -u, --update               Update or add files to an existing archive",
         3782  +  "     -u, --update               Add files or update files with changed mtime",
         3783  +  "     -i, --insert               Like -u but always add even if mtime unchanged",
  3782   3784     "     -t, --list                 List contents of archive",
  3783   3785     "     -x, --extract              Extract files from archive",
  3784   3786     "   Optional arguments:",
  3785   3787     "     -v, --verbose              Print each filename as it is processed",
  3786   3788     "     -f FILE, --file FILE       Operate on archive FILE (default is current db)",
  3787   3789     "     -a FILE, --append FILE     Operate on FILE opened using the apndvfs VFS",
  3788   3790     "     -C DIR, --directory DIR    Change to directory DIR to read/extract files",
................................................................................
  5645   5647     return SQLITE_ERROR;
  5646   5648   }
  5647   5649   
  5648   5650   /*
  5649   5651   ** Values for ArCommand.eCmd.
  5650   5652   */
  5651   5653   #define AR_CMD_CREATE       1
  5652         -#define AR_CMD_EXTRACT      2
  5653         -#define AR_CMD_LIST         3
  5654         -#define AR_CMD_UPDATE       4
  5655         -#define AR_CMD_HELP         5
         5654  +#define AR_CMD_UPDATE       2
         5655  +#define AR_CMD_INSERT       3
         5656  +#define AR_CMD_EXTRACT      4
         5657  +#define AR_CMD_LIST         5
         5658  +#define AR_CMD_HELP         6
  5656   5659   
  5657   5660   /*
  5658   5661   ** Other (non-command) switches.
  5659   5662   */
  5660         -#define AR_SWITCH_VERBOSE     6
  5661         -#define AR_SWITCH_FILE        7
  5662         -#define AR_SWITCH_DIRECTORY   8
  5663         -#define AR_SWITCH_APPEND      9
  5664         -#define AR_SWITCH_DRYRUN     10
         5663  +#define AR_SWITCH_VERBOSE     7
         5664  +#define AR_SWITCH_FILE        8
         5665  +#define AR_SWITCH_DIRECTORY   9
         5666  +#define AR_SWITCH_APPEND     10
         5667  +#define AR_SWITCH_DRYRUN     11
  5665   5668   
  5666   5669   static int arProcessSwitch(ArCommand *pAr, int eSwitch, const char *zArg){
  5667   5670     switch( eSwitch ){
  5668   5671       case AR_CMD_CREATE:
  5669   5672       case AR_CMD_EXTRACT:
  5670   5673       case AR_CMD_LIST:
  5671   5674       case AR_CMD_UPDATE:
         5675  +    case AR_CMD_INSERT:
  5672   5676       case AR_CMD_HELP:
  5673   5677         if( pAr->eCmd ){
  5674   5678           return arErrorMsg(pAr, "multiple command options");
  5675   5679         }
  5676   5680         pAr->eCmd = eSwitch;
  5677   5681         break;
  5678   5682   
................................................................................
  5711   5715       const char *zLong;
  5712   5716       char cShort;
  5713   5717       u8 eSwitch;
  5714   5718       u8 bArg;
  5715   5719     } aSwitch[] = {
  5716   5720       { "create",    'c', AR_CMD_CREATE,       0 },
  5717   5721       { "extract",   'x', AR_CMD_EXTRACT,      0 },
         5722  +    { "insert",    'i', AR_CMD_INSERT,       0 },
  5718   5723       { "list",      't', AR_CMD_LIST,         0 },
  5719   5724       { "update",    'u', AR_CMD_UPDATE,       0 },
  5720   5725       { "help",      'h', AR_CMD_HELP,         0 },
  5721   5726       { "verbose",   'v', AR_SWITCH_VERBOSE,   0 },
  5722   5727       { "file",      'f', AR_SWITCH_FILE,      1 },
  5723   5728       { "append",    'a', AR_SWITCH_APPEND,    1 },
  5724   5729       { "directory", 'C', AR_SWITCH_DIRECTORY, 1 },
................................................................................
  6046   6051       }
  6047   6052     }
  6048   6053     return rc;
  6049   6054   }
  6050   6055   
  6051   6056   
  6052   6057   /*
  6053         -** Implementation of .ar "create" and "update" commands.
         6058  +** Implementation of .ar "create", "insert", and "update" commands.
         6059  +**
         6060  +**     create    ->     Create a new SQL archive
         6061  +**     insert    ->     Insert or reinsert all files listed
         6062  +**     update    ->     Insert files that have changed or that were not
         6063  +**                      previously in the archive
  6054   6064   **
  6055   6065   ** Create the "sqlar" table in the database if it does not already exist.
  6056   6066   ** Then add each file in the azFile[] array to the archive. Directories
  6057   6067   ** are added recursively. If argument bVerbose is non-zero, a message is
  6058   6068   ** printed on stdout for each file archived.
  6059   6069   **
  6060   6070   ** The create command is the same as update, except that it drops
  6061         -** any existing "sqlar" table before beginning.
         6071  +** any existing "sqlar" table before beginning.  The "insert" command
         6072  +** always overwrites every file named on the command-line, where as
         6073  +** "update" only overwrites if the size or mtime or mode has changed.
  6062   6074   */
  6063   6075   static int arCreateOrUpdateCommand(
  6064   6076     ArCommand *pAr,                 /* Command arguments and options */
  6065         -  int bUpdate                     /* true for a --create.  false for --update */
         6077  +  int bUpdate,                    /* true for a --create. */
         6078  +  int bOnlyIfChanged              /* Only update if file has changed */
  6066   6079   ){
  6067   6080     const char *zCreate = 
  6068   6081         "CREATE TABLE IF NOT EXISTS sqlar(\n"
  6069   6082         "  name TEXT PRIMARY KEY,  -- name of the file\n"
  6070   6083         "  mode INT,               -- access permissions\n"
  6071   6084         "  mtime INT,              -- last modification time\n"
  6072   6085         "  sz INT,                 -- original file size\n"
................................................................................
  6080   6093        "    mode,\n"
  6081   6094        "    mtime,\n"
  6082   6095        "    CASE substr(lsmode(mode),1,1)\n"
  6083   6096        "      WHEN '-' THEN length(data)\n"
  6084   6097        "      WHEN 'd' THEN 0\n"
  6085   6098        "      ELSE -1 END,\n"
  6086   6099        "    sqlar_compress(data)\n"
  6087         -     "  FROM fsdir(%Q,%Q)\n"
  6088         -     "  WHERE lsmode(mode) NOT LIKE '?%%';",
         6100  +     "  FROM fsdir(%Q,%Q) AS disk\n"
         6101  +     "  WHERE lsmode(mode) NOT LIKE '?%%'%s;"
         6102  +     ,
  6089   6103        "REPLACE INTO %s(name,mode,mtime,data)\n"
  6090   6104        "  SELECT\n"
  6091   6105        "    %s,\n"
  6092   6106        "    mode,\n"
  6093   6107        "    mtime,\n"
  6094   6108        "    data\n"
  6095         -     "  FROM fsdir(%Q,%Q)\n"
  6096         -     "  WHERE lsmode(mode) NOT LIKE '?%%';"
         6109  +     "  FROM fsdir(%Q,%Q) AS disk\n"
         6110  +     "  WHERE lsmode(mode) NOT LIKE '?%%'%s;"
  6097   6111     };
  6098   6112     int i;                          /* For iterating through azFile[] */
  6099   6113     int rc;                         /* Return code */
  6100   6114     const char *zTab = 0;           /* SQL table into which to insert */
  6101   6115     char *zSql;
  6102   6116     char zTemp[50];
         6117  +  char *zExists = 0;
  6103   6118   
  6104   6119     arExecSql(pAr, "PRAGMA page_size=512");
  6105   6120     rc = arExecSql(pAr, "SAVEPOINT ar;");
  6106   6121     if( rc!=SQLITE_OK ) return rc;
  6107   6122     zTemp[0] = 0; 
  6108   6123     if( pAr->bZip ){
  6109   6124       /* Initialize the zipfile virtual table, if necessary */
................................................................................
  6126   6141       zTab = "sqlar";
  6127   6142       if( bUpdate==0 ){
  6128   6143         rc = arExecSql(pAr, zDrop);
  6129   6144         if( rc!=SQLITE_OK ) goto end_ar_transaction;
  6130   6145       }
  6131   6146       rc = arExecSql(pAr, zCreate);
  6132   6147     }
         6148  +  if( bOnlyIfChanged ){
         6149  +    zExists = sqlite3_mprintf(
         6150  +      " AND NOT EXISTS("
         6151  +          "SELECT 1 FROM %s AS mem"
         6152  +          " WHERE mem.name=disk.name"
         6153  +          " AND mem.mtime=disk.mtime"
         6154  +          " AND mem.mode=disk.mode)", zTab);
         6155  +  }else{
         6156  +    zExists = sqlite3_mprintf("");
         6157  +  }
         6158  +  if( zExists==0 ) rc = SQLITE_NOMEM;
  6133   6159     for(i=0; i<pAr->nArg && rc==SQLITE_OK; i++){
  6134   6160       char *zSql2 = sqlite3_mprintf(zInsertFmt[pAr->bZip], zTab,
  6135   6161           pAr->bVerbose ? "shell_putsnl(name)" : "name",
  6136         -        pAr->azArg[i], pAr->zDir);
         6162  +        pAr->azArg[i], pAr->zDir, zExists);
  6137   6163       rc = arExecSql(pAr, zSql2);
  6138   6164       sqlite3_free(zSql2);
  6139   6165     }
  6140   6166   end_ar_transaction:
  6141   6167     if( rc!=SQLITE_OK ){
  6142   6168       sqlite3_exec(pAr->db, "ROLLBACK TO ar; RELEASE ar;", 0, 0, 0);
  6143   6169     }else{
................................................................................
  6144   6170       rc = arExecSql(pAr, "RELEASE ar;");
  6145   6171       if( pAr->bZip && pAr->zFile ){
  6146   6172         zSql = sqlite3_mprintf("DROP TABLE %s", zTemp);
  6147   6173         arExecSql(pAr, zSql);
  6148   6174         sqlite3_free(zSql);
  6149   6175       }
  6150   6176     }
         6177  +  sqlite3_free(zExists);
  6151   6178     return rc;
  6152   6179   }
  6153   6180   
  6154   6181   /*
  6155   6182   ** Implementation of ".ar" dot command.
  6156   6183   */
  6157   6184   static int arDotCommand(
................................................................................
  6182   6209             cmd.zSrcTable = sqlite3_mprintf("zipfile(%Q)", cmd.zFile);
  6183   6210           }
  6184   6211         }
  6185   6212         cmd.bZip = 1;
  6186   6213       }else if( cmd.zFile ){
  6187   6214         int flags;
  6188   6215         if( cmd.bAppend ) eDbType = SHELL_OPEN_APPENDVFS;
  6189         -      if( cmd.eCmd==AR_CMD_CREATE || cmd.eCmd==AR_CMD_UPDATE ){
         6216  +      if( cmd.eCmd==AR_CMD_CREATE || cmd.eCmd==AR_CMD_INSERT 
         6217  +           || cmd.eCmd==AR_CMD_UPDATE ){
  6190   6218           flags = SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE;
  6191   6219         }else{
  6192   6220           flags = SQLITE_OPEN_READONLY;
  6193   6221         }
  6194   6222         cmd.db = 0;
  6195   6223         if( cmd.bDryRun ){
  6196   6224           utf8_printf(pState->out, "-- open database '%s'%s\n", cmd.zFile,
................................................................................
  6219   6247           goto end_ar_command;
  6220   6248         }
  6221   6249         cmd.zSrcTable = sqlite3_mprintf("sqlar");
  6222   6250       }
  6223   6251   
  6224   6252       switch( cmd.eCmd ){
  6225   6253         case AR_CMD_CREATE:
  6226         -        rc = arCreateOrUpdateCommand(&cmd, 0);
         6254  +        rc = arCreateOrUpdateCommand(&cmd, 0, 0);
  6227   6255           break;
  6228   6256   
  6229   6257         case AR_CMD_EXTRACT:
  6230   6258           rc = arExtractCommand(&cmd);
  6231   6259           break;
  6232   6260   
  6233   6261         case AR_CMD_LIST:
................................................................................
  6234   6262           rc = arListCommand(&cmd);
  6235   6263           break;
  6236   6264   
  6237   6265         case AR_CMD_HELP:
  6238   6266           arUsage(pState->out);
  6239   6267           break;
  6240   6268   
         6269  +      case AR_CMD_INSERT:
         6270  +        rc = arCreateOrUpdateCommand(&cmd, 1, 0);
         6271  +        break;
         6272  +
  6241   6273         default:
  6242   6274           assert( cmd.eCmd==AR_CMD_UPDATE );
  6243         -        rc = arCreateOrUpdateCommand(&cmd, 1);
         6275  +        rc = arCreateOrUpdateCommand(&cmd, 1, 1);
  6244   6276           break;
  6245   6277       }
  6246   6278     }
  6247   6279   end_ar_command:
  6248   6280     if( cmd.db!=pState->db ){
  6249   6281       close_db(cmd.db);
  6250   6282     }
................................................................................
  7372   7404       open_db(p,0);
  7373   7405       if( nArg<=1 ) goto parameter_syntax_error;
  7374   7406   
  7375   7407       /* .parameter clear
  7376   7408       ** Clear all bind parameters by dropping the TEMP table that holds them.
  7377   7409       */
  7378   7410       if( nArg==2 && strcmp(azArg[1],"clear")==0 ){
  7379         -      sqlite3_exec(p->db, "DROP TABLE IF EXISTS temp.[" BIND_PARAM_TABLE "];",
         7411  +      int wrSchema = 0;
         7412  +      sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema);
         7413  +      sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0);
         7414  +      sqlite3_exec(p->db, "DROP TABLE IF EXISTS temp.sqlite_parameters;",
  7380   7415                      0, 0, 0);
         7416  +      sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0);
  7381   7417       }else
  7382   7418   
  7383   7419       /* .parameter list
  7384   7420       ** List all bind parameters.
  7385   7421       */
  7386   7422       if( nArg==2 && strcmp(azArg[1],"list")==0 ){
  7387   7423         sqlite3_stmt *pStmt = 0;
  7388   7424         int rx;
  7389   7425         int len = 0;
  7390   7426         rx = sqlite3_prepare_v2(p->db,
  7391   7427                "SELECT max(length(key)) "
  7392         -             "FROM temp.[" BIND_PARAM_TABLE "];", -1, &pStmt, 0);
         7428  +             "FROM temp.sqlite_parameters;", -1, &pStmt, 0);
  7393   7429         if( rx==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){
  7394   7430           len = sqlite3_column_int(pStmt, 0);
  7395   7431           if( len>40 ) len = 40;
  7396   7432         }
  7397   7433         sqlite3_finalize(pStmt);
  7398   7434         pStmt = 0;
  7399   7435         if( len ){
  7400   7436           rx = sqlite3_prepare_v2(p->db,
  7401   7437                "SELECT key, quote(value) "
  7402         -             "FROM temp.[" BIND_PARAM_TABLE "];", -1, &pStmt, 0);
         7438  +             "FROM temp.sqlite_parameters;", -1, &pStmt, 0);
  7403   7439           while( sqlite3_step(pStmt)==SQLITE_ROW ){
  7404   7440             utf8_printf(p->out, "%-*s %s\n", len, sqlite3_column_text(pStmt,0),
  7405   7441                         sqlite3_column_text(pStmt,1));
  7406   7442           }
  7407   7443           sqlite3_finalize(pStmt);
  7408   7444         }
  7409   7445       }else
................................................................................
  7426   7462         int rx;
  7427   7463         char *zSql;
  7428   7464         sqlite3_stmt *pStmt;
  7429   7465         const char *zKey = azArg[2];
  7430   7466         const char *zValue = azArg[3];
  7431   7467         bind_table_init(p);
  7432   7468         zSql = sqlite3_mprintf(
  7433         -                  "REPLACE INTO temp.[" BIND_PARAM_TABLE "](key,value)"
         7469  +                  "REPLACE INTO temp.sqlite_parameters(key,value)"
  7434   7470                     "VALUES(%Q,%s);", zKey, zValue);
  7435   7471         if( zSql==0 ) shell_out_of_memory();
  7436   7472         pStmt = 0;
  7437   7473         rx = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
  7438   7474         sqlite3_free(zSql);
  7439   7475         if( rx!=SQLITE_OK ){
  7440   7476           sqlite3_finalize(pStmt);
  7441   7477           pStmt = 0;
  7442   7478           zSql = sqlite3_mprintf(
  7443         -                   "REPLACE INTO temp.[" BIND_PARAM_TABLE "](key,value)"
         7479  +                   "REPLACE INTO temp.sqlite_parameters(key,value)"
  7444   7480                      "VALUES(%Q,%Q);", zKey, zValue);
  7445   7481           if( zSql==0 ) shell_out_of_memory();
  7446   7482           rx = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
  7447   7483           sqlite3_free(zSql);
  7448   7484           if( rx!=SQLITE_OK ){
  7449   7485             utf8_printf(p->out, "Error: %s\n", sqlite3_errmsg(p->db));
  7450   7486             sqlite3_finalize(pStmt);
................................................................................
  7458   7494   
  7459   7495       /* .parameter unset NAME
  7460   7496       ** Remove the NAME binding from the parameter binding table, if it
  7461   7497       ** exists.
  7462   7498       */
  7463   7499       if( nArg==3 && strcmp(azArg[1],"unset")==0 ){
  7464   7500         char *zSql = sqlite3_mprintf(
  7465         -          "DELETE FROM temp.[" BIND_PARAM_TABLE "] WHERE key=%Q", azArg[2]);
         7501  +          "DELETE FROM temp.sqlite_parameters WHERE key=%Q", azArg[2]);
  7466   7502         if( zSql==0 ) shell_out_of_memory();
  7467   7503         sqlite3_exec(p->db, zSql, 0, 0, 0);
  7468   7504         sqlite3_free(zSql);
  7469   7505       }else
  7470   7506       /* If no command name matches, show a syntax error */
  7471   7507       parameter_syntax_error:
  7472   7508       showHelp(p->out, "parameter");

Changes to src/sqlite.h.in.

  2197   2197   ** features include but are not limited to the following:
  2198   2198   ** <ul>
  2199   2199   ** <li> The [PRAGMA writable_schema=ON] statement.
  2200   2200   ** <li> Writes to the [sqlite_dbpage] virtual table.
  2201   2201   ** <li> Direct writes to [shadow tables].
  2202   2202   ** </ul>
  2203   2203   ** </dd>
         2204  +**
         2205  +** [[SQLITE_DBCONFIG_WRITABLE_SCHEMA]] <dt>SQLITE_DBCONFIG_WRITABLE_SCHEMA</dt>
         2206  +** <dd>The SQLITE_DBCONFIG_WRITABLE_SCHEMA option activates or deactivates the
         2207  +** "writable_schema" flag. This has the same effect and is logically equivalent
         2208  +** to setting [PRAGMA writable_schema=ON] or [PRAGMA writable_schema=OFF].
         2209  +** The first argument to this setting is an integer which is 0 to disable 
         2210  +** the writable_schema, positive to enable writable_schema, or negative to
         2211  +** leave the setting unchanged. The second parameter is a pointer to an
         2212  +** integer into which is written 0 or 1 to indicate whether the writable_schema
         2213  +** is enabled or disabled following this call.
         2214  +** </dd>
  2204   2215   ** </dl>
  2205   2216   */
  2206   2217   #define SQLITE_DBCONFIG_MAINDBNAME            1000 /* const char* */
  2207   2218   #define SQLITE_DBCONFIG_LOOKASIDE             1001 /* void* int int */
  2208   2219   #define SQLITE_DBCONFIG_ENABLE_FKEY           1002 /* int int* */
  2209   2220   #define SQLITE_DBCONFIG_ENABLE_TRIGGER        1003 /* int int* */
  2210   2221   #define SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER 1004 /* int int* */
  2211   2222   #define SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION 1005 /* int int* */
  2212   2223   #define SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE      1006 /* int int* */
  2213   2224   #define SQLITE_DBCONFIG_ENABLE_QPSG           1007 /* int int* */
  2214   2225   #define SQLITE_DBCONFIG_TRIGGER_EQP           1008 /* int int* */
  2215   2226   #define SQLITE_DBCONFIG_RESET_DATABASE        1009 /* int int* */
  2216   2227   #define SQLITE_DBCONFIG_DEFENSIVE             1010 /* int int* */
  2217         -#define SQLITE_DBCONFIG_MAX                   1010 /* Largest DBCONFIG */
         2228  +#define SQLITE_DBCONFIG_WRITABLE_SCHEMA       1011 /* int int* */
         2229  +#define SQLITE_DBCONFIG_MAX                   1011 /* Largest DBCONFIG */
  2218   2230   
  2219   2231   /*
  2220   2232   ** CAPI3REF: Enable Or Disable Extended Result Codes
  2221   2233   ** METHOD: sqlite3
  2222   2234   **
  2223   2235   ** ^The sqlite3_extended_result_codes() routine enables or disables the
  2224   2236   ** [extended result codes] feature of SQLite. ^The extended result

Changes to src/test_fs.c.

   233    233   ** Skip the cursor to the next entry.
   234    234   */
   235    235   static int fsdirNext(sqlite3_vtab_cursor *cur){
   236    236     FsdirCsr *pCsr = (FsdirCsr*)cur;
   237    237   
   238    238     if( pCsr->pDir ){
   239    239       struct DIRENT *pRes = 0;
   240         -#if defined(__MINGW_H)
   241    240       pRes = readdir(pCsr->pDir);
   242    241       if( pRes!=0 ){
   243    242         memcpy(&pCsr->entry, pRes, sizeof(struct DIRENT));
   244    243       }
   245         -#else
   246         -    readdir_r(pCsr->pDir, &pCsr->entry, &pRes);
   247         -#endif
   248    244       if( pRes==0 ){
   249    245         closedir(pCsr->pDir);
   250    246         pCsr->pDir = 0;
   251    247       }
   252    248       pCsr->iRowid++;
   253    249     }
   254    250   

Changes to test/corruptL.test.

   722    722   |      0: 0d 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00   ................
   723    723   | end crash-8391315d75edff.db
   724    724   }]} {}
   725    725   
   726    726   do_catchsql_test 7.1 {
   727    727     SELECT * FROM sqlite_master;
   728    728   } {1 {malformed database schema (t1x1) - invalid rootpage}}
          729  +
          730  +#-------------------------------------------------------------------------
          731  +reset_db
          732  +do_test 8.0 {
          733  +  sqlite3 db {}
          734  +  db deserialize [decode_hexdb {
          735  +| size 2048 pagesize 512 filename a.db
          736  +| page 1 offset 0
          737  +|      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
          738  +|     16: 02 00 01 01 00 40 20 20 ff ff 00 0c 00 00 00 07   .....@  ........
          739  +|     32: 0b 00 00 00 00 00 00 00 00 00 00 08 9c 00 00 04   ................
          740  +|     48: 00 00 00 e0 09 00 00 01 00 00 00 01 00 00 00 00   ................
          741  +|     64: 00 00 00 00 f2 ff 00 00 00 00 00 00 00 00 00 00   ................
          742  +|     80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0c   ................
          743  +|     96: 00 2e 2c 50 0d 00 00 00 06 01 06 00 01 da 01 b0   ..,P............
          744  +|    112: 05 56 01 86 01 2a 01 06 00 00 00 00 00 06 00 00   .V...*..........
          745  +|    128: 00 ff 00 00 ff ff ff e1 00 00 00 00 00 00 00 00   ................
          746  +|    144: 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00   ................
          747  +|    160: 00 00 00 00 00 00 00 00 f2 00 00 00 00 00 00 00   ................
          748  +|    176: 00 00 f9 ff ff ff ff ff ff ff 00 00 00 5f 00 fb   ............._..
          749  +|    192: 00 00 00 00 00 00 00 00 00 e1 ff 00 00 00 00 00   ................
          750  +|    208: 00 00 10 00 00 00 00 00 1e 00 00 00 fe 00 00 00   ................
          751  +|    224: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ca 00   ................
          752  +|    240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 35   ...............5
          753  +|    256: 00 00 00 00 ef ff 22 07 06 17 11 11 01 30 39 38   .............098
          754  +|    272: 62 6c 65 74 38 38 74 04 43 52 45 41 54 45 20 54   blet88t.CREATE T
          755  +|    288: 41 42 4c 45 20 74 34 28 87 29 2a 06 06 17 13 11   ABLE t4(.)*.....
          756  +|    304: 01 3f 69 4f 64 65 78 74 33 78 74 40 05 43 52 45   .?iOdext3xt@.CRE
          757  +|    320: 41 54 45 20 49 6e 44 45 58 20 74 33 78 20 4f 4e   ATE InDEX t3x ON
          758  +|    336: 20 74 33 28 78 29 2e 04 06 17 15 11 01 45 69 6e    t3(x).......Ein
          759  +|    352: 00 04 00 00 34 63 64 74 3d 05 43 52 45 41 54 45   ....4cdt=.CREATE
          760  +|    368: 20 49 4e 44 45 58 20 63 74 64 32 20 4f 4e 20 74    INDEX ctd2 ON t
          761  +|    384: 32 28 0a 0c 44 29 28 05 06 17 11 11 01 3d 74 6c   2(..D)(......=tl
          762  +|    400: 62 61 d4 65 33 74 33 04 43 52 45 41 54 45 20 54   ba.e3t3.CREATE T
          763  +|    416: 41 42 4c 45 20 74 33 28 63 2c 78 2c 65 2c 66 29   ABLE t3(c,x,e,f)
          764  +|    432: 28 02 06 17 11 11 01 3d 74 61 62 6c 65 74 32 74   (......=tablet2t
          765  +|    448: 32 03 43 52 45 41 54 45 20 54 41 42 4c 45 20 74   2.CREATE TABLE t
          766  +|    464: 32 28 63 2c 64 2c 65 2c 66 29 24 01 06 17 11 11   2(c,d,e,f)$.....
          767  +|    480: 01 35 74 60 62 6c 65 74 31 74 31 02 43 52 45 41   .5t`blet1t1.CREA
          768  +|    496: 54 45 20 54 41 42 4c 45 20 74 30 28 61 2c 62 29   TE TABLE t0(a,b)
          769  +| page 2 offset 512
          770  +|      0: 0d 00 ff 11 04 01 cf 80 01 fa 01 09 00 de 01 cf   ................
          771  +|     16: 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00   ................
          772  +|     32: 00 00 08 00 00 00 00 00 00 11 00 00 00 00 00 13   ................
          773  +|     48: 00 00 00 00 00 00 00 00 00 00 00 01 00 e0 ff ff   ................
          774  +|     64: ff d2 ff ff ff 00 f8 ff ff ff 00 00 00 00 00 00   ................
          775  +|     80: 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
          776  +|     96: 00 00 00 00 ff de 00 00 00 00 00 00 00 00 00 00   ................
          777  +|    112: 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00   .............@..
          778  +|    128: 2a 00 00 00 00 00 00 00 00 f7 00 00 00 00 00 00   *...............
          779  +|    144: 00 00 00 00 00 21 00 00 00 00 00 00 00 00 00 00   .....!..........
          780  +|    160: 01 64 00 00 00 00 04 80 ff ff ff 00 00 00 00 00   .d..............
          781  +|    176: 00 00 00 00 00 00 00 00 1f 00 00 00 00 00 00 00   ................
          782  +|    192: 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00   ..@.............
          783  +|    208: b5 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00   .......@........
          784  +|    224: 00 00 00 f6 00 ee ff ff ff 00 00 00 00 00 00 00   ................
          785  +|    272: f2 00 00 00 00 00 00 00 00 00 f9 ff ff ff ff ff   ................
          786  +|    288: ff ff 00 00 00 5f 00 fb 00 00 00 00 00 00 00 00   ....._..........
          787  +|    320: 1e 00 00 00 fe 00 00 00 00 00 00 00 00 00 00 00   ................
          788  +|    336: 00 00 00 00 00 00 ca 00 00 00 00 00 00 00 ff ec   ................
          789  +|    352: 00 00 00 00 00 00 00 32 00 00 00 00 ef ff 22 07   .......2........
          790  +|    368: 06 17 11 11 01 30 74 61 62 6c 65 74 38 38 74 04   .....0tablet88t.
          791  +|    384: 43 52 45 41 54 45 20 54 41 42 4c 45 20 8c cb d7   CREATE TABLE ...
          792  +|    400: 78 d6 d5 f9 f9 17 13 11 01 3f 69 4f 64 65 78 74   x........?iOdext
          793  +|    416: 33 78 74 33 05 43 52 45 41 54 45 26 49 6e 44 45   3xt3.CREATE&InDE
          794  +|    432: 58 20 74 33 78 00 00 00 00 00 00 00 00 00 00 00   X t3x...........
          795  +|    464: 00 00 00 00 00 13 76 65 6e 65 69 67 68 74 13 03   ......veneight..
          796  +|    480: 03 40 07 07 15 00 54 45 20 49 4e 44 45 58 20 74   .@....TE INDEX t
          797  +|    496: 31 63 64 20 4f 4e 20 74 ce d7 f5 f0 44 09 01 02   1cd ON t....D...
          798  +| page 3 offset 1024
          799  +|      0: 0d 00 00 00 48 01 54 00 01 f6 e2 ec 01 c5 01 aa   ....H.T.........
          800  +|     16: 30 34 28 87 29 32 06 f5 16 13 11 01 8e 61 24 64   04(.)2.......a$d
          801  +|     32: 65 78 74 37 78 1f 33 6d 6d 6d 6d 6d 00 00 04 06   ext7x.3mmmmm....
          802  +|     48: 6d 41 6d 6d 6e 6d 6d 00 00 02 00 6d 6d 6d 6d 6d   mAmmnmm....mmmmm
          803  +|     64: 15 11 01 45 45 45 45 45 45 45 45 45 45 45 45 45   ...EEEEEEEEEEEEE
          804  +|     80: 45 45 45 45 45 45 45 45 45 45 45 00 45 63 74 64   EEEEEEEEEEE.Ectd
          805  +|     96: 34 20 4f 4e 20 61 62 6c 5d 74 38 38 74 04 43 52   4 ON abl]t88t.CR
          806  +|    112: 45 41 54 45 20 54 41 42 4c 45 20 74 34 28 87 29   EATE TABLE t4(.)
          807  +|    128: 2a 06 06 13 13 01 00 00 00 4f 64 6e 78 74 33 44   *........Odnxt3D
          808  +|    144: 74 13 05 43 52 45 41 54 45 20 49 6e 44 45 00 00   t..CREATE InDE..
          809  +|    160: 00 00 00 00 00 00 00 f9 ff ff ff ff ff ff ff 00   ................
          810  +|    176: 00 00 5f 00 fb 00 00 2d 00 00 00 00 00 00 00 00   .._....-........
          811  +|    192: 00 00 00 00 00 00 00 00 00 00 00 00 00 1e 00 00   ................
          812  +|    208: 00 fe 00 00 00 00 17 15 11 01 45 69 6e 64 65 2e   ..........Einde.
          813  +|    224: 5b 38 63 64 74 3d 05 43 52 45 41 54 45 20 49 4e   [8cdt=.CREATE IN
          814  +|    240: 44 45 58 20 63 20 64 32 20 4f 4e 20 74 32 28 0a   DEX c d2 ON t2(.
          815  +|    256: 0c 44 32 05 00 10 00 00 11 11 3d 74 6c 62 61 d4   .D2.......=tlba.
          816  +|    272: 65 33 74 33 04 43 52 45 41 54 45 20 54 41 42 4c   e3t3.CREATE TABL
          817  +|    288: 45 20 74 36 ff ff 7f ff 43 52 45 41 54 45 20 49   E t6....CREATE I
          818  +|    304: 73 71 6c 69 74 65 5f 73 65 71 75 65 6e 63 65 28   sqlite_sequence(
          819  +|    320: 0a 0c 44 29 28 05 06 17 11 11 01 3d 74 6c 62 61   ..D)(......=tlba
          820  +|    336: 20 00 00 00 33 04 43 52 45 41 54 45 20 54 41 42    ...3.CREATE TAB
          821  +|    352: 4c 45 20 74 33 28 63 2c 78 2c 65 2c 66 29 28 02   LE t3(c,x,e,f)(.
          822  +|    368: 06 00 00 7f ff 40 41 54 45 20 49 6e 44 45 58 20   .....@ATE InDEX 
          823  +|    384: 74 33 78 20 4f 4e 20 74 31 28 78 29 2e 04 06 17   t3x ON t1(x)....
          824  +|    400: 15 11 01 45 69 6e 64 65 2e 74 34 63 64 74 3d 05   ...Einde.t4cdt=.
          825  +|    416: 00 00 00 00 00 00 00 00 00 00 00 4d 00 00 00 00   ...........M....
          826  +|    432: 01 00 00 00 00 00 00 05 00 00 10 00 00 00 00 00   ................
          827  +|    448: 00 01 00 00 00 00 01 00 00 00 00 07 40 14 00 00   ............@...
          828  +|    464: 00 00 21 00 40 18 00 00 00 00 00 00 40 1c 00 00   ..!.@.......@...
          829  +|    480: 00 00 ff ff ff 00 00 00 5f 00 fb 00 00 2d 00 00   ........_....-..
          830  +|    496: 00 00 00 1e 00 00 00 fe 00 00 64 00 00 ff fb 02   ..........d.....
          831  +| page 4 offset 1536
          832  +|      0: 0d 00 39 00 00 02 00 00 00 00 00 00 00 00 00 00   ..9.............
          833  +| end a.db
          834  +}]} {}
          835  +
          836  +
          837  +do_catchsql_test 8.1 {
          838  +  INSERT INTO t3 SELECT * FROM t2;
          839  +} {1 {database disk image is malformed}}
   729    840   
   730    841   finish_test

Changes to test/dbfuzz2.c.

    70     70   
    71     71   /* True to activate PRAGMA vdbe_debug=on */
    72     72   static int bVdbeDebug = 0;
    73     73   
    74     74   /* Maximum size of the in-memory database file */
    75     75   static sqlite3_int64 szMax = 104857600;
    76     76   
           77  +/* Progress handler callback data */
           78  +static int nCb = 0;                  /* Number of callbacks seen so far */
           79  +static int mxCb = 250000;            /* Maximum allowed callbacks */
           80  +
    77     81   /***** Copy/paste from ext/misc/memtrace.c ***************************/
    78     82   /* The original memory allocation routines */
    79     83   static sqlite3_mem_methods memtraceBase;
    80     84   static FILE *memtraceOut;
    81     85   
    82     86   /* Methods that trace memory allocations */
    83     87   static void *memtraceMalloc(int n){
................................................................................
   152    156         memset(&memtraceBase, 0, sizeof(memtraceBase));
   153    157       }
   154    158     }
   155    159     memtraceOut = 0;
   156    160     return rc;
   157    161   }
   158    162   /***** End copy/paste from ext/misc/memtrace.c ***************************/
          163  +
          164  +/*
          165  +** Progress handler callback
          166  +**
          167  +** Count the number of callbacks and cause an abort once the limit is
          168  +** reached.
          169  +*/
          170  +static int progress_handler(void *pNotUsed){
          171  +  nCb++;
          172  +  if( nCb<mxCb ) return 0;
          173  +  if( eVerbosity>=1 ){
          174  +    printf("-- Progress limit of %d reached\n", mxCb);
          175  +  }
          176  +  return 1;
          177  +}
   159    178   
   160    179   /* libFuzzer invokes this routine with fuzzed database files (in aData).
   161    180   ** This routine run SQLite against the malformed database to see if it
   162    181   ** can provoke a failure or malfunction.
   163    182   */
   164    183   int LLVMFuzzerTestOneInput(const uint8_t *aData, size_t nByte){
   165    184     unsigned char *a;
................................................................................
   185    204     x = szMax;
   186    205   #ifdef SQLITE_FCNTL_SIZE_LIMIT
   187    206     sqlite3_file_control(db, "main", SQLITE_FCNTL_SIZE_LIMIT, &x);
   188    207   #endif
   189    208     if( bVdbeDebug ){
   190    209       sqlite3_exec(db, "PRAGMA vdbe_debug=ON", 0, 0, 0);
   191    210     }
          211  +  if( mxCb>0 ){
          212  +    sqlite3_progress_handler(db, 10, progress_handler, 0);
          213  +  }
   192    214     for(i=0; i<sizeof(azSql)/sizeof(azSql[0]); i++){
   193    215       if( eVerbosity>=1 ){
   194    216         printf("%s\n", azSql[i]);
   195    217         fflush(stdout);
   196    218       }
   197    219       zErr = 0;
          220  +    nCb = 0;
   198    221       rc = sqlite3_exec(db, azSql[i], 0, 0, &zErr);
   199    222       if( rc && eVerbosity>=1 ){
   200    223         printf("-- rc=%d zErr=%s\n", rc, zErr);
   201    224       }
   202    225       sqlite3_free(zErr);
   203    226     }
   204    227     rc = sqlite3_close(db);
................................................................................
   244    267         if( z[0]=='v' && (n = numberOfVChar(z))>0 ){
   245    268           eVerbosity += n;
   246    269           continue;
   247    270         }
   248    271         if( strcmp(z,"vdbe-debug")==0 ){
   249    272           bVdbeDebug = 1;
   250    273           continue;
          274  +      }
          275  +      if( strcmp(z,"limit")==0 ){
          276  +        if( i+1==argc ){
          277  +          fprintf(stderr, "missing argument to %s\n", argv[i]);
          278  +          exit(1);
          279  +        }
          280  +        mxCb = strtol(argv[++i], 0, 0);
          281  +        continue;
   251    282         }
   252    283         if( strcmp(z,"memtrace")==0 ){
   253    284           sqlite3MemTraceActivate(stdout);
   254    285           continue;
   255    286         }
   256    287         if( strcmp(z,"mem")==0 ){
   257    288           bVdbeDebug = 1;

Changes to test/fuzzdata7.db.

cannot compute difference between binary files