/ Check-in [aecbd890]
Login

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

Overview
Comment:Merge latest trunk changes with experimental branch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | experimental
Files: files | file ages | folders
SHA1: aecbd890327dc676d6c2366b07f3d2e636a4983e
User & Date: dan 2010-08-09 16:52:12
Context
2010-08-09
19:17
Modify some comments in pager.c. check-in: 5662da6d user: dan tags: experimental
16:52
Merge latest trunk changes with experimental branch. check-in: aecbd890 user: dan tags: experimental
16:12
Fix a memory leak in test_journal.c causing tests to fail. check-in: f229487c user: dan tags: experimental
15:44
Fix typos in comments. No functional changes to the code. check-in: 9cebaf2d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts3/fts3.c.

  2649   2649   /*
  2650   2650   ** The fts3 built-in tokenizers - "simple" and "porter" - are implemented
  2651   2651   ** in files fts3_tokenizer1.c and fts3_porter.c respectively. The following
  2652   2652   ** two forward declarations are for functions declared in these files
  2653   2653   ** used to retrieve the respective implementations.
  2654   2654   **
  2655   2655   ** Calling sqlite3Fts3SimpleTokenizerModule() sets the value pointed
  2656         -** to by the argument to point a the "simple" tokenizer implementation.
         2656  +** to by the argument to point to the "simple" tokenizer implementation.
  2657   2657   ** Function ...PorterTokenizerModule() sets *pModule to point to the
  2658   2658   ** porter tokenizer/stemmer implementation.
  2659   2659   */
  2660   2660   void sqlite3Fts3SimpleTokenizerModule(sqlite3_tokenizer_module const**ppModule);
  2661   2661   void sqlite3Fts3PorterTokenizerModule(sqlite3_tokenizer_module const**ppModule);
  2662   2662   void sqlite3Fts3IcuTokenizerModule(sqlite3_tokenizer_module const**ppModule);
  2663   2663   

