/ Check-in [5f6eab65]
Login

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

Overview
Comment:Fix cosmetic issues spotted while working on ticket #3146 (CVS 5177)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5f6eab65dba421a736659a6673a51a0e487d68ac
User & Date: drh 2008-05-29 05:23:42
Context
2008-05-29
20:22
Consolidated inline assembly versions of "hwtime()" into hwtime.h. Provided MSVC version. Modified code for consistent use of hwtime(). Changed implementation to use sqlite_uint64 and sqlite_int64 instead of unsigned long long int and long long int for MSVC compiler support. (CVS 5178) check-in: 9883b406 user: shane tags: trunk
05:23
Fix cosmetic issues spotted while working on ticket #3146 (CVS 5177) check-in: 5f6eab65 user: drh tags: trunk
03:54
Moved check and define for OS_WINCE from os_win.c to os.h (with the other OS_* defines). This allows OS_WINCE to be available for mutex_w32.c which is included earlier than os_win.c in the almagamation. (CVS 5176) check-in: ad6a782e user: shane tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test_tclvar.c.

    12     12   ** Code for testing the virtual table interfaces.  This code
    13     13   ** is not included in the SQLite library.  It is used for automated
    14     14   ** testing of the SQLite library.
    15     15   **
    16     16   ** The emphasis of this file is a virtual table that provides
    17     17   ** access to TCL variables.
    18     18   **
    19         -** $Id: test_tclvar.c,v 1.14 2007/08/21 10:44:16 drh Exp $
           19  +** $Id: test_tclvar.c,v 1.15 2008/05/29 05:23:42 drh Exp $
    20     20   */
    21     21   #include "sqliteInt.h"
    22     22   #include "tcl.h"
    23     23   #include <stdlib.h>
    24     24   #include <string.h>
    25     25   
    26     26   #ifndef SQLITE_OMIT_VIRTUALTABLE
