/ Changes On Branch branch-3.7.0
Login

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

Changes In Branch branch-3.7.0 Excluding Merge-Ins

This is equivalent to a diff from b36b105eab to 042a1abb03

2010-08-07
11:46
Merge in all changes up to the 3.7.0.1 release. check-in: f88c6367d2 user: drh tags: apple-osx
2010-08-04
12:31
Version 3.7.0.1 Leaf check-in: 042a1abb03 user: drh tags: release, branch-3.7.0
12:19
Update the version number to 3.7.0.1. check-in: 5074b85967 user: drh tags: branch-3.7.0
11:59
Backport the [65b8636ac6e5] fix for ticket [51ae9cad317a1] to version 3.7.0. check-in: dec70c63d0 user: drh tags: branch-3.7.0
2010-07-22
11:40
Tweaks to the virtual table documentation contained in comments of sqlite3.h. No changes to actual code. check-in: f5866d4723 user: drh tags: trunk
2010-07-21
16:16
Version 3.7.0 check-in: b36b105eab user: drh tags: trunk, release
2010-07-20
20:23
Added fix to os_win.c for race conditions from os_unix.c; added saving of errno in two places. check-in: 13ed106c8c user: shaneh tags: trunk

Changes to VERSION.

     1         -3.7.0
            1  +3.7.0.1

Changes to configure.

     1      1   #! /bin/sh
     2      2   # Guess values for system-dependent variables and create Makefiles.
     3         -# Generated by GNU Autoconf 2.62 for sqlite 3.7.0.
            3  +# Generated by GNU Autoconf 2.62 for sqlite 3.7.0.1.
     4      4   #
     5      5   # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
     6      6   # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
     7      7   # This configure script is free software; the Free Software Foundation
     8      8   # gives unlimited permission to copy, distribute and modify it.
     9      9   ## --------------------- ##
    10     10   ## M4sh Initialization.  ##
................................................................................
   739    739   MFLAGS=
   740    740   MAKEFLAGS=
   741    741   SHELL=${CONFIG_SHELL-/bin/sh}
   742    742   
   743    743   # Identity of this package.
   744    744   PACKAGE_NAME='sqlite'
   745    745   PACKAGE_TARNAME='sqlite'
   746         -PACKAGE_VERSION='3.7.0'
   747         -PACKAGE_STRING='sqlite 3.7.0'
          746  +PACKAGE_VERSION='3.7.0.1'
          747  +PACKAGE_STRING='sqlite 3.7.0.1'
   748    748   PACKAGE_BUGREPORT=''
   749    749   
   750    750   # Factoring default headers for most tests.
   751    751   ac_includes_default="\
   752    752   #include <stdio.h>
   753    753   #ifdef HAVE_SYS_TYPES_H
   754    754   # include <sys/types.h>
