/ Check-in [6f6e2d50]
Login

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

Overview
Comment:Many spelling fixes in comments. No changes to code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6f6e2d50941e444ebc83604daddcc034137a05b7
User & Date: mistachkin 2013-03-21 21:20:32
Context
2013-03-24
22:56
Remove the SQLITE_OMIT_MERGE_SORT compile-time option and its related code. The merge sorter is now a required component. check-in: 8b44d6fb user: drh tags: trunk
2013-03-21
21:20
Many spelling fixes in comments. No changes to code. check-in: 6f6e2d50 user: mistachkin tags: trunk
2013-03-20
12:04
Fix text-to-numeric type casting so that it works correctly on UTF16 strings that contain characters where the LSB is numeric but the MSB is non-zero. Ticket [689137afb6da41] check-in: 5b22053f user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts1/ft_hash.h.

     5      5   ** a legal notice, here is a blessing:
     6      6   **
     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12         -** This is the header file for the generic hash-table implemenation
           12  +** This is the header file for the generic hash-table implementation
    13     13   ** used in SQLite.  We've modified it slightly to serve as a standalone
    14     14   ** hash table implementation for the full-text indexing module.
    15     15   **
    16     16   */
    17     17   #ifndef _HASH_H_
    18     18   #define _HASH_H_
    19     19   

Changes to ext/fts1/fts1_hash.h.

     5      5   ** a legal notice, here is a blessing:
     6      6   **
     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12         -** This is the header file for the generic hash-table implemenation
           12  +** This is the header file for the generic hash-table implementation
    13     13   ** used in SQLite.  We've modified it slightly to serve as a standalone
    14     14   ** hash table implementation for the full-text indexing module.
    15     15   **
    16     16   */
    17     17   #ifndef _FTS1_HASH_H_
    18     18   #define _FTS1_HASH_H_
    19     19   

Changes to ext/fts2/fts2.c.

  6775   6775   void sqlite3Fts2SimpleTokenizerModule(sqlite3_tokenizer_module const**ppModule);
  6776   6776   void sqlite3Fts2PorterTokenizerModule(sqlite3_tokenizer_module const**ppModule);
  6777   6777   void sqlite3Fts2IcuTokenizerModule(sqlite3_tokenizer_module const**ppModule);
  6778   6778   
  6779   6779   int sqlite3Fts2InitHashTable(sqlite3 *, fts2Hash *, const char *);
  6780   6780   
  6781   6781   /*
  6782         -** Initialise the fts2 extension. If this extension is built as part
         6782  +** Initialize the fts2 extension. If this extension is built as part
  6783   6783   ** of the sqlite library, then this function is called directly by
  6784   6784   ** SQLite. If fts2 is built as a dynamically loadable extension, this
  6785   6785   ** function is called by the sqlite3_extension_init() entry point.
  6786   6786   */
  6787   6787   int sqlite3Fts2Init(sqlite3 *db){
  6788   6788     int rc = SQLITE_OK;
  6789   6789     fts2Hash *pHash = 0;
................................................................................
  6793   6793   
  6794   6794     sqlite3Fts2SimpleTokenizerModule(&pSimple);
  6795   6795     sqlite3Fts2PorterTokenizerModule(&pPorter);
  6796   6796   #ifdef SQLITE_ENABLE_ICU
  6797   6797     sqlite3Fts2IcuTokenizerModule(&pIcu);
  6798   6798   #endif
  6799   6799   
  6800         -  /* Allocate and initialise the hash-table used to store tokenizers. */
         6800  +  /* Allocate and initialize the hash-table used to store tokenizers. */
  6801   6801     pHash = sqlite3_malloc(sizeof(fts2Hash));
  6802   6802     if( !pHash ){
  6803   6803       rc = SQLITE_NOMEM;
  6804   6804     }else{
  6805   6805       sqlite3Fts2HashInit(pHash, FTS2_HASH_STRING, 1);
  6806   6806     }
  6807   6807   

Changes to ext/fts2/fts2_hash.h.

     5      5   ** a legal notice, here is a blessing:
     6      6   **
     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12         -** This is the header file for the generic hash-table implemenation
           12  +** This is the header file for the generic hash-table implementation
    13     13   ** used in SQLite.  We've modified it slightly to serve as a standalone
    14     14   ** hash table implementation for the full-text indexing module.
    15     15   **
    16     16   */
    17     17   #ifndef _FTS2_HASH_H_
    18     18   #define _FTS2_HASH_H_
    19     19   

Changes to ext/fts2/fts2_tokenizer.c.

   315    315   }
   316    316   
   317    317   #endif
   318    318   
   319    319   /*
   320    320   ** Set up SQL objects in database db used to access the contents of
   321    321   ** the hash table pointed to by argument pHash. The hash table must
   322         -** been initialised to use string keys, and to take a private copy 
          322  +** been initialized to use string keys, and to take a private copy 
   323    323   ** of the key when a value is inserted. i.e. by a call similar to:
   324    324   **
   325    325   **    sqlite3Fts2HashInit(pHash, FTS2_HASH_STRING, 1);
   326    326   **
   327    327   ** This function adds a scalar function (see header comment above
   328    328   ** scalarFunc() in this file for details) and, if ENABLE_TABLE is
   329    329   ** defined at compilation time, a temporary virtual table (see header 

Changes to ext/fts2/fts2_tokenizer.h.

    66     66     **
    67     67     ** then argc is set to 2, and the argv[] array contains pointers
    68     68     ** to the strings "arg1" and "arg2".
    69     69     **
    70     70     ** This method should return either SQLITE_OK (0), or an SQLite error 
    71     71     ** code. If SQLITE_OK is returned, then *ppTokenizer should be set
    72     72     ** to point at the newly created tokenizer structure. The generic
    73         -  ** sqlite3_tokenizer.pModule variable should not be initialised by
           73  +  ** sqlite3_tokenizer.pModule variable should not be initialized by
    74     74     ** this callback. The caller will do so.
    75     75     */
    76     76     int (*xCreate)(
    77     77       int argc,                           /* Size of argv array */
    78     78       const char *const*argv,             /* Tokenizer argument strings */
    79     79       sqlite3_tokenizer **ppTokenizer     /* OUT: Created tokenizer */
    80     80     );

Changes to ext/fts3/fts3.c.

  1567   1567         sqlite3_bind_int64(pCsr->pStmt, 1, pCsr->iPrevId);
  1568   1568         pCsr->isRequireSeek = 0;
  1569   1569         if( SQLITE_ROW==sqlite3_step(pCsr->pStmt) ){
  1570   1570           return SQLITE_OK;
  1571   1571         }else{
  1572   1572           rc = sqlite3_reset(pCsr->pStmt);
  1573   1573           if( rc==SQLITE_OK && ((Fts3Table *)pCsr->base.pVtab)->zContentTbl==0 ){
  1574         -          /* If no row was found and no error has occured, then the %_content
         1574  +          /* If no row was found and no error has occurred, then the %_content
  1575   1575             ** table is missing a row that is present in the full-text index.
  1576   1576             ** The data structures are corrupt.  */
  1577   1577             rc = FTS_CORRUPT_VTAB;
  1578   1578             pCsr->isEof = 1;
  1579   1579           }
  1580   1580         }
  1581   1581       }
