/ Check-in [9389a15f]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Remove the ARRAYSIZE macro from where.c to avoid a name conflict with microsoft header files. Ticket #2311 (CVS 3863)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9389a15f35f854c88440e365d85b48af3ff76b00
User & Date: drh 2007-04-20 12:22:02
Context
2007-04-21
16:37
Add the ability to turn the FTS2 module into an amalgamation. (CVS 3864) check-in: 94374654 user: drh tags: trunk
2007-04-20
12:22
Remove the ARRAYSIZE macro from where.c to avoid a name conflict with microsoft header files. Ticket #2311 (CVS 3863) check-in: 9389a15f user: drh tags: trunk
2007-04-19
18:36
Fix bug in fts2 handling of OR queries. When one doclist ends before the other, the code potentially tries to read past the end of the doclist. http://www.sqlite.org/cvstrac/tktview?tn=2309 (CVS 3862) check-in: dfac6082 user: shess tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

    12     12   ** This module contains C code that generates VDBE code used to process
    13     13   ** the WHERE clause of SQL statements.  This module is reponsible for
    14     14   ** generating the code that loops through a table looking for applicable
    15     15   ** rows.  Indices are selected and used to speed the search when doing
    16     16   ** so is applicable.  Because this module is responsible for selecting
    17     17   ** indices, you might also think of this module as the "query optimizer".
    18     18   **
    19         -** $Id: where.c,v 1.246 2007/04/06 01:04:40 drh Exp $
           19  +** $Id: where.c,v 1.247 2007/04/20 12:22:02 drh Exp $
    20     20   */
    21     21   #include "sqliteInt.h"
    22     22   
    23     23   /*
    24     24   ** The number of bits in a Bitmask.  "BMS" means "BitMask Size".
    25     25   */
    26     26   #define BMS  (sizeof(Bitmask)*8)
    27     27   
    28         -/*
    29         -** Determine the number of elements in an array.
    30         -*/
    31         -#define ARRAYSIZE(X)  (sizeof(X)/sizeof(X[0]))
    32         -
    33     28   /*
    34     29   ** Trace output macros
    35     30   */
    36     31   #if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
    37     32   int sqlite3_where_trace = 0;
    38     33   # define WHERETRACE(X)  if(sqlite3_where_trace) sqlite3DebugPrintf X
    39     34   #else
................................................................................
   191    186     WhereClause *pWC,        /* The WhereClause to be initialized */
   192    187     Parse *pParse,           /* The parsing context */
   193    188     ExprMaskSet *pMaskSet    /* Mapping from table indices to bitmasks */
   194    189   ){
   195    190     pWC->pParse = pParse;
   196    191     pWC->pMaskSet = pMaskSet;
   197    192     pWC->nTerm = 0;
   198         -  pWC->nSlot = ARRAYSIZE(pWC->aStatic);
          193  +  pWC->nSlot = ArraySize(pWC->aStatic);
   199    194     pWC->a = pWC->aStatic;
   200    195   }
   201    196   
   202    197   /*
   203    198   ** Deallocate a WhereClause structure.  The WhereClause structure
   204    199   ** itself is not freed.  This routine is the inverse of whereClauseInit().
   205    200   */
................................................................................
   306    301   **
   307    302   ** There is one cursor per table in the FROM clause.  The number of
   308    303   ** tables in the FROM clause is limited by a test early in the
   309    304   ** sqlite3WhereBegin() routine.  So we know that the pMaskSet->ix[]
   310    305   ** array will never overflow.
   311    306   */
   312    307   static void createMask(ExprMaskSet *pMaskSet, int iCursor){
   313         -  assert( pMaskSet->n < ARRAYSIZE(pMaskSet->ix) );
          308  +  assert( pMaskSet->n < ArraySize(pMaskSet->ix) );
   314    309     pMaskSet->ix[pMaskSet->n++] = iCursor;
   315    310   }
   316    311   
   317    312   /*
   318    313   ** This routine walks (recursively) an expression tree and generates
   319    314   ** a bitmask indicating which tables are used in that expression
   320    315   ** tree.