Changes to ext/fts3/fts3_expr.c.

    74     74   
    75     75   /*
    76     76   ** Default span for NEAR operators.
    77     77   */
    78     78   #define SQLITE_FTS3_DEFAULT_NEAR_PARAM 10
    79     79   
    80     80   #include "fts3Int.h"
    81         -#include <ctype.h>
    82     81   #include <string.h>
    83     82   #include <assert.h>
    84     83   
    85     84   typedef struct ParseContext ParseContext;
    86     85   struct ParseContext {
    87     86     sqlite3_tokenizer *pTokenizer;      /* Tokenizer module */
    88     87     const char **azCol;                 /* Array of column names for fts3 table */
................................................................................
   100     99   ** an integer that falls outside of the range of the unsigned char type
   101    100   ** is undefined (and sometimes, "undefined" means segfault). This wrapper
   102    101   ** is defined to accept an argument of type char, and always returns 0 for
   103    102   ** any values that fall outside of the range of the unsigned char type (i.e.
   104    103   ** negative values).
   105    104   */
   106    105   static int fts3isspace(char c){
   107         -  return (c&0x80)==0 ? isspace(c) : 0;
          106  +  return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f';
   108    107   }
   109    108   
   110    109   /*
   111    110   ** Extract the next token from buffer z (length n) using the tokenizer
   112    111   ** and other information (column names etc.) in pParse. Create an Fts3Expr
   113    112   ** structure of type FTSQUERY_PHRASE containing a phrase consisting of this
   114    113   ** single token and set *ppExpr to point to it. If the end of the buffer is

Changes to ext/fts3/fts3_porter.c.

    26     26   
    27     27   #include "fts3Int.h"
    28     28   
    29     29   #include <assert.h>
    30     30   #include <stdlib.h>
    31     31   #include <stdio.h>
    32     32   #include <string.h>
    33         -#include <ctype.h>
    34     33   
    35     34   #include "fts3_tokenizer.h"
    36     35   
    37     36   /*
    38     37   ** Class derived from sqlite3_tokenizer
    39     38   */
    40     39   typedef struct porter_tokenizer {

Changes to ext/fts3/fts3_snippet.c.

    12     12   */
    13     13   
    14     14   #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
    15     15   
    16     16   #include "fts3Int.h"
    17     17   #include <string.h>
    18     18   #include <assert.h>
    19         -#include <ctype.h>
    20     19   
    21     20   
    22     21   /*
    23     22   ** Used as an fts3ExprIterate() context when loading phrase doclists to
    24     23   ** Fts3Expr.aDoclist[]/nDoclist.
    25     24   */
    26     25   typedef struct LoadDoclistCtx LoadDoclistCtx;

Changes to ext/fts3/fts3_tokenizer.c.

    28     28   #include "sqlite3ext.h"
    29     29   #ifndef SQLITE_CORE
    30     30     SQLITE_EXTENSION_INIT1
    31     31   #endif
    32     32   
    33     33   #include "fts3Int.h"
    34     34   #include <assert.h>
    35         -#include <ctype.h>
    36     35   #include <string.h>
    37     36   
    38     37   /*
    39     38   ** Implementation of the SQL scalar function for accessing the underlying 
    40     39   ** hash table. This function may be called as follows:
    41     40   **
    42     41   **   SELECT <function-name>(<key-name>);

Changes to ext/fts3/fts3_tokenizer1.c.

    26     26   
    27     27   #include "fts3Int.h"
    28     28   
    29     29   #include <assert.h>
    30     30   #include <stdlib.h>
    31     31   #include <stdio.h>
    32     32   #include <string.h>
    33         -#include <ctype.h>
    34     33   
    35     34   #include "fts3_tokenizer.h"
    36     35   
    37     36   typedef struct simple_tokenizer {
    38     37     sqlite3_tokenizer base;
    39     38     char delim[128];             /* flag ASCII delimiters */
    40     39   } simple_tokenizer;
................................................................................
    49     48     int nTokenAllocated;         /* space allocated to zToken buffer */
    50     49   } simple_tokenizer_cursor;
    51     50   
    52     51   
    53     52   static int simpleDelim(simple_tokenizer *t, unsigned char c){
    54     53     return c<0x80 && t->delim[c];
    55     54   }
           55  +static int fts3_isalnum(int x){
           56  +  return (x>='0' && x<='9') || (x>='A' && x<='Z') || (x>='a' && x<='z');
           57  +}
    56     58   
    57     59   /*
    58     60   ** Create a new tokenizer instance.
    59     61   */
    60     62   static int simpleCreate(
    61     63     int argc, const char * const *argv,
    62     64     sqlite3_tokenizer **ppTokenizer
................................................................................
    83     85         }
    84     86         t->delim[ch] = 1;
    85     87       }
    86     88     } else {
    87     89       /* Mark non-alphanumeric ASCII characters as delimiters */
    88     90       int i;
    89     91       for(i=1; i<0x80; i++){
    90         -      t->delim[i] = !isalnum(i) ? -1 : 0;
           92  +      t->delim[i] = !fts3_isalnum(i) ? -1 : 0;
    91     93       }
    92     94     }
    93     95   
    94     96     *ppTokenizer = &t->base;
    95     97     return SQLITE_OK;
    96     98   }
    97     99   
................................................................................
   189    191           c->pToken = pNew;
   190    192         }
   191    193         for(i=0; i<n; i++){
   192    194           /* TODO(shess) This needs expansion to handle UTF-8
   193    195           ** case-insensitivity.
   194    196           */
   195    197           unsigned char ch = p[iStartOffset+i];
   196         -        c->pToken[i] = (char)(ch<0x80 ? tolower(ch) : ch);
          198  +        c->pToken[i] = (char)((ch>='A' && ch<='Z') ? ch-'A'+'a' : ch);
   197    199         }
   198    200         *ppToken = c->pToken;
   199    201         *pnBytes = n;
   200    202         *piStartOffset = iStartOffset;
   201    203         *piEndOffset = c->iOffset;
   202    204         *piPosition = c->iToken++;
   203    205   

Changes to src/select.c.

  1794   1794   ** The data to be output is contained in pIn->iMem.  There are
  1795   1795   ** pIn->nMem columns to be output.  pDest is where the output should
  1796   1796   ** be sent.
  1797   1797   **
  1798   1798   ** regReturn is the number of the register holding the subroutine
  1799   1799   ** return address.
  1800   1800   **
  1801         -** If regPrev>0 then it is a the first register in a vector that
         1801  +** If regPrev>0 then it is the first register in a vector that
  1802   1802   ** records the previous output.  mem[regPrev] is a flag that is false
  1803   1803   ** if there has been no previous output.  If regPrev>0 then code is
  1804   1804   ** generated to suppress duplicates.  pKeyInfo is used for comparing
  1805   1805   ** keys.
  1806   1806   **
  1807   1807   ** If the LIMIT found in p->iLimit is reached, jump immediately to
  1808   1808   ** iBreak.

