/ Check-in [5612b287]
Login

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

Overview
Comment:Changes so that it will build with SQLITE_OMIT_VIRTUALTABLE=1. (CVS 3309)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5612b287059c75488f995625d447c4e9521d1637
User & Date: drh 2006-06-27 13:20:21
Context
2006-06-27
14:37
Changes to build successfully with -DSQLITE_OMIT_LOAD_EXTENSION=1 (CVS 3310) check-in: 783369e8 user: drh tags: trunk
13:20
Changes so that it will build with SQLITE_OMIT_VIRTUALTABLE=1. (CVS 3309) check-in: 5612b287 user: drh tags: trunk
12:51
All tests pass even if compiled with -DSQLITE_DEFAULT_FILE_FORMAT=1. (CVS 3308) check-in: 8a49311d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/update.c.

     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     12   ** This file contains C code routines that are called by the parser
    13     13   ** to handle UPDATE statements.
    14     14   **
    15         -** $Id: update.c,v 1.132 2006/06/24 11:51:34 danielk1977 Exp $
           15  +** $Id: update.c,v 1.133 2006/06/27 13:20:21 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   
           19  +#ifndef SQLITE_OMIT_VIRTUALTABLE
    19     20   /* Forward declaration */
    20     21   static void updateVirtualTable(
    21     22     Parse *pParse,       /* The parsing context */
    22     23     SrcList *pSrc,       /* The virtual table to be modified */
    23     24     Table *pTab,         /* The virtual table */
    24     25     ExprList *pChanges,  /* The columns to change in the UPDATE statement */
    25     26     Expr *pRowidExpr,    /* Expression used to recompute the rowid */
    26     27     int *aXRef,          /* Mapping from columns of pTab to entries in pChanges */
    27     28     Expr *pWhere         /* WHERE clause of the UPDATE statement */
    28     29   );
           30  +#endif /* SQLITE_OMIT_VIRTUALTABLE */
    29     31   
    30     32   /*
    31     33   ** The most recently coded instruction was an OP_Column to retrieve the
    32     34   ** i-th column of table pTab. This routine sets the P3 parameter of the 
    33     35   ** OP_Column to the default value, if any.
    34     36   **
    35     37   ** The default value of a column is specified by a DEFAULT clause in the 

Changes to src/util.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** Utility functions used throughout sqlite.
    13     13   **
    14     14   ** This file contains functions for allocating memory, comparing
    15     15   ** strings, and stuff like that.
    16     16   **
    17         -** $Id: util.c,v 1.189 2006/04/08 19:14:53 drh Exp $
           17  +** $Id: util.c,v 1.190 2006/06/27 13:20:21 drh Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include "os.h"
    21     21   #include <stdarg.h>
    22     22   #include <ctype.h>
    23     23   
    24     24   /*
................................................................................
   680    680   **
   681    681   **   * sqlite3ThreadSafeMalloc() must be matched with ThreadSafeFree(),
   682    682   **     not sqlite3Free(). Calling sqlite3Free() on memory obtained from
   683    683   **     ThreadSafeMalloc() will cause an error somewhere down the line.
   684    684   */
   685    685   #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
   686    686   void *sqlite3ThreadSafeMalloc(int n){
   687         -  ENTER_MALLOC;
          687  +  (void)ENTER_MALLOC;
   688    688     return sqlite3Malloc(n, 0);
   689    689   }
   690    690   void sqlite3ThreadSafeFree(void *p){
   691         -  ENTER_MALLOC;
          691  +  (void)ENTER_MALLOC;
   692    692     if( p ){
   693    693       OSFREE(p);
   694    694     }
   695    695   }
   696    696   #endif
   697    697   
   698    698   