................................................................................
  1483   1483   #
  1484   1484   # Report the --help message.
  1485   1485   #
  1486   1486   if test "$ac_init_help" = "long"; then
  1487   1487     # Omit some internal or obsolete options to make the list less imposing.
  1488   1488     # This message is too long to be a string in the A/UX 3.1 sh.
  1489   1489     cat <<_ACEOF
  1490         -\`configure' configures sqlite 3.7.0 to adapt to many kinds of systems.
         1490  +\`configure' configures sqlite 3.7.0.1 to adapt to many kinds of systems.
  1491   1491   
  1492   1492   Usage: $0 [OPTION]... [VAR=VALUE]...
  1493   1493   
  1494   1494   To assign environment variables (e.g., CC, CFLAGS...), specify them as
  1495   1495   VAR=VALUE.  See below for descriptions of some of the useful variables.
  1496   1496   
  1497   1497   Defaults for the options are specified in brackets.
................................................................................
  1548   1548     --build=BUILD     configure for building on BUILD [guessed]
  1549   1549     --host=HOST       cross-compile to build programs to run on HOST [BUILD]
  1550   1550   _ACEOF
  1551   1551   fi
  1552   1552   
  1553   1553   if test -n "$ac_init_help"; then
  1554   1554     case $ac_init_help in
  1555         -     short | recursive ) echo "Configuration of sqlite 3.7.0:";;
         1555  +     short | recursive ) echo "Configuration of sqlite 3.7.0.1:";;
  1556   1556      esac
  1557   1557     cat <<\_ACEOF
  1558   1558   
  1559   1559   Optional Features:
  1560   1560     --disable-option-checking  ignore unrecognized --enable/--with options
  1561   1561     --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  1562   1562     --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
................................................................................
  1666   1666       cd "$ac_pwd" || { ac_status=$?; break; }
  1667   1667     done
  1668   1668   fi
  1669   1669   
  1670   1670   test -n "$ac_init_help" && exit $ac_status
  1671   1671   if $ac_init_version; then
  1672   1672     cat <<\_ACEOF
  1673         -sqlite configure 3.7.0
         1673  +sqlite configure 3.7.0.1
  1674   1674   generated by GNU Autoconf 2.62
  1675   1675   
  1676   1676   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
  1677   1677   2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
  1678   1678   This configure script is free software; the Free Software Foundation
  1679   1679   gives unlimited permission to copy, distribute and modify it.
  1680   1680   _ACEOF
  1681   1681     exit
  1682   1682   fi
  1683   1683   cat >config.log <<_ACEOF
  1684   1684   This file contains any messages produced by compilers while
  1685   1685   running configure, to aid debugging if configure makes a mistake.
  1686   1686   
  1687         -It was created by sqlite $as_me 3.7.0, which was
         1687  +It was created by sqlite $as_me 3.7.0.1, which was
  1688   1688   generated by GNU Autoconf 2.62.  Invocation command line was
  1689   1689   
  1690   1690     $ $0 $@
  1691   1691   
  1692   1692   _ACEOF
  1693   1693   exec 5>>config.log
  1694   1694   {
................................................................................
 13968  13968   
 13969  13969   exec 6>&1
 13970  13970   
 13971  13971   # Save the log message, to keep $[0] and so on meaningful, and to
 13972  13972   # report actual input values of CONFIG_FILES etc. instead of their
 13973  13973   # values after options handling.
 13974  13974   ac_log="
 13975         -This file was extended by sqlite $as_me 3.7.0, which was
        13975  +This file was extended by sqlite $as_me 3.7.0.1, which was
 13976  13976   generated by GNU Autoconf 2.62.  Invocation command line was
 13977  13977   
 13978  13978     CONFIG_FILES    = $CONFIG_FILES
 13979  13979     CONFIG_HEADERS  = $CONFIG_HEADERS
 13980  13980     CONFIG_LINKS    = $CONFIG_LINKS
 13981  13981     CONFIG_COMMANDS = $CONFIG_COMMANDS
 13982  13982     $ $0 $@
................................................................................
 14021  14021   $config_commands
 14022  14022   
 14023  14023   Report bugs to <bug-autoconf@gnu.org>."
 14024  14024   
 14025  14025   _ACEOF
 14026  14026   cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 14027  14027   ac_cs_version="\\
 14028         -sqlite config.status 3.7.0
        14028  +sqlite config.status 3.7.0.1
 14029  14029   configured by $0, generated by GNU Autoconf 2.62,
 14030  14030     with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 14031  14031   
 14032  14032   Copyright (C) 2008 Free Software Foundation, Inc.
 14033  14033   This config.status script is free software; the Free Software Foundation
 14034  14034   gives unlimited permission to copy, distribute and modify it."
 14035  14035   
................................................................................
 14454  14454   
 14455  14455   # Set up the scripts for CONFIG_FILES section.
 14456  14456   # No need to generate them if there are no CONFIG_FILES.
 14457  14457   # This happens for instance with `./config.status config.h'.
 14458  14458   if test -n "$CONFIG_FILES"; then
 14459  14459   
 14460  14460   
 14461         -ac_cr='
 14462         -'
        14461  +ac_cr='
'
 14463  14462   ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
 14464  14463   if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
 14465  14464     ac_cs_awk_cr='\\r'
 14466  14465   else
 14467  14466     ac_cs_awk_cr=$ac_cr
 14468  14467   fi
 14469  14468   