Changes to src/sqlite.h.in.

    88     88   ** The SQLITE_VERSION_NUMBER for any given release of SQLite will also
    89     89   ** be larger than the release from which it is derived.  Either Y will
    90     90   ** be held constant and Z will be incremented or else Y will be incremented
    91     91   ** and Z will be reset to zero.
    92     92   **
    93     93   ** Since version 3.6.18, SQLite source code has been stored in the
    94     94   ** <a href="http://www.fossil-scm.org/">Fossil configuration management
    95         -** system</a>.  ^The SQLITE_SOURCE_ID macro evalutes to
           95  +** system</a>.  ^The SQLITE_SOURCE_ID macro evaluates to
    96     96   ** a string which identifies a particular check-in of SQLite
    97     97   ** within its configuration management system.  ^The SQLITE_SOURCE_ID
    98     98   ** string contains the date and time of the check-in (UTC) and an SHA1
    99     99   ** hash of the entire source tree.
   100    100   **
   101    101   ** See also: [sqlite3_libversion()],
   102    102   ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
................................................................................
   145    145   ** CAPI3REF: Run-Time Library Compilation Options Diagnostics
   146    146   **
   147    147   ** ^The sqlite3_compileoption_used() function returns 0 or 1 
   148    148   ** indicating whether the specified option was defined at 
   149    149   ** compile time.  ^The SQLITE_ prefix may be omitted from the 
   150    150   ** option name passed to sqlite3_compileoption_used().  
   151    151   **
   152         -** ^The sqlite3_compileoption_get() function allows interating
          152  +** ^The sqlite3_compileoption_get() function allows iterating
   153    153   ** over the list of options that were defined at compile time by
   154    154   ** returning the N-th compile time option string.  ^If N is out of range,
   155    155   ** sqlite3_compileoption_get() returns a NULL pointer.  ^The SQLITE_ 
   156    156   ** prefix is omitted from any strings returned by 
   157    157   ** sqlite3_compileoption_get().
   158    158   **
   159    159   ** ^Support for the diagnostic functions sqlite3_compileoption_used()
   160         -** and sqlite3_compileoption_get() may be omitted by specifing the 
          160  +** and sqlite3_compileoption_get() may be omitted by specifying the 
   161    161   ** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time.
   162    162   **
   163    163   ** See also: SQL functions [sqlite_compileoption_used()] and
   164    164   ** [sqlite_compileoption_get()] and the [compile_options pragma].
   165    165   */
   166    166   #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
   167    167   int sqlite3_compileoption_used(const char *zOptName);