................................................................................
  2807   2807   */
  2808   2808   static void fts3SegReaderCursorFree(Fts3MultiSegReader *pSegcsr){
  2809   2809     sqlite3Fts3SegReaderFinish(pSegcsr);
  2810   2810     sqlite3_free(pSegcsr);
  2811   2811   }
  2812   2812   
  2813   2813   /*
  2814         -** This function retreives the doclist for the specified term (or term
         2814  +** This function retrieves the doclist for the specified term (or term
  2815   2815   ** prefix) from the database.
  2816   2816   */
  2817   2817   static int fts3TermSelect(
  2818   2818     Fts3Table *p,                   /* Virtual table handle */
  2819   2819     Fts3PhraseToken *pTok,          /* Token to query for */
  2820   2820     int iColumn,                    /* Column to query (or -ve for all columns) */
  2821   2821     int *pnOut,                     /* OUT: Size of buffer at *ppOut */
................................................................................
  3558   3558   void sqlite3Fts3UnicodeTokenizer(sqlite3_tokenizer_module const**ppModule);
  3559   3559   #endif
  3560   3560   #ifdef SQLITE_ENABLE_ICU
  3561   3561   void sqlite3Fts3IcuTokenizerModule(sqlite3_tokenizer_module const**ppModule);
  3562   3562   #endif
  3563   3563   
  3564   3564   /*
  3565         -** Initialise the fts3 extension. If this extension is built as part
         3565  +** Initialize the fts3 extension. If this extension is built as part
  3566   3566   ** of the sqlite library, then this function is called directly by
  3567   3567   ** SQLite. If fts3 is built as a dynamically loadable extension, this
  3568   3568   ** function is called by the sqlite3_extension_init() entry point.
  3569   3569   */
  3570   3570   int sqlite3Fts3Init(sqlite3 *db){
  3571   3571     int rc = SQLITE_OK;
  3572   3572     Fts3Hash *pHash = 0;
................................................................................
  3592   3592   
  3593   3593     rc = sqlite3Fts3InitAux(db);
  3594   3594     if( rc!=SQLITE_OK ) return rc;
  3595   3595   
  3596   3596     sqlite3Fts3SimpleTokenizerModule(&pSimple);
  3597   3597     sqlite3Fts3PorterTokenizerModule(&pPorter);
  3598   3598   
  3599         -  /* Allocate and initialise the hash-table used to store tokenizers. */
         3599  +  /* Allocate and initialize the hash-table used to store tokenizers. */
  3600   3600     pHash = sqlite3_malloc(sizeof(Fts3Hash));
  3601   3601     if( !pHash ){
  3602   3602       rc = SQLITE_NOMEM;
  3603   3603     }else{
  3604   3604       sqlite3Fts3HashInit(pHash, FTS3_HASH_STRING, 1);
  3605   3605     }
  3606   3606   
................................................................................
  5191   5191   ** must be of type FTSQUERY_PHRASE. 
  5192   5192   **
  5193   5193   ** The returned value is either NULL or a pointer to a buffer containing
  5194   5194   ** a position-list indicating the occurrences of the phrase in column iCol
  5195   5195   ** of the current row. 
  5196   5196   **
  5197   5197   ** More specifically, the returned buffer contains 1 varint for each 
  5198         -** occurence of the phrase in the column, stored using the normal (delta+2) 
         5198  +** occurrence of the phrase in the column, stored using the normal (delta+2) 
  5199   5199   ** compression and is terminated by either an 0x01 or 0x00 byte. For example,
  5200   5200   ** if the requested column contains "a b X c d X X" and the position-list
  5201   5201   ** for 'X' is requested, the buffer returned may contain:
  5202   5202   **
  5203   5203   **     0x04 0x05 0x03 0x01   or   0x04 0x05 0x03 0x00
  5204   5204   **
  5205   5205   ** This function works regardless of whether or not the phrase is deferred,

Changes to ext/fts3/fts3_expr.c.

   102    102     int nNest;                          /* Number of nested brackets */
   103    103   };
   104    104   
   105    105   /*
   106    106   ** This function is equivalent to the standard isspace() function. 
   107    107   **
   108    108   ** The standard isspace() can be awkward to use safely, because although it
   109         -** is defined to accept an argument of type int, its behaviour when passed
          109  +** is defined to accept an argument of type int, its behavior when passed
   110    110   ** an integer that falls outside of the range of the unsigned char type
   111    111   ** is undefined (and sometimes, "undefined" means segfault). This wrapper
   112    112   ** is defined to accept an argument of type char, and always returns 0 for
   113    113   ** any values that fall outside of the range of the unsigned char type (i.e.
   114    114   ** negative values).
   115    115   */
   116    116   static int fts3isspace(char c){

Changes to ext/fts3/fts3_hash.h.

     5      5   ** a legal notice, here is a blessing:
     6      6   **
     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12         -** This is the header file for the generic hash-table implemenation
           12  +** This is the header file for the generic hash-table implementation
    13     13   ** used in SQLite.  We've modified it slightly to serve as a standalone
    14     14   ** hash table implementation for the full-text indexing module.
    15     15   **
    16     16   */
    17     17   #ifndef _FTS3_HASH_H_
    18     18   #define _FTS3_HASH_H_
    19     19   

Changes to ext/fts3/fts3_snippet.c.

   385    385   
   386    386   /*
   387    387   ** Select the fragment of text consisting of nFragment contiguous tokens 
   388    388   ** from column iCol that represent the "best" snippet. The best snippet
   389    389   ** is the snippet with the highest score, where scores are calculated
   390    390   ** by adding:
   391    391   **
   392         -**   (a) +1 point for each occurence of a matchable phrase in the snippet.
          392  +**   (a) +1 point for each occurrence of a matchable phrase in the snippet.
   393    393   **
   394         -**   (b) +1000 points for the first occurence of each matchable phrase in 
          394  +**   (b) +1000 points for the first occurrence of each matchable phrase in 
   395    395   **       the snippet for which the corresponding mCovered bit is not set.
   396    396   **
   397    397   ** The selected snippet parameters are stored in structure *pFragment before
   398    398   ** returning. The score of the selected snippet is stored in *piScore
   399    399   ** before returning.
   400    400   */
   401    401   static int fts3BestSnippet(

Changes to ext/fts3/fts3_test.c.

   263    263   **
   264    264   ** If present, the first argument is the chunksize in bytes to load doclists
   265    265   ** in. The second argument is the minimum doclist size in bytes to use
   266    266   ** incremental loading with.
   267    267   **
   268    268   ** Whether or not the arguments are present, this command returns a list of
   269    269   ** two integers - the initial chunksize and threshold when the command is
   270         -** invoked. This can be used to restore the default behaviour after running
          270  +** invoked. This can be used to restore the default behavior after running
   271    271   ** tests. For example:
   272    272   **
   273    273   **    # Override incr-load settings for testing:
   274    274   **    set cfg [fts3_configure_incr_load $new_chunksize $new_threshold]
   275    275   **
   276    276   **    .... run tests ....
   277    277   **

Changes to ext/fts3/fts3_tokenizer.c.

   424    424   }
   425    425   
   426    426   #endif
   427    427   
   428    428   /*
   429    429   ** Set up SQL objects in database db used to access the contents of
   430    430   ** the hash table pointed to by argument pHash. The hash table must
   431         -** been initialised to use string keys, and to take a private copy 
          431  +** been initialized to use string keys, and to take a private copy 
   432    432   ** of the key when a value is inserted. i.e. by a call similar to:
   433    433   **
   434    434   **    sqlite3Fts3HashInit(pHash, FTS3_HASH_STRING, 1);
   435    435   **
   436    436   ** This function adds a scalar function (see header comment above
   437    437   ** scalarFunc() in this file for details) and, if ENABLE_TABLE is
   438    438   ** defined at compilation time, a temporary virtual table (see header 

Changes to ext/fts3/fts3_tokenizer.h.

    66     66     **
    67     67     ** then argc is set to 2, and the argv[] array contains pointers
    68     68     ** to the strings "arg1" and "arg2".
    69     69     **
    70     70     ** This method should return either SQLITE_OK (0), or an SQLite error 
    71     71     ** code. If SQLITE_OK is returned, then *ppTokenizer should be set
    72     72     ** to point at the newly created tokenizer structure. The generic
    73         -  ** sqlite3_tokenizer.pModule variable should not be initialised by
           73  +  ** sqlite3_tokenizer.pModule variable should not be initialized by
    74     74     ** this callback. The caller will do so.
    75     75     */
    76     76     int (*xCreate)(
    77     77       int argc,                           /* Size of argv array */
    78     78       const char *const*argv,             /* Tokenizer argument strings */
    79     79       sqlite3_tokenizer **ppTokenizer     /* OUT: Created tokenizer */
    80     80     );

Changes to ext/fts3/fts3_unicode.c.

   121    121   ** If so, no action is taken. Otherwise, the codepoint is added to the 
   122    122   ** unicode_tokenizer.aiException[] array. For the purposes of tokenization,
   123    123   ** the return value of sqlite3FtsUnicodeIsalnum() is inverted for all
   124    124   ** codepoints in the aiException[] array.
   125    125   **
   126    126   ** If a standalone diacritic mark (one that sqlite3FtsUnicodeIsdiacritic()
   127    127   ** identifies as a diacritic) occurs in the zIn/nIn string it is ignored.
   128         -** It is not possible to change the behaviour of the tokenizer with respect
          128  +** It is not possible to change the behavior of the tokenizer with respect
   129    129   ** to these codepoints.
   130    130   */
   131    131   static int unicodeAddExceptions(
   132    132     unicode_tokenizer *p,           /* Tokenizer to add exceptions to */
   133    133     int bAlnum,                     /* Replace Isalnum() return value with this */
   134    134     const char *zIn,                /* Array of characters to make exceptions */
   135    135     int nIn                         /* Length of z in bytes */

Changes to ext/icu/README.txt.

    94     94       comparision operator "REGEXP", based on the regular expression functions
    95     95       provided by the ICU library. The syntax of the operator is as described
    96     96       in SQLite documentation:
    97     97   
    98     98           <string> REGEXP <re-pattern>
    99     99   
   100    100       This extension uses the ICU defaults for regular expression matching
   101         -    behaviour. Specifically, this means that:
          101  +    behavior. Specifically, this means that:
   102    102   
   103    103           * Matching is case-sensitive,
   104    104           * Regular expression comments are not allowed within patterns, and
   105    105           * The '^' and '$' characters match the beginning and end of the
   106    106             <string> argument, not the beginning and end of lines within
   107    107             the <string> argument.
   108    108   

Changes to ext/rtree/rtree.c.

  2661   2661   static int rtreeDeleteRowid(Rtree *pRtree, sqlite3_int64 iDelete){
  2662   2662     int rc;                         /* Return code */
  2663   2663     RtreeNode *pLeaf = 0;           /* Leaf node containing record iDelete */
  2664   2664     int iCell;                      /* Index of iDelete cell in pLeaf */
  2665   2665     RtreeNode *pRoot;               /* Root node of rtree structure */
  2666   2666   
  2667   2667   
  2668         -  /* Obtain a reference to the root node to initialise Rtree.iDepth */
         2668  +  /* Obtain a reference to the root node to initialize Rtree.iDepth */
  2669   2669     rc = nodeAcquire(pRtree, 1, 0, &pRoot);
  2670   2670   
  2671   2671     /* Obtain a reference to the leaf node that contains the entry 
  2672   2672     ** about to be deleted. 
  2673   2673     */
  2674   2674     if( rc==SQLITE_OK ){
  2675   2675       rc = findLeafNode(pRtree, iDelete, &pLeaf);

Changes to src/attach.c.

   105    105       assert( z && zName );
   106    106       if( sqlite3StrICmp(z, zName)==0 ){
   107    107         zErrDyn = sqlite3MPrintf(db, "database %s is already in use", zName);
   108    108         goto attach_error;
   109    109       }
   110    110     }
   111    111   
   112         -  /* Allocate the new entry in the db->aDb[] array and initialise the schema
          112  +  /* Allocate the new entry in the db->aDb[] array and initialize the schema
   113    113     ** hash tables.
   114    114     */
   115    115     if( db->aDb==db->aDbStatic ){
   116    116       aNew = sqlite3DbMallocRaw(db, sizeof(db->aDb[0])*3 );
   117    117       if( aNew==0 ) return;
   118    118       memcpy(aNew, db->aDb, sizeof(db->aDb[0])*2);
   119    119     }else{
................................................................................
   122    122     }
   123    123     db->aDb = aNew;
   124    124     aNew = &db->aDb[db->nDb];
   125    125     memset(aNew, 0, sizeof(*aNew));
   126    126   
   127    127     /* Open the database file. If the btree is successfully opened, use
   128    128     ** it to obtain the database schema. At this point the schema may
   129         -  ** or may not be initialised.
          129  +  ** or may not be initialized.
   130    130     */
   131    131     flags = db->openFlags;
   132    132     rc = sqlite3ParseUri(db->pVfs->zName, zFile, &flags, &pVfs, &zPath, &zErr);
   133    133     if( rc!=SQLITE_OK ){
   134    134       if( rc==SQLITE_NOMEM ) db->mallocFailed = 1;
   135    135       sqlite3_result_error(context, zErr, -1);
   136    136       sqlite3_free(zErr);

Changes to src/bitvec.c.

    68     68   
    69     69   #define BITVEC_NPTR      (BITVEC_USIZE/sizeof(Bitvec *))
    70     70   
    71     71   
    72     72   /*
    73     73   ** A bitmap is an instance of the following structure.
    74     74   **
    75         -** This bitmap records the existance of zero or more bits
           75  +** This bitmap records the existence of zero or more bits
    76     76   ** with values between 1 and iSize, inclusive.
    77     77   **
    78     78   ** There are three possible representations of the bitmap.
    79     79   ** If iSize<=BITVEC_NBIT, then Bitvec.u.aBitmap[] is a straight
    80     80   ** bitmap.  The least significant bit is bit 1.
    81     81   **
    82     82   ** If iSize>BITVEC_NBIT and iDivisor==0 then Bitvec.u.aHash[] is

Changes to src/btree.c.

  2225   2225   ** may only be called if it is guaranteed that the b-tree mutex is already
  2226   2226   ** held.
  2227   2227   **
  2228   2228   ** This is useful in one special case in the backup API code where it is
  2229   2229   ** known that the shared b-tree mutex is held, but the mutex on the 
  2230   2230   ** database handle that owns *p is not. In this case if sqlite3BtreeEnter()
  2231   2231   ** were to be called, it might collide with some other operation on the
  2232         -** database handle that owns *p, causing undefined behaviour.
         2232  +** database handle that owns *p, causing undefined behavior.
  2233   2233   */
  2234   2234   int sqlite3BtreeGetReserveNoMutex(Btree *p){
  2235   2235     assert( sqlite3_mutex_held(p->pBt->mutex) );
  2236   2236     return p->pBt->pageSize - p->pBt->usableSize;
  2237   2237   }
  2238   2238   #endif /* SQLITE_HAS_CODEC || SQLITE_DEBUG */
  2239   2239   
................................................................................
  5505   5505         /* If the database supports auto-vacuum, and the second or subsequent
  5506   5506         ** overflow page is being allocated, add an entry to the pointer-map
  5507   5507         ** for that page now. 
  5508   5508         **
  5509   5509         ** If this is the first overflow page, then write a partial entry 
  5510   5510         ** to the pointer-map. If we write nothing to this pointer-map slot,
  5511   5511         ** then the optimistic overflow chain processing in clearCell()
  5512         -      ** may misinterpret the uninitialised values and delete the
         5512  +      ** may misinterpret the uninitialized values and delete the
  5513   5513         ** wrong pages from the database.
  5514   5514         */
  5515   5515         if( pBt->autoVacuum && rc==SQLITE_OK ){
  5516   5516           u8 eType = (pgnoPtrmap?PTRMAP_OVERFLOW2:PTRMAP_OVERFLOW1);
  5517   5517           ptrmapPut(pBt, pgnoOvfl, eType, pgnoPtrmap, &rc);
  5518   5518           if( rc ){
  5519   5519             releasePage(pOvfl);
................................................................................
  6978   6978       idx = ++pCur->aiIdx[pCur->iPage];
  6979   6979     }else{
  6980   6980       assert( pPage->leaf );
  6981   6981     }
  6982   6982     insertCell(pPage, idx, newCell, szNew, 0, 0, &rc);
  6983   6983     assert( rc!=SQLITE_OK || pPage->nCell>0 || pPage->nOverflow>0 );
  6984   6984   
  6985         -  /* If no error has occured and pPage has an overflow cell, call balance() 
         6985  +  /* If no error has occurred and pPage has an overflow cell, call balance() 
  6986   6986     ** to redistribute the cells within the tree. Since balance() may move
  6987   6987     ** the cursor, zero the BtCursor.info.nSize and BtCursor.validNKey
  6988   6988     ** variables.
  6989   6989     **
  6990   6990     ** Previous versions of SQLite called moveToRoot() to move the cursor
  6991   6991     ** back to the root page as balance() used to invalidate the contents
  6992   6992     ** of BtCursor.apPage[] and BtCursor.aiIdx[]. Instead of doing that,

Changes to src/build.c.

  2096   2096       );
  2097   2097     }
  2098   2098   #endif
  2099   2099   
  2100   2100     /* Drop all SQLITE_MASTER table and index entries that refer to the
  2101   2101     ** table. The program name loops through the master table and deletes
  2102   2102     ** every row that refers to a table of the same name as the one being
  2103         -  ** dropped. Triggers are handled seperately because a trigger can be
         2103  +  ** dropped. Triggers are handled separately because a trigger can be
  2104   2104     ** created in the temp database that refers to a table in another
  2105   2105     ** database.
  2106   2106     */
  2107   2107     sqlite3NestedParse(pParse, 
  2108   2108         "DELETE FROM %Q.%s WHERE tbl_name=%Q and type!='trigger'",
  2109   2109         pDb->zName, SCHEMA_TABLE(iDb), pTab->zName);
  2110   2110     if( !isView && !IsVirtual(pTab) ){
................................................................................
  2835   2835         if( k==pIdx->nColumn ){
  2836   2836           if( pIdx->onError!=pIndex->onError ){
  2837   2837             /* This constraint creates the same index as a previous
  2838   2838             ** constraint specified somewhere in the CREATE TABLE statement.
  2839   2839             ** However the ON CONFLICT clauses are different. If both this 
  2840   2840             ** constraint and the previous equivalent constraint have explicit
  2841   2841             ** ON CONFLICT clauses this is an error. Otherwise, use the
  2842         -          ** explicitly specified behaviour for the index.
         2842  +          ** explicitly specified behavior for the index.
  2843   2843             */
  2844   2844             if( !(pIdx->onError==OE_Default || pIndex->onError==OE_Default) ){
  2845   2845               sqlite3ErrorMsg(pParse, 
  2846   2846                   "conflicting ON CONFLICT clauses specified", 0);
  2847   2847             }
  2848   2848             if( pIdx->onError==OE_Default ){
  2849   2849               pIdx->onError = pIndex->onError;

Changes to src/expr.c.

  3538   3538     Vdbe *v = pParse->pVdbe;
  3539   3539     int op = 0;
  3540   3540     int regFree1 = 0;
  3541   3541     int regFree2 = 0;
  3542   3542     int r1, r2;
  3543   3543   
  3544   3544     assert( jumpIfNull==SQLITE_JUMPIFNULL || jumpIfNull==0 );
  3545         -  if( NEVER(v==0) )     return;  /* Existance of VDBE checked by caller */
         3545  +  if( NEVER(v==0) )     return;  /* Existence of VDBE checked by caller */
  3546   3546     if( NEVER(pExpr==0) ) return;  /* No way this can happen */
  3547   3547     op = pExpr->op;
  3548   3548     switch( op ){
  3549   3549       case TK_AND: {
  3550   3550         int d2 = sqlite3VdbeMakeLabel(v);
  3551   3551         testcase( jumpIfNull==0 );
  3552   3552         sqlite3ExprCachePush(pParse);
................................................................................
  3658   3658     Vdbe *v = pParse->pVdbe;
  3659   3659     int op = 0;
  3660   3660     int regFree1 = 0;
  3661   3661     int regFree2 = 0;
  3662   3662     int r1, r2;
  3663   3663   
  3664   3664     assert( jumpIfNull==SQLITE_JUMPIFNULL || jumpIfNull==0 );
  3665         -  if( NEVER(v==0) ) return; /* Existance of VDBE checked by caller */
         3665  +  if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */
  3666   3666     if( pExpr==0 )    return;
  3667   3667   
  3668   3668     /* The value of pExpr->op and op are related as follows:
  3669   3669     **
  3670   3670     **       pExpr->op            op
  3671   3671     **       ---------          ----------
  3672   3672     **       TK_ISNULL          OP_NotNull

Changes to src/hash.h.

     5      5   ** a legal notice, here is a blessing:
     6      6   **
     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12         -** This is the header file for the generic hash-table implemenation
           12  +** This is the header file for the generic hash-table implementation
    13     13   ** used in SQLite.
    14     14   */
    15     15   #ifndef _SQLITE_HASH_H_
    16     16   #define _SQLITE_HASH_H_
    17     17   
    18     18   /* Forward declarations of structures. */
    19     19   typedef struct Hash Hash;

Changes to src/main.c.

   881    881     if( db->magic!=SQLITE_MAGIC_ZOMBIE || connectionIsBusy(db) ){
   882    882       sqlite3_mutex_leave(db->mutex);
   883    883       return;
   884    884     }
   885    885   
   886    886     /* If we reach this point, it means that the database connection has
   887    887     ** closed all sqlite3_stmt and sqlite3_backup objects and has been
   888         -  ** pased to sqlite3_close (meaning that it is a zombie).  Therefore,
          888  +  ** passed to sqlite3_close (meaning that it is a zombie).  Therefore,
   889    889     ** go ahead and free all resources.
   890    890     */
   891    891   
   892    892     /* Free any outstanding Savepoint structures. */
   893    893     sqlite3CloseSavepoints(db);
   894    894   
   895    895     /* Close all database connections */

Changes to src/os_unix.c.

   333    333   /*
   334    334   ** Many system calls are accessed through pointer-to-functions so that
   335    335   ** they may be overridden at runtime to facilitate fault injection during
   336    336   ** testing and sandboxing.  The following array holds the names and pointers
   337    337   ** to all overrideable system calls.
   338    338   */
   339    339   static struct unix_syscall {
   340         -  const char *zName;            /* Name of the sytem call */
          340  +  const char *zName;            /* Name of the system call */
   341    341     sqlite3_syscall_ptr pCurrent; /* Current value of the system call */
   342    342     sqlite3_syscall_ptr pDefault; /* Default value */
   343    343   } aSyscall[] = {
   344    344     { "open",         (sqlite3_syscall_ptr)posixOpen,  0  },
   345    345   #define osOpen      ((int(*)(const char*,int,int))aSyscall[0].pCurrent)
   346    346   
   347    347     { "close",        (sqlite3_syscall_ptr)close,      0  },
................................................................................
  1905   1905   
  1906   1906   /******************* End of the no-op lock implementation *********************
  1907   1907   ******************************************************************************/
  1908   1908   
  1909   1909   /******************************************************************************
  1910   1910   ************************* Begin dot-file Locking ******************************
  1911   1911   **
  1912         -** The dotfile locking implementation uses the existance of separate lock
         1912  +** The dotfile locking implementation uses the existence of separate lock
  1913   1913   ** files (really a directory) to control access to the database.  This works
  1914   1914   ** on just about every filesystem imaginable.  But there are serious downsides:
  1915   1915   **
  1916   1916   **    (1)  There is zero concurrency.  A single reader blocks all other
  1917   1917   **         connections from reading or writing the database.
  1918   1918   **
  1919   1919   **    (2)  An application crash or power loss can leave stale lock files
................................................................................
  1920   1920   **         sitting around that need to be cleared manually.
  1921   1921   **
  1922   1922   ** Nevertheless, a dotlock is an appropriate locking mode for use if no
  1923   1923   ** other locking strategy is available.
  1924   1924   **
  1925   1925   ** Dotfile locking works by creating a subdirectory in the same directory as
  1926   1926   ** the database and with the same name but with a ".lock" extension added.
  1927         -** The existance of a lock directory implies an EXCLUSIVE lock.  All other
         1927  +** The existence of a lock directory implies an EXCLUSIVE lock.  All other
  1928   1928   ** lock types (SHARED, RESERVED, PENDING) are mapped into EXCLUSIVE.
  1929   1929   */
  1930   1930   
  1931   1931   /*
  1932   1932   ** The file suffix added to the data base filename in order to create the
  1933   1933   ** lock directory.
  1934   1934   */
................................................................................
  3409   3409     SimulateIOError( rc=1 );
  3410   3410     if( rc ){
  3411   3411       pFile->lastErrno = errno;
  3412   3412       return unixLogError(SQLITE_IOERR_FSYNC, "full_fsync", pFile->zPath);
  3413   3413     }
  3414   3414   
  3415   3415     /* Also fsync the directory containing the file if the DIRSYNC flag
  3416         -  ** is set.  This is a one-time occurrance.  Many systems (examples: AIX)
         3416  +  ** is set.  This is a one-time occurrence.  Many systems (examples: AIX)
  3417   3417     ** are unable to fsync a directory, so ignore errors on the fsync.
  3418   3418     */
  3419   3419     if( pFile->ctrlFlags & UNIXFILE_DIRSYNC ){
  3420   3420       int dirfd;
  3421   3421       OSTRACE(("DIRSYNC %s (have_fullfsync=%d fullsync=%d)\n", pFile->zPath,
  3422   3422               HAVE_FULLFSYNC, isFullsync));
  3423   3423       rc = osOpenDirectory(pFile->zPath, &dirfd);
................................................................................
  4783   4783   #if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE
  4784   4784       || pLockingStyle == &nfsIoMethods
  4785   4785   #endif
  4786   4786     ){
  4787   4787       unixEnterMutex();
  4788   4788       rc = findInodeInfo(pNew, &pNew->pInode);
  4789   4789       if( rc!=SQLITE_OK ){
  4790         -      /* If an error occured in findInodeInfo(), close the file descriptor
         4790  +      /* If an error occurred in findInodeInfo(), close the file descriptor
  4791   4791         ** immediately, before releasing the mutex. findInodeInfo() may fail
  4792   4792         ** in two scenarios:
  4793   4793         **
  4794   4794         **   (a) A call to fstat() failed.
  4795   4795         **   (b) A malloc failed.
  4796   4796         **
  4797   4797         ** Scenario (b) may only occur if the process is holding no other
................................................................................
  5421   5421       }
  5422   5422     }
  5423   5423   #endif
  5424   5424     return rc;
  5425   5425   }
  5426   5426   
  5427   5427   /*
  5428         -** Test the existance of or access permissions of file zPath. The
         5428  +** Test the existence of or access permissions of file zPath. The
  5429   5429   ** test performed depends on the value of flags:
  5430   5430   **
  5431   5431   **     SQLITE_ACCESS_EXISTS: Return 1 if the file exists
  5432   5432   **     SQLITE_ACCESS_READWRITE: Return 1 if the file is read and writable.
  5433   5433   **     SQLITE_ACCESS_READONLY: Return 1 if the file is readable.
  5434   5434   **
  5435   5435   ** Otherwise return 0.

Changes to src/os_win.c.

   304    304   /*
   305    305   ** Many system calls are accessed through pointer-to-functions so that
   306    306   ** they may be overridden at runtime to facilitate fault injection during
   307    307   ** testing and sandboxing.  The following array holds the names and pointers
   308    308   ** to all overrideable system calls.
   309    309   */
   310    310   static struct win_syscall {
   311         -  const char *zName;            /* Name of the sytem call */
          311  +  const char *zName;            /* Name of the system call */
   312    312     sqlite3_syscall_ptr pCurrent; /* Current value of the system call */
   313    313     sqlite3_syscall_ptr pDefault; /* Default value */
   314    314   } aSyscall[] = {
   315    315   #if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT
   316    316     { "AreFileApisANSI",         (SYSCALL)AreFileApisANSI,         0 },
   317    317   #else
   318    318     { "AreFileApisANSI",         (SYSCALL)0,                       0 },
................................................................................
  2021   2021     upperBits = (LONG)((iOffset>>32) & 0x7fffffff);
  2022   2022     lowerBits = (LONG)(iOffset & 0xffffffff);
  2023   2023   
  2024   2024     /* API oddity: If successful, SetFilePointer() returns a dword 
  2025   2025     ** containing the lower 32-bits of the new file-offset. Or, if it fails,
  2026   2026     ** it returns INVALID_SET_FILE_POINTER. However according to MSDN, 
  2027   2027     ** INVALID_SET_FILE_POINTER may also be a valid new offset. So to determine 
  2028         -  ** whether an error has actually occured, it is also necessary to call 
         2028  +  ** whether an error has actually occurred, it is also necessary to call 
  2029   2029     ** GetLastError().
  2030   2030     */
  2031   2031     dwRet = osSetFilePointer(pFile->h, lowerBits, &upperBits, FILE_BEGIN);
  2032   2032   
  2033   2033     if( (dwRet==INVALID_SET_FILE_POINTER
  2034   2034         && ((lastErrno = osGetLastError())!=NO_ERROR)) ){
  2035   2035       pFile->lastErrno = lastErrno;
................................................................................
  2167   2167   */
  2168   2168   static int winWrite(
  2169   2169     sqlite3_file *id,               /* File to write into */
  2170   2170     const void *pBuf,               /* The bytes to be written */
  2171   2171     int amt,                        /* Number of bytes to write */
  2172   2172     sqlite3_int64 offset            /* Offset into the file to begin writing at */
  2173   2173   ){
  2174         -  int rc = 0;                     /* True if error has occured, else false */
         2174  +  int rc = 0;                     /* True if error has occurred, else false */
  2175   2175     winFile *pFile = (winFile*)id;  /* File handle */
  2176   2176     int nRetry = 0;                 /* Number of retries */
  2177   2177   
  2178   2178     assert( amt>0 );
  2179   2179     assert( pFile );
  2180   2180     SimulateIOError(return SQLITE_IOERR_WRITE);
  2181   2181     SimulateDiskfullError(return SQLITE_FULL);
................................................................................
  3989   3989     }
  3990   3990     sqlite3_free(zConverted);
  3991   3991     OSTRACE(("DELETE \"%s\" %s\n", zFilename, (rc ? "failed" : "ok" )));
  3992   3992     return rc;
  3993   3993   }
  3994   3994   
  3995   3995   /*
  3996         -** Check the existance and status of a file.
         3996  +** Check the existence and status of a file.
  3997   3997   */
  3998   3998   static int winAccess(
  3999   3999     sqlite3_vfs *pVfs,         /* Not used on win32 */
  4000   4000     const char *zFilename,     /* Name of file to check */
  4001   4001     int flags,                 /* Type of test to make on this file */
  4002   4002     int *pResOut               /* OUT: Result */
  4003   4003   ){

Changes to src/pager.c.

   269    269   **    by finalizing the journal file. Once in WRITER_FINISHED state, it is 
   270    270   **    not possible to modify the database further. At this point, the upper 
   271    271   **    layer must either commit or rollback the transaction.
   272    272   **
   273    273   **    * A write transaction is active.
   274    274   **    * An EXCLUSIVE or greater lock is held on the database file.
   275    275   **    * All writing and syncing of journal and database data has finished.
   276         -**      If no error occured, all that remains is to finalize the journal to
          276  +**      If no error occurred, all that remains is to finalize the journal to
   277    277   **      commit the transaction. If an error did occur, the caller will need
   278    278   **      to rollback the transaction. 
   279    279   **
   280    280   **  ERROR:
   281    281   **
   282    282   **    The ERROR state is entered when an IO or disk-full error (including
   283    283   **    SQLITE_IOERR_NOMEM) occurs at a point in the code that makes it 
................................................................................
   517    517   **   The flag is cleared as soon as the journal file is finalized (either
   518    518   **   by PagerCommitPhaseTwo or PagerRollback). If an IO error prevents the
   519    519   **   journal file from being successfully finalized, the setMaster flag
   520    520   **   is cleared anyway (and the pager will move to ERROR state).
   521    521   **
   522    522   ** doNotSpill, doNotSyncSpill
   523    523   **
   524         -**   These two boolean variables control the behaviour of cache-spills
          524  +**   These two boolean variables control the behavior of cache-spills
   525    525   **   (calls made by the pcache module to the pagerStress() routine to
   526    526   **   write cached data to the file-system in order to free up memory).
   527    527   **
   528    528   **   When doNotSpill is non-zero, writing to the database from pagerStress()
   529    529   **   is disabled altogether. This is done in a very obscure case that
   530    530   **   comes up during savepoint rollback that requires the pcache module
   531    531   **   to allocate a new page to prevent the journal file from being written
................................................................................
  1395   1395     ){
  1396   1396       memcpy(zHeader, aJournalMagic, sizeof(aJournalMagic));
  1397   1397       put32bits(&zHeader[sizeof(aJournalMagic)], 0xffffffff);
  1398   1398     }else{
  1399   1399       memset(zHeader, 0, sizeof(aJournalMagic)+4);
  1400   1400     }
  1401   1401   
  1402         -  /* The random check-hash initialiser */ 
         1402  +  /* The random check-hash initializer */ 
  1403   1403     sqlite3_randomness(sizeof(pPager->cksumInit), &pPager->cksumInit);
  1404   1404     put32bits(&zHeader[sizeof(aJournalMagic)+4], pPager->cksumInit);
  1405   1405     /* The initial database size */
  1406   1406     put32bits(&zHeader[sizeof(aJournalMagic)+8], pPager->dbOrigSize);
  1407   1407     /* The assumed sector size for this process */
  1408   1408     put32bits(&zHeader[sizeof(aJournalMagic)+12], pPager->sectorSize);
  1409   1409   
................................................................................
  3727   3727   **      be necessary to write the current content out to the sub-journal
  3728   3728   **      (as determined by function subjRequiresPage()).
  3729   3729   **
  3730   3730   ** If the condition asserted by this function were not true, and the
  3731   3731   ** dirty page were to be discarded from the cache via the pagerStress()
  3732   3732   ** routine, pagerStress() would not write the current page content to
  3733   3733   ** the database file. If a savepoint transaction were rolled back after
  3734         -** this happened, the correct behaviour would be to restore the current
         3734  +** this happened, the correct behavior would be to restore the current
  3735   3735   ** content of the page. However, since this content is not present in either
  3736   3736   ** the database file or the portion of the rollback journal and 
  3737   3737   ** sub-journal rolled back the content could not be restored and the
  3738   3738   ** database image would become corrupt. It is therefore fortunate that 
  3739   3739   ** this circumstance cannot arise.
  3740   3740   */
  3741   3741   #if defined(SQLITE_DEBUG)

Changes to src/prepare.c.

   175    175     assert( iDb>=0 && iDb<db->nDb );
   176    176     assert( db->aDb[iDb].pSchema );
   177    177     assert( sqlite3_mutex_held(db->mutex) );
   178    178     assert( iDb==1 || sqlite3BtreeHoldsMutex(db->aDb[iDb].pBt) );
   179    179   
   180    180     /* zMasterSchema and zInitScript are set to point at the master schema
   181    181     ** and initialisation script appropriate for the database being
   182         -  ** initialised. zMasterName is the name of the master table.
          182  +  ** initialized. zMasterName is the name of the master table.
   183    183     */
   184    184     if( !OMIT_TEMPDB && iDb==1 ){
   185    185       zMasterSchema = temp_master_schema;
   186    186     }else{
   187    187       zMasterSchema = master_schema;
   188    188     }
   189    189     zMasterName = SCHEMA_TABLE(iDb);
................................................................................
   400    400       if( DbHasProperty(db, i, DB_SchemaLoaded) || i==1 ) continue;
   401    401       rc = sqlite3InitOne(db, i, pzErrMsg);
   402    402       if( rc ){
   403    403         sqlite3ResetOneSchema(db, i);
   404    404       }
   405    405     }
   406    406   
   407         -  /* Once all the other databases have been initialised, load the schema
          407  +  /* Once all the other databases have been initialized, load the schema
   408    408     ** for the TEMP database. This is loaded last, as the TEMP database
   409    409     ** schema may contain references to objects in other databases.
   410    410     */
   411    411   #ifndef SQLITE_OMIT_TEMPDB
   412    412     if( rc==SQLITE_OK && ALWAYS(db->nDb>1)
   413    413                       && !DbHasProperty(db, 1, DB_SchemaLoaded) ){
   414    414       rc = sqlite3InitOne(db, 1, pzErrMsg);
................................................................................
   423    423       sqlite3CommitInternalChanges(db);
   424    424     }
   425    425   
   426    426     return rc; 
   427    427   }
   428    428   
   429    429   /*
   430         -** This routine is a no-op if the database schema is already initialised.
          430  +** This routine is a no-op if the database schema is already initialized.
   431    431   ** Otherwise, the schema is loaded. An error code is returned.
   432    432   */
   433    433   int sqlite3ReadSchema(Parse *pParse){
   434    434     int rc = SQLITE_OK;
   435    435     sqlite3 *db = pParse->db;
   436    436     assert( sqlite3_mutex_held(db->mutex) );
   437    437     if( !db->init.busy ){

Changes to src/select.c.

  4566   4566           ** If where.c is able to produce results sorted in this order, then
  4567   4567           ** add vdbe code to break out of the processing loop after the 
  4568   4568           ** first iteration (since the first iteration of the loop is 
  4569   4569           ** guaranteed to operate on the row with the minimum or maximum 
  4570   4570           ** value of x, the only row required).
  4571   4571           **
  4572   4572           ** A special flag must be passed to sqlite3WhereBegin() to slightly
  4573         -        ** modify behaviour as follows:
         4573  +        ** modify behavior as follows:
  4574   4574           **
  4575   4575           **   + If the query is a "SELECT min(x)", then the loop coded by
  4576   4576           **     where.c should not iterate over any values with a NULL value
  4577   4577           **     for x.
  4578   4578           **
  4579   4579           **   + The optimizer code in where.c (the thing that decides which
  4580   4580           **     index or indices to use) should place a different priority on 

Changes to src/sqlite.h.in.

  2671   2671   **
  2672   2672   **   <li> <b>cache</b>: ^The cache parameter may be set to either "shared" or
  2673   2673   **     "private". ^Setting it to "shared" is equivalent to setting the
  2674   2674   **     SQLITE_OPEN_SHAREDCACHE bit in the flags argument passed to
  2675   2675   **     sqlite3_open_v2(). ^Setting the cache parameter to "private" is 
  2676   2676   **     equivalent to setting the SQLITE_OPEN_PRIVATECACHE bit.
  2677   2677   **     ^If sqlite3_open_v2() is used and the "cache" parameter is present in
  2678         -**     a URI filename, its value overrides any behaviour requested by setting
         2678  +**     a URI filename, its value overrides any behavior requested by setting
  2679   2679   **     SQLITE_OPEN_PRIVATECACHE or SQLITE_OPEN_SHAREDCACHE flag.
  2680   2680   ** </ul>
  2681   2681   **
  2682   2682   ** ^Specifying an unknown parameter in the query component of a URI is not an
  2683   2683   ** error.  Future versions of SQLite might understand additional query
  2684   2684   ** parameters.  See "[query parameters with special meaning to SQLite]" for
  2685   2685   ** additional information.
................................................................................
  6374   6374   ** If the requested page is already in the page cache, then the page cache
  6375   6375   ** implementation must return a pointer to the page buffer with its content
  6376   6376   ** intact.  If the requested page is not already in the cache, then the
  6377   6377   ** cache implementation should use the value of the createFlag
  6378   6378   ** parameter to help it determined what action to take:
  6379   6379   **
  6380   6380   ** <table border=1 width=85% align=center>
  6381         -** <tr><th> createFlag <th> Behaviour when page is not already in cache
         6381  +** <tr><th> createFlag <th> Behavior when page is not already in cache
  6382   6382   ** <tr><td> 0 <td> Do not allocate a new page.  Return NULL.
  6383   6383   ** <tr><td> 1 <td> Allocate a new page if it easy and convenient to do so.
  6384   6384   **                 Otherwise return NULL.
  6385   6385   ** <tr><td> 2 <td> Make every effort to allocate a new page.  Only return
  6386   6386   **                 NULL if allocating a new page is effectively impossible.
  6387   6387   ** </table>
  6388   6388   **

Changes to src/tclsqlite.c.

  1001   1001     zEnd = azEnd[(rc==TCL_ERROR)*2 + (pDb->nTransaction==0)];
  1002   1002   
  1003   1003     pDb->disableAuth++;
  1004   1004     if( sqlite3_exec(pDb->db, zEnd, 0, 0, 0) ){
  1005   1005         /* This is a tricky scenario to handle. The most likely cause of an
  1006   1006         ** error is that the exec() above was an attempt to commit the 
  1007   1007         ** top-level transaction that returned SQLITE_BUSY. Or, less likely,
  1008         -      ** that an IO-error has occured. In either case, throw a Tcl exception
         1008  +      ** that an IO-error has occurred. In either case, throw a Tcl exception
  1009   1009         ** and try to rollback the transaction.
  1010   1010         **
  1011   1011         ** But it could also be that the user executed one or more BEGIN, 
  1012   1012         ** COMMIT, SAVEPOINT, RELEASE or ROLLBACK commands that are confusing
  1013   1013         ** this method's logic. Not clear how this would be best handled.
  1014   1014         */
  1015   1015       if( rc!=TCL_ERROR ){

Changes to src/test6.c.

    83     83   **   If the IOCAP_ATOMIC flag is set, then option (3) above is 
    84     84   **   never selected.
    85     85   **
    86     86   **   If the IOCAP_ATOMIC512 flag is set, and the WriteBuffer represents
    87     87   **   an aligned write() of an integer number of 512 byte regions, then
    88     88   **   option (3) above is never selected. Instead, each 512 byte region
    89     89   **   is either correctly written or left completely untouched. Similar
    90         -**   logic governs the behaviour if any of the other ATOMICXXX flags
           90  +**   logic governs the behavior if any of the other ATOMICXXX flags
    91     91   **   is set.
    92     92   **
    93     93   **   If either the IOCAP_SAFEAPPEND or IOCAP_SEQUENTIAL flags are set
    94     94   **   and a crash is being simulated, then an entry of the write-list is
    95     95   **   selected at random. Everything in the list after the selected entry 
    96     96   **   is discarded before processing begins.
    97     97   **

Changes to src/test_multiplex.c.

    56     56   #ifndef SQLITE_CORE
    57     57     #define SQLITE_CORE 1  /* Disable the API redefinition in sqlite3ext.h */
    58     58   #endif
    59     59   #include "sqlite3ext.h"
    60     60   
    61     61   /* 
    62     62   ** These should be defined to be the same as the values in 
    63         -** sqliteInt.h.  They are defined seperately here so that
           63  +** sqliteInt.h.  They are defined separately here so that
    64     64   ** the multiplex VFS shim can be built as a loadable 
    65     65   ** module.
    66     66   */
    67     67   #define UNUSED_PARAMETER(x) (void)(x)
    68     68   #define MAX_PAGE_SIZE       0x10000
    69     69   #define DEFAULT_SECTOR_SIZE 0x1000
    70     70   

Changes to src/test_sqllog.c.

    28     28   **
    29     29   **   At runtime, logging is enabled by setting environment variable
    30     30   **   SQLITE_SQLLOG_DIR to the name of a directory in which to store logged 
    31     31   **   data. The directory must already exist.
    32     32   **
    33     33   **   Usually, if the application opens the same database file more than once
    34     34   **   (either by attaching it or by using more than one database handle), only
    35         -**   a single copy is made. This behaviour may be overridden (so that a 
           35  +**   a single copy is made. This behavior may be overridden (so that a 
    36     36   **   separate copy is taken each time the database file is opened or attached)
    37     37   **   by setting the environment variable SQLITE_SQLLOG_REUSE_FILES to 0.
    38     38   **
    39     39   ** OUTPUT:
    40     40   **
    41     41   **   The SQLITE_SQLLOG_DIR is populated with three types of files:
    42     42   **

Changes to src/update.c.

   454    454       sqlite3VdbeAddOp2(v, OP_Affinity, regNew, pTab->nCol);
   455    455       sqlite3TableAffinityStr(v, pTab);
   456    456       sqlite3CodeRowTrigger(pParse, pTrigger, TK_UPDATE, pChanges, 
   457    457           TRIGGER_BEFORE, pTab, regOldRowid, onError, addr);
   458    458   
   459    459       /* The row-trigger may have deleted the row being updated. In this
   460    460       ** case, jump to the next row. No updates or AFTER triggers are 
   461         -    ** required. This behaviour - what happens when the row being updated
          461  +    ** required. This behavior - what happens when the row being updated
   462    462       ** is deleted or renamed by a BEFORE trigger - is left undefined in the
   463    463       ** documentation.
   464    464       */
   465    465       sqlite3VdbeAddOp3(v, OP_NotExists, iCur, addr, regOldRowid);
   466    466   
   467    467       /* If it did not delete it, the row-trigger may still have modified 
   468    468       ** some of the columns of the row being updated. Load the values for 

Changes to src/vdbe.c.

  5780   5780     assert(pVtab && pModule);
  5781   5781     rc = pModule->xOpen(pVtab, &pVtabCursor);
  5782   5782     importVtabErrMsg(p, pVtab);
  5783   5783     if( SQLITE_OK==rc ){
  5784   5784       /* Initialize sqlite3_vtab_cursor base class */
  5785   5785       pVtabCursor->pVtab = pVtab;
  5786   5786   
  5787         -    /* Initialise vdbe cursor object */
         5787  +    /* Initialize vdbe cursor object */
  5788   5788       pCur = allocateCursor(p, pOp->p1, 0, -1, 0);
  5789   5789       if( pCur ){
  5790   5790         pCur->pVtabCursor = pVtabCursor;
  5791   5791         pCur->pModule = pVtabCursor->pVtab->pModule;
  5792   5792       }else{
  5793   5793         db->mallocFailed = 1;
  5794   5794         pModule->xClose(pVtabCursor);

Changes to src/vdbeapi.c.

   441    441     */
   442    442     assert( rc==SQLITE_ROW  || rc==SQLITE_DONE   || rc==SQLITE_ERROR 
   443    443          || rc==SQLITE_BUSY || rc==SQLITE_MISUSE
   444    444     );
   445    445     assert( p->rc!=SQLITE_ROW && p->rc!=SQLITE_DONE );
   446    446     if( p->isPrepareV2 && rc!=SQLITE_ROW && rc!=SQLITE_DONE ){
   447    447       /* If this statement was prepared using sqlite3_prepare_v2(), and an
   448         -    ** error has occured, then return the error code in p->rc to the
          448  +    ** error has occurred, then return the error code in p->rc to the
   449    449       ** caller. Set the error code in the database handle to the same value.
   450    450       */ 
   451    451       rc = sqlite3VdbeTransferError(p);
   452    452     }
   453    453     return (rc&db->errMask);
   454    454   }
   455    455   

Changes to src/vdbeaux.c.

   371    371       ){
   372    372         hasAbort = 1;
   373    373         break;
   374    374       }
   375    375     }
   376    376     sqlite3DbFree(v->db, sIter.apSub);
   377    377   
   378         -  /* Return true if hasAbort==mayAbort. Or if a malloc failure occured.
          378  +  /* Return true if hasAbort==mayAbort. Or if a malloc failure occurred.
   379    379     ** If malloc failed, then the while() loop above may not have iterated
   380    380     ** through all opcodes and hasAbort may be set incorrectly. Return
   381    381     ** true for this case to prevent the assert() in the callers frame
   382    382     ** from failing.  */
   383    383     return ( v->db->mallocFailed || hasAbort==mayAbort );
   384    384   }
   385    385   #endif /* SQLITE_DEBUG - the sqlite3AssertMayAbort() function */
................................................................................
  2003   2003   */
  2004   2004   int sqlite3VdbeCloseStatement(Vdbe *p, int eOp){
  2005   2005     sqlite3 *const db = p->db;
  2006   2006     int rc = SQLITE_OK;
  2007   2007   
  2008   2008     /* If p->iStatement is greater than zero, then this Vdbe opened a 
  2009   2009     ** statement transaction that should be closed here. The only exception
  2010         -  ** is that an IO error may have occured, causing an emergency rollback.
         2010  +  ** is that an IO error may have occurred, causing an emergency rollback.
  2011   2011     ** In this case (db->nStatement==0), and there is nothing to do.
  2012   2012     */
  2013   2013     if( db->nStatement && p->iStatement ){
  2014   2014       int i;
  2015   2015       const int iSavepoint = p->iStatement-1;
  2016   2016   
  2017   2017       assert( eOp==SAVEPOINT_ROLLBACK || eOp==SAVEPOINT_RELEASE);
................................................................................
  2139   2139         /* If the query was read-only and the error code is SQLITE_INTERRUPT, 
  2140   2140         ** no rollback is necessary. Otherwise, at least a savepoint 
  2141   2141         ** transaction must be rolled back to restore the database to a 
  2142   2142         ** consistent state.
  2143   2143         **
  2144   2144         ** Even if the statement is read-only, it is important to perform
  2145   2145         ** a statement or transaction rollback operation. If the error 
  2146         -      ** occured while writing to the journal, sub-journal or database
         2146  +      ** occurred while writing to the journal, sub-journal or database
  2147   2147         ** file as part of an effort to free up cache space (see function
  2148   2148         ** pagerStress() in pager.c), the rollback is required to restore 
  2149   2149         ** the pager to a consistent state.
  2150   2150         */
  2151   2151         if( !p->readOnly || mrc!=SQLITE_INTERRUPT ){
  2152   2152           if( (mrc==SQLITE_NOMEM || mrc==SQLITE_FULL) && p->usesStmtJournal ){
  2153   2153             eStatementOp = SAVEPOINT_ROLLBACK;
................................................................................
  2553   2553   ** 'serial-type' and a blob of data. The serial type is an 8-byte unsigned
  2554   2554   ** integer, stored as a varint.
  2555   2555   **
  2556   2556   ** In an SQLite index record, the serial type is stored directly before
  2557   2557   ** the blob of data that it corresponds to. In a table record, all serial
  2558   2558   ** types are stored at the start of the record, and the blobs of data at
  2559   2559   ** the end. Hence these functions allow the caller to handle the
  2560         -** serial-type and data blob seperately.
         2560  +** serial-type and data blob separately.
  2561   2561   **
  2562   2562   ** The following table describes the various storage classes for data:
  2563   2563   **
  2564   2564   **   serial type        bytes of data      type
  2565   2565   **   --------------     ---------------    ---------------
  2566   2566   **      0                     0            NULL
  2567   2567   **      1                     1            signed integer

Changes to src/where.c.

   558    558   */
   559    559   #define SWAP(TYPE,A,B) {TYPE t=A; A=B; B=t;}
   560    560   
   561    561   /*
   562    562   ** Commute a comparison operator.  Expressions of the form "X op Y"
   563    563   ** are converted into "Y op X".
   564    564   **
   565         -** If left/right precendence rules come into play when determining the
          565  +** If left/right precedence rules come into play when determining the
   566    566   ** collating
   567    567   ** side of the comparison, it remains associated with the same side after
   568    568   ** the commutation. So "Y collate NOCASE op X" becomes 
   569    569   ** "X op Y". This is because any collation sequence on
   570    570   ** the left hand side of a comparison overrides any collation sequence 
   571    571   ** attached to the right. For the same reason the EP_Collate flag
   572    572   ** is not commuted.
................................................................................
  3624   3624       wsFlagMask = ~(WHERE_ROWID_EQ|WHERE_ROWID_RANGE);
  3625   3625       eqTermMask = idxEqTermMask;
  3626   3626     }
  3627   3627   
  3628   3628     /* If there is no ORDER BY clause and the SQLITE_ReverseOrder flag
  3629   3629     ** is set, then reverse the order that the index will be scanned
  3630   3630     ** in. This is used for application testing, to help find cases
  3631         -  ** where application behaviour depends on the (undefined) order that
         3631  +  ** where application behavior depends on the (undefined) order that
  3632   3632     ** SQLite outputs rows in in the absence of an ORDER BY clause.  */
  3633   3633     if( !p->pOrderBy && pParse->db->flags & SQLITE_ReverseOrder ){
  3634   3634       p->cost.plan.wsFlags |= WHERE_REVERSE;
  3635   3635     }
  3636   3636   
  3637   3637     assert( p->pOrderBy || (p->cost.plan.wsFlags&WHERE_ORDERED)==0 );
  3638   3638     assert( p->cost.plan.u.pIdx==0 || (p->cost.plan.wsFlags&WHERE_ROWID_EQ)==0 );

Changes to test/backup_ioerr.test.

   111    111   #        from the next call to backup_step() (in step 5 of this test
   112    112   #        procedure).
   113    113   #
   114    114   #   5) Step the backup process to finish the backup. If an IO error is 
   115    115   #      reported, then the backup process is concluded with a call to 
   116    116   #      backup_finish().
   117    117   #
   118         -#      Test that if an IO error occurs, or if one occured while updating
          118  +#      Test that if an IO error occurs, or if one occurred while updating
   119    119   #      the backup database during step 4, then the conditions listed
   120    120   #      under step 3 are all true.
   121    121   #
   122    122   #   6) Finish the backup process.
   123    123   #
   124    124   #   * If the backup succeeds (backup_finish() returns SQLITE_OK), then
   125    125   #     the contents of the backup database should match that of the
................................................................................
   210    210       expr {$rc eq "SQLITE_OK"}
   211    211     } {1}
   212    212   
   213    213     # Step 4: Write to the source database.
   214    214     set rc [catchsql { UPDATE t1 SET b = randstr(1000,1000) WHERE a < 50 } sdb]
   215    215   
   216    216     if {[lindex $rc 0] && $::sqlite_io_error_persist==0} {
   217         -    # The IO error occured while updating the source database. In this
          217  +    # The IO error occurred while updating the source database. In this
   218    218       # case the backup should be able to continue.
   219    219       set rc [B step 5000]
   220    220       if { $rc != "SQLITE_IOERR_UNLOCK" } {
   221    221         do_test backup_ioerr-$iTest.$iError.7 {
   222    222           list [B step 5000] [B finish]
   223    223         } {SQLITE_DONE SQLITE_OK}
   224    224   

Changes to test/cache.test.

    42     42   } {2}
    43     43   
    44     44   # At one point, repeatedly locking and unlocking the cache was causing
    45     45   # a resource leak of one page per repetition. The page wasn't actually
    46     46   # leaked, but would not be reused until the pager-cache was full (i.e. 
    47     47   # 2000 pages by default).
    48     48   #
    49         -# This tests that once the pager-cache is initialised, it can be locked
           49  +# This tests that once the pager-cache is initialized, it can be locked
    50     50   # and unlocked repeatedly without internally allocating any new pages.
    51     51   #
    52     52   set cache_size [pager_cache_size db]
    53     53   for {set ii 0} {$ii < 10} {incr ii} {
    54     54     do_test cache-1.3.$ii {
    55     55       execsql {SELECT * FROM abc}
    56     56       pager_cache_size db

Changes to test/collate4.test.

    56     56   #
    57     57   # These tests - collate4-1.* - check that indices are correctly
    58     58   # selected or not selected to implement ORDER BY clauses when 
    59     59   # user defined collation sequences are involved. 
    60     60   #
    61     61   # Because these tests also exercise all the different ways indices 
    62     62   # can be created, they also serve to verify that indices are correctly 
    63         -# initialised with user-defined collation sequences when they are
           63  +# initialized with user-defined collation sequences when they are
    64     64   # created.
    65     65   #
    66     66   # Tests named collate4-1.1.* use indices with a single column. Tests
    67     67   # collate4-1.2.* use indices with two columns.
    68     68   #
    69     69   do_test collate4-1.1.0 {
    70     70     execsql {

Changes to test/crash5.test.

    61     61           #
    62     62           db eval BEGIN
    63     63           sqlite3_memdebug_fail $iFail -repeat 0
    64     64           catch {db eval { CREATE UNIQUE INDEX i1 ON t1(a); }} msg
    65     65           # puts "$n $msg ac=[sqlite3_get_autocommit db]"
    66     66         
    67     67           # If the transaction is still active (it may not be if the malloc()
    68         -        # failure occured in the OS layer), write to the database. Make sure
           68  +        # failure occurred in the OS layer), write to the database. Make sure
    69     69           # page 4 is among those written.
    70     70           #
    71     71           if {![sqlite3_get_autocommit db]} {
    72     72             db eval {
    73     73               DELETE FROM t1;  -- This will put page 4 on the free list.
    74     74               INSERT INTO t1 VALUES('111111111', '2222222222', '33333333');
    75     75               INSERT INTO t1 SELECT * FROM t1;                     -- 2

Changes to test/e_createtable.test.

  1253   1253     14   "INSERT INTO t2 VALUES(NULL, NULL)"           {}
  1254   1254   }
  1255   1255   
  1256   1256   # EVIDENCE-OF: R-61866-38053 Unless the column is an INTEGER PRIMARY KEY
  1257   1257   # SQLite allows NULL values in a PRIMARY KEY column.
  1258   1258   #
  1259   1259   #     If the column is an integer primary key, attempting to insert a NULL
  1260         -#     into the column triggers the auto-increment behaviour. Attempting
         1260  +#     into the column triggers the auto-increment behavior. Attempting
  1261   1261   #     to use UPDATE to set an ipk column to a NULL value is an error.
  1262   1262   #
  1263   1263   do_createtable_tests 4.5.1 {
  1264   1264     1    "SELECT count(*) FROM t1 WHERE x IS NULL"                   3
  1265   1265     2    "SELECT count(*) FROM t2 WHERE x IS NULL"                   6
  1266   1266     3    "SELECT count(*) FROM t2 WHERE y IS NULL"                   7
  1267   1267     4    "SELECT count(*) FROM t2 WHERE x IS NULL AND y IS NULL"     2

Changes to test/e_fkey.test.

  2737   2737   } {1 {foreign key mismatch - "c2" referencing "p"}}
  2738   2738   do_test e_fkey-60.6 {
  2739   2739     execsql { DROP TABLE c2 }
  2740   2740     execsql { DELETE FROM p }
  2741   2741   } {}
  2742   2742   
  2743   2743   #-------------------------------------------------------------------------
  2744         -# Test that the special behaviours of ALTER and DROP TABLE are only
  2745         -# activated when foreign keys are enabled. Special behaviours are:
         2744  +# Test that the special behaviors of ALTER and DROP TABLE are only
         2745  +# activated when foreign keys are enabled. Special behaviors are:
  2746   2746   #
  2747   2747   #   1. ADD COLUMN not allowing a REFERENCES clause with a non-NULL 
  2748   2748   #      default value.
  2749   2749   #   2. Modifying foreign key definitions when a parent table is RENAMEd.
  2750   2750   #   3. Running an implicit DELETE FROM command as part of DROP TABLE.
  2751   2751   #
  2752   2752   # EVIDENCE-OF: R-54142-41346 The properties of the DROP TABLE and ALTER
................................................................................
  2833   2833         CREATE TABLE p(a, b, c, PRIMARY KEY(b, c));
  2834   2834         CREATE TABLE c(d, e, f, FOREIGN KEY(e, f) REFERENCES p MATCH $zMatch);
  2835   2835       "
  2836   2836     } {}
  2837   2837     do_test e_fkey-62.$zMatch.2 {
  2838   2838       execsql { INSERT INTO p VALUES(1, 2, 3)         }
  2839   2839   
  2840         -    # MATCH SIMPLE behaviour: Allow any child key that contains one or more
         2840  +    # MATCH SIMPLE behavior: Allow any child key that contains one or more
  2841   2841       # NULL value to be inserted. Non-NULL values do not have to map to any
  2842   2842       # parent key values, so long as at least one field of the child key is
  2843   2843       # NULL.
  2844   2844       execsql { INSERT INTO c VALUES('w', 2, 3)       }
  2845   2845       execsql { INSERT INTO c VALUES('x', 'x', NULL)  }
  2846   2846       execsql { INSERT INTO c VALUES('y', NULL, 'x')  }
  2847   2847       execsql { INSERT INTO c VALUES('z', NULL, NULL) }

Changes to test/e_select.test.

  1223   1223     2   "SELECT DISTINCT a FROM h1" {1 4}
  1224   1224   }
  1225   1225   
  1226   1226   # EVIDENCE-OF: R-08861-34280 If the simple SELECT is a SELECT ALL, then
  1227   1227   # the entire set of result rows are returned by the SELECT.
  1228   1228   #
  1229   1229   # EVIDENCE-OF: R-47911-02086 If neither ALL or DISTINCT are present,
  1230         -# then the behaviour is as if ALL were specified.
         1230  +# then the behavior is as if ALL were specified.
  1231   1231   #
  1232   1232   # EVIDENCE-OF: R-14442-41305 If the simple SELECT is a SELECT DISTINCT,
  1233   1233   # then duplicate rows are removed from the set of result rows before it
  1234   1234   # is returned.
  1235   1235   #
  1236   1236   #   The three testable statements above are tested by e_select-5.2.*,
  1237   1237   #   5.3.* and 5.4.* respectively.

Changes to test/e_uri.test.

   357    357   # to sqlite3_open_v2().
   358    358   #
   359    359   # EVIDENCE-OF: R-49793-28525 Setting the cache parameter to "private" is
   360    360   # equivalent to setting the SQLITE_OPEN_PRIVATECACHE bit.
   361    361   #
   362    362   # EVIDENCE-OF: R-19510-48080 If sqlite3_open_v2() is used and the
   363    363   # "cache" parameter is present in a URI filename, its value overrides
   364         -# any behaviour requested by setting SQLITE_OPEN_PRIVATECACHE or
          364  +# any behavior requested by setting SQLITE_OPEN_PRIVATECACHE or
   365    365   # SQLITE_OPEN_SHAREDCACHE flag.
   366    366   #
   367    367   set orig [sqlite3_enable_shared_cache]
   368    368   foreach {tn uri flags shared_default isshared} {
   369    369     1.1   "file:test.db"                  ""         0    0
   370    370     1.2   "file:test.db"                  ""         1    1
   371    371     1.3   "file:test.db"                  private    0    0

Changes to test/enc2.test.

    28     28   # The rough organisation of tests in this file is:
    29     29   #
    30     30   # enc2.1.*: Simple tests with a UTF-8 db.
    31     31   # enc2.2.*: Simple tests with a UTF-16LE db.
    32     32   # enc2.3.*: Simple tests with a UTF-16BE db.
    33     33   # enc2.4.*: Test that attached databases must have the same text encoding
    34     34   #           as the main database.
    35         -# enc2.5.*: Test the behaviour of the library when a collation sequence is
           35  +# enc2.5.*: Test the behavior of the library when a collation sequence is
    36     36   #           not available for the most desirable text encoding.
    37     37   # enc2.6.*: Similar test for user functions.
    38     38   # enc2.7.*: Test that the VerifyCookie opcode protects against assuming the
    39     39   #           wrong text encoding for the database.
    40     40   # enc2.8.*: Test sqlite3_complete16()
    41     41   #
    42     42   

Changes to test/incrblob.test.

   501    501       }
   502    502     } {a different invocation}
   503    503     db2 close
   504    504   }
   505    505   sqlite3_soft_heap_limit $cmdlinearg(soft-heap-limit)
   506    506   
   507    507   #-----------------------------------------------------------------------
   508         -# The following tests verify the behaviour of the incremental IO
          508  +# The following tests verify the behavior of the incremental IO
   509    509   # APIs in the following cases:
   510    510   #
   511    511   #     7.1 A row that containing an open blob is modified.
   512    512   #
   513    513   #     7.2 A CREATE TABLE requires that an overflow page that is part
   514    514   #         of an open blob is moved.
   515    515   #
   516    516   #     7.3 An INCREMENTAL VACUUM moves an overflow page that is part
   517    517   #         of an open blob.
   518    518   #
   519         -# In the first case above, correct behaviour is for all subsequent
          519  +# In the first case above, correct behavior is for all subsequent
   520    520   # read/write operations on the blob-handle to return SQLITE_ABORT.
   521    521   # More accurately, blob-handles are invalidated whenever the table
   522    522   # they belong to is written to.
   523    523   #
   524    524   # The second two cases have no external effect. They are testing
   525    525   # that the internal cache of overflow page numbers is correctly
   526    526   # invalidated.

Changes to test/io.test.

   203    203   # Internally, this case is handled differently to the one above. The
   204    204   # journal file is not actually created until the 'COMMIT' statement
   205    205   # is executed.
   206    206   #
   207    207   # Changed 2010-03-27:  The size of the database is now stored in 
   208    208   # bytes 28..31 and so when a page is added to the database, page 1
   209    209   # is immediately modified and the journal file immediately comes into
   210         -# existance.  To fix this test, the BEGIN is changed into a a
          210  +# existence.  To fix this test, the BEGIN is changed into a a
   211    211   # BEGIN IMMEDIATE and the INSERT is omitted.
   212    212   #
   213    213   do_test io-2.6.1 {
   214    214     execsql {
   215    215       BEGIN IMMEDIATE;
   216    216       -- INSERT INTO abc VALUES(9, randstr(1000,1000));
   217    217     }

Changes to test/malloc.test.

   838    838     CREATE TABLE t1(a, b);
   839    839     INSERT INTO t1 VALUES(1, 2);
   840    840     INSERT INTO t1 VALUES(3, 4);
   841    841   } -sqlbody {
   842    842     SELECT test_agg_errmsg16(), group_concat(a) FROM t1
   843    843   }
   844    844   
   845         -# At one point, if an OOM occured immediately after obtaining a shared lock
          845  +# At one point, if an OOM occurred immediately after obtaining a shared lock
   846    846   # on the database file, the file remained locked. This test case ensures
   847    847   # that bug has been fixed.i
   848    848   if {[db eval {PRAGMA locking_mode}]!="exclusive"} {
   849    849     do_malloc_test 37 -tclprep {
   850    850       sqlite3 db2 test.db
   851    851       execsql {
   852    852         CREATE TABLE t1(a, b);

Changes to test/malloc3.test.

   591    591           set ac [sqlite3_get_autocommit $::DB]        ;# Auto-Commit
   592    592           sqlite3_memdebug_fail $iFail -repeat 0
   593    593           set rc [catch {db eval [lindex $v 2]} msg]   ;# True error occurs
   594    594           set nac [sqlite3_get_autocommit $::DB]       ;# New Auto-Commit 
   595    595   
   596    596           if {$rc != 0 && $nac && !$ac} {
   597    597             # Before [db eval] the auto-commit flag was clear. Now it
   598         -          # is set. Since an error occured we assume this was not a
   599         -          # commit - therefore a rollback occured. Check that the
          598  +          # is set. Since an error occurred we assume this was not a
          599  +          # commit - therefore a rollback occurred. Check that the
   600    600             # rollback-hook was invoked.
   601    601             do_test malloc3-rollback_hook_count.$iterid {
   602    602               set ::rollback_hook_count
   603    603             } {1}
   604    604           }
   605    605   
   606    606           set nFail [sqlite3_memdebug_fail -1 -benigncnt nBenign]

Changes to test/notify2.test.

   146    146           sqlite3_close $::DB
   147    147           opendb
   148    148         } 
   149    149       } elseif {$rc} {
   150    150         # Hit some other kind of error. This is a malfunction.
   151    151         error $msg
   152    152       } else {
   153         -      # No error occured. Check that any SELECT statements in the transaction
          153  +      # No error occurred. Check that any SELECT statements in the transaction
   154    154         # returned "1". Otherwise, the invariant was false, indicating that
   155         -      # some malfunction has occured.
          155  +      # some malfunction has occurred.
   156    156         foreach r $msg { if {$r != 1} { puts "Invariant check failed: $msg" } }
   157    157       }
   158    158     }
   159    159   
   160    160     # Close the database connection and return 0.
   161    161     #
   162    162     sqlite3_close $::DB

Changes to test/subquery.test.

   417    417   
   418    418   
   419    419   #------------------------------------------------------------------
   420    420   # These tests - subquery-4.* - use the TCL statement cache to try 
   421    421   # and expose bugs to do with re-using statements that have been 
   422    422   # passed to sqlite3_reset().
   423    423   #
   424         -# One problem was that VDBE memory cells were not being initialised
          424  +# One problem was that VDBE memory cells were not being initialized
   425    425   # to NULL on the second and subsequent executions.
   426    426   #
   427    427   do_test subquery-4.1.1 {
   428    428     execsql {
   429    429       SELECT (SELECT a FROM t1);
   430    430     }
   431    431   } {1}

Changes to test/temptable.test.

   146    146     }
   147    147     catchsql {DROP INDEX i2}
   148    148   } {1 {no such index: i2}}
   149    149   
   150    150   # Check for correct name collision processing. A name collision can
   151    151   # occur when process A creates a temporary table T then process B
   152    152   # creates a permanent table also named T.  The temp table in process A
   153         -# hides the existance of the permanent table.
          153  +# hides the existence of the permanent table.
   154    154   #
   155    155   do_test temptable-4.1 {
   156    156     execsql {
   157    157       CREATE TEMP TABLE t2(x,y);
   158    158       INSERT INTO t2 VALUES(10,20);
   159    159       SELECT * FROM t2;
   160    160     } db2

Changes to test/tester.tcl.

   119    119         if {[info exists ::G(perm:dbconfig)]} {
   120    120           set ::dbhandle [lindex $args 0]
   121    121           uplevel #0 $::G(perm:dbconfig)
   122    122         }
   123    123         set res
   124    124       } else {
   125    125         # This command is not opening a new database connection. Pass the 
   126         -      # arguments through to the C implemenation as the are.
          126  +      # arguments through to the C implementation as the are.
   127    127         #
   128    128         uplevel 1 sqlite_orig $args
   129    129       }
   130    130     }
   131    131   }
   132    132   
   133    133   proc getFileRetries {} {
................................................................................
  1033   1033   # written into the files on disk. Argument $crashdelay indicates the
  1034   1034   # number of file syncs to wait before crashing.
  1035   1035   #
  1036   1036   # The return value is a list of two elements. The first element is a
  1037   1037   # boolean, indicating whether or not the process actually crashed or
  1038   1038   # reported some other error. The second element in the returned list is the
  1039   1039   # error message. This is "child process exited abnormally" if the crash
  1040         -# occured.
         1040  +# occurred.
  1041   1041   #
  1042   1042   #   crashsql -delay CRASHDELAY -file CRASHFILE ?-blocksize BLOCKSIZE? $sql
  1043   1043   #
  1044   1044   proc crashsql {args} {
  1045   1045   
  1046   1046     set blocksize ""
  1047   1047     set crashdelay 1
................................................................................
  1313   1313             array set stats [btree_pager_stats $bt]
  1314   1314             db_leave db
  1315   1315             set stats(state)
  1316   1316           } 0
  1317   1317         }
  1318   1318       }
  1319   1319   
  1320         -    # If an IO error occured, then the checksum of the database should
         1320  +    # If an IO error occurred, then the checksum of the database should
  1321   1321       # be the same as before the script that caused the IO error was run.
  1322   1322       #
  1323   1323       if {$::go && $::sqlite_io_error_hardhit && $::ioerropts(-cksum)} {
  1324   1324         do_test $testname.$n.6 {
  1325   1325           catch {db close}
  1326   1326           catch {db2 close}
  1327   1327           set ::DB [sqlite3 db test.db; sqlite3_connection_pointer db]

Changes to test/tkt2409.test.

   103    103   } {SQLITE_OK}
   104    104   
   105    105   # Check the integrity of the cache.
   106    106   #
   107    107   integrity_check tkt2409-1.3
   108    108   
   109    109   # Check that the transaction was rolled back. Because the INSERT
   110         -# statement in which the "I/O error" occured did not open a statement
          110  +# statement in which the "I/O error" occurred did not open a statement
   111    111   # transaction, SQLite had no choice but to roll back the transaction.
   112    112   #
   113    113   do_test tkt2409-1.4 {
   114    114     unread_lock_db
   115    115     catchsql { ROLLBACK }
   116    116   } {0 {}}
   117    117   
................................................................................
   171    171   } {SQLITE_OK}
   172    172   
   173    173   # Check the integrity of the cache.
   174    174   #
   175    175   integrity_check tkt2409-3.3
   176    176   
   177    177   # Check that the transaction was rolled back. Because the INSERT
   178         -# statement in which the "I/O error" occured did not open a statement
          178  +# statement in which the "I/O error" occurred did not open a statement
   179    179   # transaction, SQLite had no choice but to roll back the transaction.
   180    180   #
   181    181   do_test tkt2409-3.4 {
   182    182     unread_lock_db
   183    183     catchsql { ROLLBACK }
   184    184   } {0 {}}
   185    185   integrity_check tkt2409-3.5