Changes to src/btree.c.

  2565   2565         }
  2566   2566   #endif
  2567   2567       }
  2568   2568       p->inTrans = (wrflag?TRANS_WRITE:TRANS_READ);
  2569   2569       if( p->inTrans>pBt->inTransaction ){
  2570   2570         pBt->inTransaction = p->inTrans;
  2571   2571       }
  2572         -#ifndef SQLITE_OMIT_SHARED_CACHE
  2573   2572       if( wrflag ){
         2573  +      MemPage *pPage1 = pBt->pPage1;
         2574  +#ifndef SQLITE_OMIT_SHARED_CACHE
  2574   2575         assert( !pBt->pWriter );
  2575   2576         pBt->pWriter = p;
  2576   2577         pBt->isExclusive = (u8)(wrflag>1);
         2578  +#endif
         2579  +
         2580  +      /* If the db-size header field is incorrect (as it may be if an old
         2581  +      ** client has been writing the database file), update it now. Doing
         2582  +      ** this sooner rather than later means the database size can safely 
         2583  +      ** re-read the database size from page 1 if a savepoint or transaction
         2584  +      ** rollback occurs within the transaction.
         2585  +      */
         2586  +      if( pBt->nPage!=get4byte(&pPage1->aData[28]) ){
         2587  +        rc = sqlite3PagerWrite(pPage1->pDbPage);
         2588  +        if( rc==SQLITE_OK ){
         2589  +          put4byte(&pPage1->aData[28], pBt->nPage);
         2590  +        }
         2591  +      }
  2577   2592       }
  2578         -#endif
  2579   2593     }
  2580   2594   
  2581   2595   
  2582   2596   trans_begun:
  2583   2597     if( rc==SQLITE_OK && wrflag ){
  2584   2598       /* This call makes sure that the pager has the correct number of
  2585   2599       ** open savepoints. If the second parameter is greater than 0 and

Changes to src/expr.c.

  1501   1501       }
  1502   1502     }
  1503   1503   
  1504   1504     if( eType==0 ){
  1505   1505       /* Could not found an existing table or index to use as the RHS b-tree.
  1506   1506       ** We will have to generate an ephemeral table to do the job.
  1507   1507       */
         1508  +    double savedNQueryLoop = pParse->nQueryLoop;
  1508   1509       int rMayHaveNull = 0;
  1509   1510       eType = IN_INDEX_EPH;
  1510   1511       if( prNotFound ){
  1511   1512         *prNotFound = rMayHaveNull = ++pParse->nMem;
  1512         -    }else if( pX->pLeft->iColumn<0 && !ExprHasAnyProperty(pX, EP_xIsSelect) ){
  1513         -      eType = IN_INDEX_ROWID;
         1513  +    }else{
         1514  +      testcase( pParse->nQueryLoop>(double)1 );
         1515  +      pParse->nQueryLoop = (double)1;
         1516  +      if( pX->pLeft->iColumn<0 && !ExprHasAnyProperty(pX, EP_xIsSelect) ){
         1517  +        eType = IN_INDEX_ROWID;
         1518  +      }
  1514   1519       }
  1515   1520       sqlite3CodeSubselect(pParse, pX, rMayHaveNull, eType==IN_INDEX_ROWID);
         1521  +    pParse->nQueryLoop = savedNQueryLoop;
  1516   1522     }else{
  1517   1523       pX->iTable = iTab;
  1518   1524     }
  1519   1525     return eType;
  1520   1526   }
  1521   1527   #endif
  1522   1528   