................................................................................
   259    259   #endif
   260    260   
   261    261   /*
   262    262   ** CAPI3REF: Closing A Database Connection
   263    263   **
   264    264   ** ^The sqlite3_close() routine is the destructor for the [sqlite3] object.
   265    265   ** ^Calls to sqlite3_close() return SQLITE_OK if the [sqlite3] object is
   266         -** successfullly destroyed and all associated resources are deallocated.
          266  +** successfully destroyed and all associated resources are deallocated.
   267    267   **
   268    268   ** Applications must [sqlite3_finalize | finalize] all [prepared statements]
   269    269   ** and [sqlite3_blob_close | close] all [BLOB handles] associated with
   270    270   ** the [sqlite3] object prior to attempting to close the object.  ^If
   271    271   ** sqlite3_close() is called on a [database connection] that still has
   272    272   ** outstanding [prepared statements] or [BLOB handles], then it returns
   273    273   ** SQLITE_BUSY.
................................................................................
  2663   2663   ** <li>  ?NNN
  2664   2664   ** <li>  :VVV
  2665   2665   ** <li>  @VVV
  2666   2666   ** <li>  $VVV
  2667   2667   ** </ul>
  2668   2668   **
  2669   2669   ** In the templates above, NNN represents an integer literal,
  2670         -** and VVV represents an alphanumeric identifer.)^  ^The values of these
         2670  +** and VVV represents an alphanumeric identifier.)^  ^The values of these
  2671   2671   ** parameters (also called "host parameter names" or "SQL parameters")
  2672   2672   ** can be set using the sqlite3_bind_*() routines defined here.
  2673   2673   **
  2674   2674   ** ^The first argument to the sqlite3_bind_*() routines is always
  2675   2675   ** a pointer to the [sqlite3_stmt] object returned from
  2676   2676   ** [sqlite3_prepare_v2()] or its variants.
  2677   2677   **
................................................................................
  3442   3442   const void *sqlite3_value_text16be(sqlite3_value*);
  3443   3443   int sqlite3_value_type(sqlite3_value*);
  3444   3444   int sqlite3_value_numeric_type(sqlite3_value*);
  3445   3445   
  3446   3446   /*
  3447   3447   ** CAPI3REF: Obtain Aggregate Function Context
  3448   3448   **
  3449         -** Implementions of aggregate SQL functions use this
         3449  +** Implementations of aggregate SQL functions use this
  3450   3450   ** routine to allocate memory for storing their state.
  3451   3451   **
  3452   3452   ** ^The first time the sqlite3_aggregate_context(C,N) routine is called 
  3453   3453   ** for a particular aggregate function, SQLite
  3454   3454   ** allocates N of memory, zeroes out that memory, and returns a pointer
  3455   3455   ** to the new memory. ^On second and subsequent calls to
  3456   3456   ** sqlite3_aggregate_context() for the same aggregate function instance,
................................................................................
  3714   3714   ** expects pointers to be UTF-16 strings in the native byte order, or the
  3715   3715   ** argument can be [SQLITE_UTF16_ALIGNED] if the
  3716   3716   ** the routine expects pointers to 16-bit word aligned strings
  3717   3717   ** of UTF-16 in the native byte order.
  3718   3718   **
  3719   3719   ** A pointer to the user supplied routine must be passed as the fifth
  3720   3720   ** argument.  ^If it is NULL, this is the same as deleting the collation
  3721         -** sequence (so that SQLite cannot call it anymore).
         3721  +** sequence (so that SQLite cannot call it any more).
  3722   3722   ** ^Each time the application supplied function is invoked, it is passed
  3723   3723   ** as its first parameter a copy of the void* passed as the fourth argument
  3724   3724   ** to sqlite3_create_collation() or sqlite3_create_collation16().
  3725   3725   **
  3726   3726   ** ^The remaining arguments to the application-supplied routine are two strings,
  3727   3727   ** each represented by a (length, data) pair and encoded in the encoding
  3728   3728   ** that was passed as the third argument when the collation sequence was
................................................................................
  4932   4932   ** of a valid mutex handle. The implementations of the methods defined
  4933   4933   ** by this structure are not required to handle this case, the results
  4934   4934   ** of passing a NULL pointer instead of a valid mutex handle are undefined
  4935   4935   ** (i.e. it is acceptable to provide an implementation that segfaults if
  4936   4936   ** it is passed a NULL pointer).
  4937   4937   **
  4938   4938   ** The xMutexInit() method must be threadsafe.  ^It must be harmless to
  4939         -** invoke xMutexInit() mutiple times within the same process and without
         4939  +** invoke xMutexInit() multiple times within the same process and without
  4940   4940   ** intervening calls to xMutexEnd().  Second and subsequent calls to
  4941   4941   ** xMutexInit() must be no-ops.
  4942   4942   **
  4943   4943   ** ^xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()]
  4944   4944   ** and its associates).  ^Similarly, xMutexAlloc() must not use SQLite memory
  4945   4945   ** allocation for a static mutex.  ^However xMutexAlloc() may use SQLite
  4946   4946   ** memory allocation for a fast or recursive mutex.
................................................................................
  5102   5102   #define SQLITE_TESTCTRL_PGHDRSZ                 17
  5103   5103   #define SQLITE_TESTCTRL_LAST                    17
  5104   5104   
  5105   5105   /*
  5106   5106   ** CAPI3REF: SQLite Runtime Status
  5107   5107   **
  5108   5108   ** ^This interface is used to retrieve runtime status information
  5109         -** about the preformance of SQLite, and optionally to reset various
         5109  +** about the performance of SQLite, and optionally to reset various
  5110   5110   ** highwater marks.  ^The first argument is an integer code for
  5111   5111   ** the specific parameter to measure.  ^(Recognized integer codes
  5112   5112   ** are of the form [SQLITE_STATUS_MEMORY_USED | SQLITE_STATUS_...].)^
  5113   5113   ** ^The current value of the parameter is returned into *pCurrent.
  5114   5114   ** ^The highest recorded value is returned in *pHighwater.  ^If the
  5115   5115   ** resetFlag is true, then the highest record value is reset after
  5116   5116   ** *pHighwater is written.  ^(Some parameters do not record the highest
................................................................................
  5228   5228   ** CAPI3REF: Database Connection Status
  5229   5229   **
  5230   5230   ** ^This interface is used to retrieve runtime status information 
  5231   5231   ** about a single [database connection].  ^The first argument is the
  5232   5232   ** database connection object to be interrogated.  ^The second argument
  5233   5233   ** is an integer constant, taken from the set of
  5234   5234   ** [SQLITE_DBSTATUS_LOOKASIDE_USED | SQLITE_DBSTATUS_*] macros, that
  5235         -** determiness the parameter to interrogate.  The set of 
         5235  +** determines the parameter to interrogate.  The set of 
  5236   5236   ** [SQLITE_DBSTATUS_LOOKASIDE_USED | SQLITE_DBSTATUS_*] macros is likely
  5237   5237   ** to grow in future releases of SQLite.
  5238   5238   **
  5239   5239   ** ^The current value of the requested parameter is written into *pCur
  5240   5240   ** and the highest instantaneous value is written into *pHiwtr.  ^If
  5241   5241   ** the resetFlg is true, then the highest instantaneous value is
  5242   5242   ** reset back down to the current value.
................................................................................
  5650   5650   ** is not a permanent error and does not affect the return value of
  5651   5651   ** sqlite3_backup_finish().
  5652   5652   **
  5653   5653   ** <b>sqlite3_backup_remaining(), sqlite3_backup_pagecount()</b>
  5654   5654   **
  5655   5655   ** ^Each call to sqlite3_backup_step() sets two values inside
  5656   5656   ** the [sqlite3_backup] object: the number of pages still to be backed
  5657         -** up and the total number of pages in the source databae file.
         5657  +** up and the total number of pages in the source database file.
  5658   5658   ** The sqlite3_backup_remaining() and sqlite3_backup_pagecount() interfaces
  5659   5659   ** retrieve these two values, respectively.
  5660   5660   **
  5661   5661   ** ^The values returned by these functions are only updated by
  5662   5662   ** sqlite3_backup_step(). ^If the source database is modified during a backup
  5663   5663   ** operation, then the values are not updated to account for any extra
  5664   5664   ** pages that need to be updated or the size of the source database file
................................................................................
  5746   5746   ** the other connections to use as the blocking connection.
  5747   5747   **
  5748   5748   ** ^(There may be at most one unlock-notify callback registered by a 
  5749   5749   ** blocked connection. If sqlite3_unlock_notify() is called when the
  5750   5750   ** blocked connection already has a registered unlock-notify callback,
  5751   5751   ** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is
  5752   5752   ** called with a NULL pointer as its second argument, then any existing
  5753         -** unlock-notify callback is cancelled. ^The blocked connections 
         5753  +** unlock-notify callback is canceled. ^The blocked connections 
  5754   5754   ** unlock-notify callback may also be canceled by closing the blocked
  5755   5755   ** connection using [sqlite3_close()].
  5756   5756   **
  5757   5757   ** The unlock-notify callback is not reentrant. If an application invokes
  5758   5758   ** any sqlite3_xxx API functions from within an unlock-notify callback, a
  5759   5759   ** crash or deadlock may be the result.
  5760   5760   **
................................................................................
  5828   5828   
  5829   5829   
  5830   5830   /*
  5831   5831   ** CAPI3REF: String Comparison
  5832   5832   **
  5833   5833   ** ^The [sqlite3_strnicmp()] API allows applications and extensions to
  5834   5834   ** compare the contents of two buffers containing UTF-8 strings in a
  5835         -** case-indendent fashion, using the same definition of case independence 
         5835  +** case-independent fashion, using the same definition of case independence 
  5836   5836   ** that SQLite uses internally when comparing identifiers.
  5837   5837   */
  5838   5838   int sqlite3_strnicmp(const char *, const char *, int);
  5839   5839   
  5840   5840   /*
  5841   5841   ** CAPI3REF: Error Logging Interface
  5842   5842   **

Changes to src/sqliteInt.h.

  1350   1350   /*
  1351   1351   ** An instance of the following structure is passed as the first
  1352   1352   ** argument to sqlite3VdbeKeyCompare and is used to control the 
  1353   1353   ** comparison of the two index keys.
  1354   1354   */
  1355   1355   struct KeyInfo {
  1356   1356     sqlite3 *db;        /* The database connection */
  1357         -  u8 enc;             /* Text encoding - one of the TEXT_Utf* values */
         1357  +  u8 enc;             /* Text encoding - one of the SQLITE_UTF* values */
  1358   1358     u16 nField;         /* Number of entries in aColl[] */
  1359   1359     u8 *aSortOrder;     /* Sort order for each column.  May be NULL */
  1360   1360     CollSeq *aColl[1];  /* Collating sequence for each term of the key */
  1361   1361   };
  1362   1362   
  1363   1363   /*
  1364   1364   ** An instance of the following structure holds information about a