Changes to src/vdbeInt.h.

    79     79     int nData;            /* Number of bytes in pData */
    80     80     char *pData;          /* Data for a NEW or OLD pseudo-table */
    81     81     i64 iKey;             /* Key for the NEW or OLD pseudo-table row */
    82     82     u8 *pIncrKey;         /* Pointer to pKeyInfo->incrKey */
    83     83     KeyInfo *pKeyInfo;    /* Info about index keys needed by index cursors */
    84     84     int nField;           /* Number of fields in the header */
    85     85     i64 seqCount;         /* Sequence counter */
    86         -#ifndef SQLITE_OMIT_VIRTUALTABLE
    87     86     sqlite3_vtab_cursor *pVtabCursor;  /* The cursor for a virtual table */
    88     87     const sqlite3_module *pModule;     /* Module for cursor pVtabCursor */
    89         -#endif
    90     88   
    91     89     /* Cached information about the header for the data record that the
    92     90     ** cursor is currently pointing to.  Only valid if cacheValid is true.
    93     91     ** aRow might point to (ephemeral) data for the current row, or it might
    94     92     ** be NULL.
    95     93     */
    96     94     int cacheStatus;      /* Cache is valid if this matches Vdbe.cacheCtr */
................................................................................
   323    321     char *zErrMsg;          /* Error message written here */
   324    322     u8 resOnStack;          /* True if there are result values on the stack */
   325    323     u8 explain;             /* True if EXPLAIN present on SQL command */
   326    324     u8 changeCntOn;         /* True to update the change-counter */
   327    325     u8 aborted;             /* True if ROLLBACK in another VM causes an abort */
   328    326     u8 expired;             /* True if the VM needs to be recompiled */
   329    327     u8 minWriteFileFormat;  /* Minimum file format for writable database files */
          328  +  u8 inVtabMethod;        /* See comments above */
   330    329     int nChange;            /* Number of db changes made since last reset */
   331    330     i64 startTime;          /* Time when query started - used for profiling */
   332    331   #ifdef SQLITE_SSE
   333    332     int fetchId;          /* Statement number used by sqlite3_fetch_statement */
   334    333     int lru;              /* Counter used for LRU cache replacement */
   335    334   #endif
   336         -#ifndef SQLITE_OMIT_VIRTUALTABLE
   337         -  int inVtabMethod;     /* See comments above */
   338         -#endif
   339    335   };
   340    336   
   341    337   /*
   342    338   ** The following are allowed values for Vdbe.magic
   343    339   */
   344    340   #define VDBE_MAGIC_INIT     0x26bceaa5    /* Building a VDBE program */
   345    341   #define VDBE_MAGIC_RUN      0xbdf20da3    /* VDBE is ready to execute */

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.227 2006/06/27 12:16:56 danielk1977 Exp $
           19  +** $Id: where.c,v 1.228 2006/06/27 13:20:22 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)
................................................................................
   520    520     }
   521    521     *pisComplete = z[cnt]==wc[0] && z[cnt+1]==0;
   522    522     *pnPattern = cnt;
   523    523     return 1;
   524    524   }
   525    525   #endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */
   526    526   
          527  +
          528  +#ifndef SQLITE_OMIT_VIRTUALTABLE
   527    529   /*
   528    530   ** Check to see if the given expression is of the form
   529    531   **
   530    532   **         column MATCH expr
   531    533   **
   532    534   ** If it is then return TRUE.  If not, return FALSE.
   533    535   */
................................................................................
   535    537     Expr *pExpr      /* Test this expression */
   536    538   ){
   537    539     ExprList *pList;
   538    540   
   539    541     if( pExpr->op!=TK_FUNCTION ){
   540    542       return 0;
   541    543     }
   542         -  if( pExpr->token.n!=5 || sqlite3StrNICmp(pExpr->token.z,"match",5)!=0 ){
          544  +  if( pExpr->token.n!=5 ||
          545  +       sqlite3StrNICmp((const char*)pExpr->token.z,"match",5)!=0 ){
   543    546       return 0;
   544    547     }
   545    548     pList = pExpr->pList;
   546    549     if( pList->nExpr!=2 ){
   547    550       return 0;
   548    551     }
   549    552     if( pList->a[1].pExpr->op != TK_COLUMN ){
   550    553       return 0;
   551    554     }
   552    555     return 1;
   553    556   }
          557  +#endif /* SQLITE_OMIT_VIRTUALTABLE */
   554    558   
   555    559   /*
   556    560   ** If the pBase expression originated in the ON or USING clause of
   557    561   ** a join, then transfer the appropriate markings over to derived.
   558    562   */
   559    563   static void transferJoinMarkings(Expr *pDerived, Expr *pBase){
   560    564     pDerived->flags |= pBase->flags & EP_FromJoin;