................................................................................
   218    218   }
   219    219   
   220    220   static int tclvarBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
   221    221     int ii;
   222    222   
   223    223     for(ii=0; ii<pIdxInfo->nConstraint; ii++){
   224    224       struct sqlite3_index_constraint const *pCons = &pIdxInfo->aConstraint[ii];
   225         -    if( pCons->iColumn==0 && pCons->op==SQLITE_INDEX_CONSTRAINT_EQ ){
          225  +    if( pCons->iColumn==0 && pCons->usable
          226  +           && pCons->op==SQLITE_INDEX_CONSTRAINT_EQ ){
   226    227         struct sqlite3_index_constraint_usage *pUsage;
   227    228         pUsage = &pIdxInfo->aConstraintUsage[ii];
   228    229         pUsage->omit = 0;
   229    230         pUsage->argvIndex = 1;
   230    231         return SQLITE_OK;
   231    232       }
   232    233     }
   233    234   
   234    235     for(ii=0; ii<pIdxInfo->nConstraint; ii++){
   235    236       struct sqlite3_index_constraint const *pCons = &pIdxInfo->aConstraint[ii];
   236         -    if( pCons->iColumn==0 && pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH ){
          237  +    if( pCons->iColumn==0 && pCons->usable
          238  +           && pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH ){
   237    239         struct sqlite3_index_constraint_usage *pUsage;
   238    240         pUsage = &pIdxInfo->aConstraintUsage[ii];
   239    241         pUsage->omit = 1;
   240    242         pUsage->argvIndex = 1;
   241    243         return SQLITE_OK;
   242    244       }
   243    245     }

Changes to src/vdbe.c.

    39     39   **
    40     40   ** Various scripts scan this source file in order to generate HTML
    41     41   ** documentation, headers files, or other derived files.  The formatting
    42     42   ** of the code in this file is, therefore, important.  See other comments
    43     43   ** in this file for details.  If in doubt, do not deviate from existing
    44     44   ** commenting and indentation practices when changing or adding code.
    45     45   **
    46         -** $Id: vdbe.c,v 1.742 2008/05/29 03:12:55 drh Exp $
           46  +** $Id: vdbe.c,v 1.743 2008/05/29 05:23:42 drh Exp $
    47     47   */
    48     48   #include "sqliteInt.h"
    49     49   #include <ctype.h>
    50     50   #include "vdbeInt.h"
    51     51   
    52     52   /*
    53     53   ** The following global variable is incremented every time a cursor
................................................................................
  4547   4547   ** P4 is either NULL or a string that was generated by the xBestIndex
  4548   4548   ** method of the module.  The interpretation of the P4 string is left
  4549   4549   ** to the module implementation.
  4550   4550   **
  4551   4551   ** This opcode invokes the xFilter method on the virtual table specified
  4552   4552   ** by P1.  The integer query plan parameter to xFilter is stored in register
  4553   4553   ** P3. Register P3+1 stores the argc parameter to be passed to the
  4554         -** xFilter method. Registers P3+2..P3+1+argc are the argc additional
  4555         -** parametersneath additional parameters which are passed to
         4554  +** xFilter method. Registers P3+2..P3+1+argc are the argc
         4555  +** additional parameters which are passed to
  4556   4556   ** xFilter as argv. Register P3+2 becomes argv[0] when passed to xFilter.
  4557   4557   **
  4558   4558   ** A jump is made to P2 if the result set after filtering would be empty.
  4559   4559   */
  4560   4560   case OP_VFilter: {   /* jump */
  4561   4561     int nArg;
  4562   4562     int iQuery;

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.305 2008/05/28 18:01:45 shane Exp $
           19  +** $Id: where.c,v 1.306 2008/05/29 05:23:42 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)
................................................................................
  2359   2359         iReg = sqlite3GetTempRange(pParse, nConstraint+2);
  2360   2360         pParse->disableColCache++;
  2361   2361         for(j=1; j<=nConstraint; j++){
  2362   2362           int k;
  2363   2363           for(k=0; k<nConstraint; k++){
  2364   2364             if( aUsage[k].argvIndex==j ){
  2365   2365               int iTerm = aConstraint[k].iTermOffset;
         2366  +            assert( pParse->disableColCache );
  2366   2367               sqlite3ExprCode(pParse, wc.a[iTerm].pExpr->pRight, iReg+j+1);
  2367   2368               break;
  2368   2369             }
  2369   2370           }
  2370   2371           if( k==nConstraint ) break;
  2371   2372         }
         2373  +      assert( pParse->disableColCache );
  2372   2374         pParse->disableColCache--;
  2373   2375         sqlite3VdbeAddOp2(v, OP_Integer, pBestIdx->idxNum, iReg);
  2374   2376         sqlite3VdbeAddOp2(v, OP_Integer, j-1, iReg+1);
  2375   2377         sqlite3VdbeAddOp4(v, OP_VFilter, iCur, brk, iReg, pBestIdx->idxStr,
  2376   2378                           pBestIdx->needToFreeIdxStr ? P4_MPRINTF : P4_STATIC);
  2377   2379         sqlite3ReleaseTempRange(pParse, iReg, nConstraint+2);
  2378   2380         pBestIdx->needToFreeIdxStr = 0;
  2379         -      for(j=0; j<pBestIdx->nConstraint; j++){
         2381  +      for(j=0; j<nConstraint; j++){
  2380   2382           if( aUsage[j].omit ){
  2381   2383             int iTerm = aConstraint[j].iTermOffset;
  2382   2384             disableTerm(pLevel, &wc.a[iTerm]);
  2383   2385           }
  2384   2386         }
  2385   2387         pLevel->op = OP_VNext;
  2386   2388         pLevel->p1 = iCur;
................................................................................
  2573   2575         start_constraints = pRangeStart || nEq>0;
  2574   2576   
  2575   2577         /* Seek the index cursor to the start of the range. */
  2576   2578         nConstraint = nEq;
  2577   2579         if( pRangeStart ){
  2578   2580           int dcc = pParse->disableColCache;
  2579   2581           if( pRangeEnd ){
  2580         -          pParse->disableColCache = 1;
         2582  +          pParse->disableColCache++;
  2581   2583           }
  2582   2584           sqlite3ExprCode(pParse, pRangeStart->pExpr->pRight, regBase+nEq);
  2583   2585           pParse->disableColCache = dcc;
  2584   2586           sqlite3VdbeAddOp2(v, OP_IsNull, regBase+nEq, nxt);
  2585   2587           nConstraint++;
  2586   2588         }else if( isMinQuery ){
  2587   2589           sqlite3VdbeAddOp2(v, OP_Null, 0, regBase+nEq);