Changes to src/os_os2.c.

   775    775       }
   776    776       zName = zTmpname;
   777    777     }
   778    778   
   779    779   
   780    780     memset( pFile, 0, sizeof(*pFile) );
   781    781   
   782         -  OSTRACE( "OPEN want %d\n", flags ));
          782  +  OSTRACE(( "OPEN want %d\n", flags ));
   783    783   
   784    784     if( flags & SQLITE_OPEN_READWRITE ){
   785    785       ulOpenMode |= OPEN_ACCESS_READWRITE;
   786    786       OSTRACE(( "OPEN read/write\n" ));
   787    787     }else{
   788    788       ulOpenMode |= OPEN_ACCESS_READONLY;
   789    789       OSTRACE(( "OPEN read only\n" ));

Changes to test/autoindex1.test.

   131    131         JOIN t4 AS x6 ON x6.a=x5.b
   132    132         JOIN t4 AS x7 ON x7.a=x6.b
   133    133         JOIN t4 AS x8 ON x8.a=x7.b
   134    134         JOIN t4 AS x9 ON x9.a=x8.b
   135    135         JOIN t4 AS x10 ON x10.a=x9.b;
   136    136     }
   137    137   } {4087}
          138  +
          139  +# Ticket [8011086c85c6c404014c947fcf3eb9f42b184a0d] from 2010-07-08
          140  +# Make sure automatic indices are not created for the RHS of an IN expression
          141  +# that is not a correlated subquery.
          142  +#
          143  +do_test autoindex1-500 {
          144  +  db eval {
          145  +    CREATE TABLE t501(a INTEGER PRIMARY KEY, b);
          146  +    CREATE TABLE t502(x INTEGER PRIMARY KEY, y);
          147  +    EXPLAIN QUERY PLAN
          148  +    SELECT b FROM t501
          149  +     WHERE t501.a IN (SELECT x FROM t502 WHERE y=?);
          150  +  }
          151  +} {0 0 {TABLE t501 USING PRIMARY KEY} 0 0 {TABLE t502}}
          152  +do_test autoindex1-501 {
          153  +  db eval {
          154  +    EXPLAIN QUERY PLAN
          155  +    SELECT b FROM t501
          156  +     WHERE t501.a IN (SELECT x FROM t502 WHERE y=t501.b);
          157  +  }
          158  +} {0 0 {TABLE t501} 0 0 {TABLE t502 WITH AUTOMATIC INDEX}}
          159  +do_test autoindex1-502 {
          160  +  db eval {
          161  +    EXPLAIN QUERY PLAN
          162  +    SELECT b FROM t501
          163  +     WHERE t501.a=123
          164  +       AND t501.a IN (SELECT x FROM t502 WHERE y=t501.b);
          165  +  }
          166  +} {0 0 {TABLE t501 USING PRIMARY KEY} 0 0 {TABLE t502}}
          167  +    
   138    168   
   139    169   finish_test

Changes to test/filefmt.test.

   113    113       sqlite3 db test.db
   114    114       catchsql {
   115    115          SELECT count(*) FROM sqlite_master
   116    116       }
   117    117     } {1 {file is encrypted or is not a database}}
   118    118   }
   119    119   
          120  +#-------------------------------------------------------------------------
          121  +# The following block of tests - filefmt-2.* - test that versions 3.7.0
          122  +# and later can read and write databases that have been modified or created
          123  +# by 3.6.23.1 and earlier. The difference difference is that 3.7.0 stores
          124  +# the size of the database in the database file header, whereas 3.6.23.1
          125  +# always derives this from the size of the file.
          126  +#
          127  +db close
          128  +file delete -force test.db
          129  +
          130  +set a_string_counter 1
          131  +proc a_string {n} {
          132  +  incr ::a_string_counter
          133  +  string range [string repeat "${::a_string_counter}." $n] 1 $n
          134  +}
          135  +sqlite3 db test.db
          136  +db func a_string a_string
          137  +
          138  +do_execsql_test filefmt-2.1.1 {
          139  +  PRAGMA page_size = 1024;
          140  +  PRAGMA auto_vacuum = 0;
          141  +  CREATE TABLE t1(a);
          142  +  CREATE INDEX i1 ON t1(a);
          143  +  INSERT INTO t1 VALUES(a_string(3000));
          144  +  CREATE TABLE t2(a);
          145  +  INSERT INTO t2 VALUES(1);
          146  +} {}
          147  +do_test filefmt-2.1.2 {
          148  +  hexio_read test.db 28 4
          149  +} {00000009}
          150  +
          151  +do_test filefmt-2.1.3 {
          152  +  sql36231 { INSERT INTO t1 VALUES(a_string(3000)) }
          153  +} {}
          154  +
          155  +do_execsql_test filefmt-2.1.4 { INSERT INTO t2 VALUES(2) } {}
          156  +integrity_check filefmt-2.1.5
          157  +do_test         filefmt-2.1.6 { hexio_read test.db 28 4 } {00000010}
          158  +
          159  +db close
          160  +file delete -force test.db
          161  +sqlite3 db test.db
          162  +db func a_string a_string
          163  +
          164  +do_execsql_test filefmt-2.2.1 {
          165  +  PRAGMA page_size = 1024;
          166  +  PRAGMA auto_vacuum = 0;
          167  +  CREATE TABLE t1(a);
          168  +  CREATE INDEX i1 ON t1(a);
          169  +  INSERT INTO t1 VALUES(a_string(3000));
          170  +  CREATE TABLE t2(a);
          171  +  INSERT INTO t2 VALUES(1);
          172  +} {}
          173  +do_test filefmt-2.2.2 {
          174  +  hexio_read test.db 28 4
          175  +} {00000009}
          176  +
          177  +do_test filefmt-2.2.3 {
          178  +  sql36231 { INSERT INTO t1 VALUES(a_string(3000)) }
          179  +} {}
          180  +
          181  +do_execsql_test filefmt-2.2.4 { 
          182  +  PRAGMA integrity_check;
          183  +  BEGIN;
          184  +    INSERT INTO t2 VALUES(2);
          185  +    SAVEPOINT a;
          186  +      INSERT INTO t2 VALUES(3);
          187  +    ROLLBACK TO a;
          188  +} {ok}
          189  +
          190  +integrity_check filefmt-2.2.5
          191  +do_execsql_test filefmt-2.2.6 { COMMIT } {}
          192  +db close
          193  +sqlite3 db test.db
          194  +integrity_check filefmt-2.2.7
   120    195   
   121    196   finish_test

Changes to test/pagerfault.test.

  1041   1041         sqlite3 db test.db
  1042   1042         execsql { PRAGMA integrity_check }
  1043   1043       } {ok}
  1044   1044       db close
  1045   1045     }
  1046   1046   }
  1047   1047   
         1048  +
         1049  +#-------------------------------------------------------------------------
         1050  +# When a 3.7.0 client opens a write-transaction on a database file that
         1051  +# has been appended to or truncated by a pre-370 client, it updates
         1052  +# the db-size in the file header immediately. This test case provokes
         1053  +# errors during that operation.
         1054  +#
         1055  +do_test pagerfault-22-pre1 {
         1056  +  faultsim_delete_and_reopen
         1057  +  db func a_string a_string
         1058  +  execsql {
         1059  +    PRAGMA page_size = 1024;
         1060  +    PRAGMA auto_vacuum = 0;
         1061  +    CREATE TABLE t1(a);
         1062  +    CREATE INDEX i1 ON t1(a);
         1063  +    INSERT INTO t1 VALUES(a_string(3000));
         1064  +    CREATE TABLE t2(a);
         1065  +    INSERT INTO t2 VALUES(1);
         1066  +  }
         1067  +  db close
         1068  +  sql36231 { INSERT INTO t1 VALUES(a_string(3000)) }
         1069  +  faultsim_save_and_close
         1070  +} {}
         1071  +do_faultsim_test pagerfault-22 -prep {
         1072  +  faultsim_restore_and_reopen
         1073  +} -body {
         1074  +  execsql { INSERT INTO t2 VALUES(2) }
         1075  +  execsql { SELECT * FROM t2 }
         1076  +} -test {
         1077  +  faultsim_test_result {0 {1 2}}
         1078  +  faultsim_integrity_check
         1079  +}
         1080  +
  1048   1081   finish_test

Changes to test/tester.tcl.

  1221   1221   
  1222   1222     # Add some info to the output.
  1223   1223     #
  1224   1224     puts "Time: $tail $ms ms"
  1225   1225     show_memstats
  1226   1226   }
  1227   1227   
         1228  +# Open a new connection on database test.db and execute the SQL script
         1229  +# supplied as an argument. Before returning, close the new conection and
         1230  +# restore the 4 byte fields starting at header offsets 28, 92 and 96
         1231  +# to the values they held before the SQL was executed. This simulates
         1232  +# a write by a pre-3.7.0 client.
         1233  +#
         1234  +proc sql36231 {sql} {
         1235  +  set B [hexio_read test.db 92 8]
         1236  +  set A [hexio_read test.db 28 4]
         1237  +  sqlite3 db36231 test.db
         1238  +  catch { db36231 func a_string a_string }
         1239  +  execsql $sql db36231
         1240  +  db36231 close
         1241  +  hexio_write test.db 28 $A
         1242  +  hexio_write test.db 92 $B
         1243  +  return ""
         1244  +}
  1228   1245   
  1229   1246   # If the library is compiled with the SQLITE_DEFAULT_AUTOVACUUM macro set
  1230   1247   # to non-zero, then set the global variable $AUTOVACUUM to 1.
  1231   1248   set AUTOVACUUM $sqlite_options(default_autovacuum)
  1232   1249   
  1233   1250   source $testdir/thread_common.tcl