/ Check-in [656c9038]
Login

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

Overview
Comment:Always use "(char*)0" to terminate the argument list of sqliteSetString(). This is needed for 64-bit systems that use a 32-bit integer by default. (CVS 1126)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 656c90387a4a714b4f31040ece9b0e15e30934af
User & Date: drh 2003-12-06 21:43:56
Context
2003-12-06
22:22
Fail an ATTACH if the auxiliary database is locked. Ticket #514. (CVS 1127) check-in: ac428c8d user: drh tags: trunk
21:43
Always use "(char*)0" to terminate the argument list of sqliteSetString(). This is needed for 64-bit systems that use a 32-bit integer by default. (CVS 1126) check-in: 656c9038 user: drh tags: trunk
2003-12-04
20:51
Use sqlite_freemem() instead of free() in the shell. Windows needs this. (Unix does not care.) Ticket #444. (CVS 1125) check-in: e5e6a848 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/auth.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains code used to implement the sqlite_set_authorizer()
    13     13   ** API.  This facility is an optional feature of the library.  Embedded
    14     14   ** systems that do not need this facility may omit it by recompiling
    15     15   ** the library with -DSQLITE_OMIT_AUTHORIZATION=1
    16     16   **
    17         -** $Id: auth.c,v 1.10 2003/05/10 03:36:54 drh Exp $
           17  +** $Id: auth.c,v 1.11 2003/12/06 21:43:56 drh Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   
    21     21   /*
    22     22   ** All of the code in this file may be omitted by defining a single
    23     23   ** macro.
    24     24   */
................................................................................
    85     85   ** user-supplied authorization function returned an illegal value.
    86     86   */
    87     87   static void sqliteAuthBadReturnCode(Parse *pParse, int rc){
    88     88     char zBuf[20];
    89     89     sprintf(zBuf, "(%d)", rc);
    90     90     sqliteSetString(&pParse->zErrMsg, "illegal return value ", zBuf,
    91     91       " from the authorization function - should be SQLITE_OK, "
    92         -    "SQLITE_IGNORE, or SQLITE_DENY", 0);
           92  +    "SQLITE_IGNORE, or SQLITE_DENY", (char*)0);
    93     93     pParse->nErr++;
    94     94     pParse->rc = SQLITE_MISUSE;
    95     95   }
    96     96   
    97     97   /*
    98     98   ** The pExpr should be a TK_COLUMN expression.  The table referred to
    99     99   ** is in pTabList or else it is the NEW or OLD table of a trigger.  
................................................................................
   147    147     rc = db->xAuth(db->pAuthArg, SQLITE_READ, pTab->zName, zCol, zDBase, 
   148    148                    pParse->zAuthContext);
   149    149     if( rc==SQLITE_IGNORE ){
   150    150       pExpr->op = TK_NULL;
   151    151     }else if( rc==SQLITE_DENY ){
   152    152       if( db->nDb>2 || pExpr->iDb!=0 ){
   153    153         sqliteSetString(&pParse->zErrMsg,"access to ", zDBase, ".",
   154         -          pTab->zName, ".", zCol, " is prohibited", 0);
          154  +          pTab->zName, ".", zCol, " is prohibited", (char*)0);
   155    155       }else{
   156    156         sqliteSetString(&pParse->zErrMsg,"access to ", pTab->zName, ".",
   157         -                      zCol, " is prohibited", 0);
          157  +                      zCol, " is prohibited", (char*)0);
   158    158       }
   159    159       pParse->nErr++;
   160    160       pParse->rc = SQLITE_AUTH;
   161    161     }else if( rc!=SQLITE_OK ){
   162    162       sqliteAuthBadReturnCode(pParse, rc);
   163    163     }
   164    164   }
................................................................................
   180    180     int rc;
   181    181   
   182    182     if( db->xAuth==0 ){
   183    183       return SQLITE_OK;
   184    184     }
   185    185     rc = db->xAuth(db->pAuthArg, code, zArg1, zArg2, zArg3, pParse->zAuthContext);
   186    186     if( rc==SQLITE_DENY ){
   187         -    sqliteSetString(&pParse->zErrMsg, "not authorized", 0);
          187  +    sqliteSetString(&pParse->zErrMsg, "not authorized", (char*)0);
   188    188       pParse->rc = SQLITE_AUTH;
   189    189       pParse->nErr++;
   190    190     }else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){
   191    191       rc = SQLITE_DENY;
   192    192       sqliteAuthBadReturnCode(pParse, rc);
   193    193     }
   194    194     return rc;

Changes to src/btree.c.

     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         -** $Id: btree.c,v 1.95 2003/06/17 02:57:18 drh Exp $
           12  +** $Id: btree.c,v 1.96 2003/12/06 21:43:56 drh Exp $
    13     13   **
    14     14   ** This file implements a external (disk-based) database using BTrees.
    15     15   ** For a detailed discussion of BTrees, refer to
    16     16   **
    17     17   **     Donald E. Knuth, THE ART OF COMPUTER PROGRAMMING, Volume 3:
    18     18   **     "Sorting And Searching", pages 473-480. Addison-Wesley
    19     19   **     Publishing Company, Reading, Massachusetts.
................................................................................
  3165   3165   /*
  3166   3166   ** Append a message to the error message string.
  3167   3167   */
  3168   3168   static void checkAppendMsg(IntegrityCk *pCheck, char *zMsg1, char *zMsg2){
  3169   3169     if( pCheck->zErrMsg ){
  3170   3170       char *zOld = pCheck->zErrMsg;
  3171   3171       pCheck->zErrMsg = 0;
  3172         -    sqliteSetString(&pCheck->zErrMsg, zOld, "\n", zMsg1, zMsg2, 0);
         3172  +    sqliteSetString(&pCheck->zErrMsg, zOld, "\n", zMsg1, zMsg2, (char*)0);
  3173   3173       sqliteFree(zOld);
  3174   3174     }else{
  3175         -    sqliteSetString(&pCheck->zErrMsg, zMsg1, zMsg2, 0);
         3175  +    sqliteSetString(&pCheck->zErrMsg, zMsg1, zMsg2, (char*)0);
  3176   3176     }
  3177   3177   }
  3178   3178   
  3179   3179   /*
  3180   3180   ** Add 1 to the reference count for page iPage.  If this is the second
  3181   3181   ** reference to the page, add an error message to pCheck->zErrMsg.
  3182   3182   ** Return 1 if there are 2 ore more references to the page and 0 if

Changes to src/btree_rb.c.

     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         -** $Id: btree_rb.c,v 1.17 2003/10/22 22:15:28 drh Exp $
           12  +** $Id: btree_rb.c,v 1.18 2003/12/06 21:43:56 drh Exp $
    13     13   **
    14     14   ** This file implements an in-core database using Red-Black balanced
    15     15   ** binary trees.
    16     16   ** 
    17     17   ** It was contributed to SQLite by anonymous on 2003-Feb-04 23:24:49 UTC.
    18     18   */
    19     19   #include "btree.h"
................................................................................
   261    261    */
   262    262   static char *append_val(char * orig, char const * val)
   263    263   {
   264    264     if( !orig ){
   265    265       return sqliteStrDup( val );
   266    266     } else{
   267    267       char * ret = 0;
   268         -    sqliteSetString(&ret, orig, val, 0);
          268  +    sqliteSetString(&ret, orig, val, (char*)0);
   269    269       sqliteFree( orig );
   270    270       return ret;
   271    271     }
   272    272     assert(0);
   273    273   }
   274    274   
   275    275   /*

Changes to src/build.c.

    19     19   **     DROP INDEX
    20     20   **     creating ID lists
    21     21   **     BEGIN TRANSACTION
    22     22   **     COMMIT
    23     23   **     ROLLBACK
    24     24   **     PRAGMA
    25     25   **
    26         -** $Id: build.c,v 1.161 2003/11/27 00:48:58 drh Exp $
           26  +** $Id: build.c,v 1.162 2003/12/06 21:43:56 drh Exp $
    27     27   */
    28     28   #include "sqliteInt.h"
    29     29   #include <ctype.h>
    30     30   
    31     31   /*
    32     32   ** This routine is called when a new SQL statement is beginning to
    33     33   ** be parsed.  Check to see if the schema for the database needs
................................................................................
   490    490     /* Before trying to create a temporary table, make sure the Btree for
   491    491     ** holding temporary tables is open.
   492    492     */
   493    493     if( isTemp && db->aDb[1].pBt==0 && !pParse->explain ){
   494    494       int rc = sqliteBtreeFactory(db, 0, 0, MAX_PAGES, &db->aDb[1].pBt);
   495    495       if( rc!=SQLITE_OK ){
   496    496         sqliteSetString(&pParse->zErrMsg, "unable to open a temporary database "
   497         -        "file for storing temporary tables", 0);
          497  +        "file for storing temporary tables", (char*)0);
   498    498         pParse->nErr++;
   499    499         return;
   500    500       }
   501    501       if( db->flags & SQLITE_InTrans ){
   502    502         rc = sqliteBtreeBeginTrans(db->aDb[1].pBt);
   503    503         if( rc!=SQLITE_OK ){
   504    504           sqliteSetNString(&pParse->zErrMsg, "unable to get a write lock on "
................................................................................
   524    524       sqliteFree(zName);
   525    525       pParse->nErr++;
   526    526       return;
   527    527     }
   528    528     if( (pIdx = sqliteFindIndex(db, zName, 0))!=0 &&
   529    529             (pIdx->iDb==0 || !pParse->initFlag) ){
   530    530       sqliteSetString(&pParse->zErrMsg, "there is already an index named ", 
   531         -       zName, 0);
          531  +       zName, (char*)0);
   532    532       sqliteFree(zName);
   533    533       pParse->nErr++;
   534    534       return;
   535    535     }
   536    536     pTable = sqliteMalloc( sizeof(Table) );
   537    537     if( pTable==0 ){
   538    538       sqliteFree(zName);
................................................................................
   584    584     Column *pCol;
   585    585     if( (p = pParse->pNewTable)==0 ) return;
   586    586     sqliteSetNString(&z, pName->z, pName->n, 0);
   587    587     if( z==0 ) return;
   588    588     sqliteDequote(z);
   589    589     for(i=0; i<p->nCol; i++){
   590    590       if( sqliteStrICmp(z, p->aCol[i].zName)==0 ){
   591         -      sqliteSetString(&pParse->zErrMsg, "duplicate column name: ", z, 0);
          591  +      sqliteSetString(&pParse->zErrMsg, "duplicate column name: ", z, (char*)0);
   592    592         pParse->nErr++;
   593    593         sqliteFree(z);
   594    594         return;
   595    595       }
   596    596     }
   597    597     if( (p->nCol & 0x7)==0 ){
   598    598       Column *aNew;
................................................................................
   705    705   void sqliteAddPrimaryKey(Parse *pParse, IdList *pList, int onError){
   706    706     Table *pTab = pParse->pNewTable;
   707    707     char *zType = 0;
   708    708     int iCol = -1, i;
   709    709     if( pTab==0 ) goto primary_key_exit;
   710    710     if( pTab->hasPrimKey ){
   711    711       sqliteSetString(&pParse->zErrMsg, "table \"", pTab->zName, 
   712         -        "\" has more than one primary key", 0);
          712  +        "\" has more than one primary key", (char*)0);
   713    713       pParse->nErr++;
   714    714       goto primary_key_exit;
   715    715     }
   716    716     pTab->hasPrimKey = 1;
   717    717     if( pList==0 ){
   718    718       iCol = pTab->nCol - 1;
   719    719       pTab->aCol[iCol].isPrimKey = 1;
................................................................................
  1121   1121     **     CREATE VIEW two AS SELECT * FROM one;
  1122   1122     **
  1123   1123     ** Actually, this error is caught previously and so the following test
  1124   1124     ** should always fail.  But we will leave it in place just to be safe.
  1125   1125     */
  1126   1126     if( pTable->nCol<0 ){
  1127   1127       sqliteSetString(&pParse->zErrMsg, "view ", pTable->zName,
  1128         -         " is circularly defined", 0);
         1128  +         " is circularly defined", (char*)0);
  1129   1129       pParse->nErr++;
  1130   1130       return 1;
  1131   1131     }
  1132   1132   
  1133   1133     /* If we get this far, it means we need to compute the table names.
  1134   1134     */
  1135   1135     assert( pTable->pSelect ); /* If nCol==0, then pTable must be a VIEW */
................................................................................
  1265   1265       if( sqliteAuthCheck(pParse, SQLITE_DELETE, pTable->zName, 0, zDb) ){
  1266   1266         return;
  1267   1267       }
  1268   1268     }
  1269   1269   #endif
  1270   1270     if( pTable->readOnly ){
  1271   1271       sqliteSetString(&pParse->zErrMsg, "table ", pTable->zName, 
  1272         -       " may not be dropped", 0);
         1272  +       " may not be dropped", (char*)0);
  1273   1273       pParse->nErr++;
  1274   1274       return;
  1275   1275     }
  1276   1276     if( isView && pTable->pSelect==0 ){
  1277   1277       sqliteSetString(&pParse->zErrMsg, "use DROP TABLE to delete table ",
  1278         -      pTable->zName, 0);
         1278  +      pTable->zName, (char*)0);
  1279   1279       pParse->nErr++;
  1280   1280       return;
  1281   1281     }
  1282   1282     if( !isView && pTable->pSelect ){
  1283   1283       sqliteSetString(&pParse->zErrMsg, "use DROP VIEW to delete view ",
  1284         -      pTable->zName, 0);
         1284  +      pTable->zName, (char*)0);
  1285   1285       pParse->nErr++;
  1286   1286       return;
  1287   1287     }
  1288   1288   
  1289   1289     /* Generate code to remove the table from the master table
  1290   1290     ** on disk.
  1291   1291     */
................................................................................
  1432   1432         pParse->nErr++;
  1433   1433         goto fk_end;
  1434   1434       }
  1435   1435       nCol = 1;
  1436   1436     }else if( pToCol && pToCol->nId!=pFromCol->nId ){
  1437   1437       sqliteSetString(&pParse->zErrMsg, 
  1438   1438           "number of columns in foreign key does not match the number of "
  1439         -        "columns in the referenced table", 0);
         1439  +        "columns in the referenced table", (char*)0);
  1440   1440       pParse->nErr++;
  1441   1441       goto fk_end;
  1442   1442     }else{
  1443   1443       nCol = pFromCol->nId;
  1444   1444     }
  1445   1445     nByte = sizeof(*pFKey) + nCol*sizeof(pFKey->aCol[0]) + pTo->n + 1;
  1446   1446     if( pToCol ){
................................................................................
  1470   1470           if( sqliteStrICmp(p->aCol[j].zName, pFromCol->a[i].zName)==0 ){
  1471   1471             pFKey->aCol[i].iFrom = j;
  1472   1472             break;
  1473   1473           }
  1474   1474         }
  1475   1475         if( j>=p->nCol ){
  1476   1476           sqliteSetString(&pParse->zErrMsg, "unknown column \"", 
  1477         -          pFromCol->a[i].zName, "\" in foreign key definition", 0);
         1477  +          pFromCol->a[i].zName, "\" in foreign key definition", (char*)0);
  1478   1478           pParse->nErr++;
  1479   1479           goto fk_end;
  1480   1480         }
  1481   1481       }
  1482   1482     }
  1483   1483     if( pToCol ){
  1484   1484       for(i=0; i<nCol; i++){
................................................................................
  1567   1567     }else{
  1568   1568       assert( pName==0 );
  1569   1569       pTab =  pParse->pNewTable;
  1570   1570     }
  1571   1571     if( pTab==0 || pParse->nErr ) goto exit_create_index;
  1572   1572     if( pTab->readOnly ){
  1573   1573       sqliteSetString(&pParse->zErrMsg, "table ", pTab->zName,
  1574         -      " may not be indexed", 0);
         1574  +      " may not be indexed", (char*)0);
  1575   1575       pParse->nErr++;
  1576   1576       goto exit_create_index;
  1577   1577     }
  1578   1578     if( pTab->iDb>=2 && pParse->initFlag==0 ){
  1579   1579       sqliteSetString(&pParse->zErrMsg, "table ", pTab->zName, 
  1580         -      " may not have indices added", 0);
         1580  +      " may not have indices added", (char*)0);
  1581   1581       pParse->nErr++;
  1582   1582       goto exit_create_index;
  1583   1583     }
  1584   1584     if( pTab->pSelect ){
  1585         -    sqliteSetString(&pParse->zErrMsg, "views may not be indexed", 0);
         1585  +    sqliteSetString(&pParse->zErrMsg, "views may not be indexed", (char*)0);
  1586   1586       pParse->nErr++;
  1587   1587       goto exit_create_index;
  1588   1588     }
  1589   1589     isTemp = pTab->iDb==1;
  1590   1590   
  1591   1591     /*
  1592   1592     ** Find the name of the index.  Make sure there is not already another
................................................................................
  1604   1604     if( pName && !pParse->initFlag ){
  1605   1605       Index *pISameName;    /* Another index with the same name */
  1606   1606       Table *pTSameName;    /* A table with same name as the index */
  1607   1607       zName = sqliteStrNDup(pName->z, pName->n);
  1608   1608       if( zName==0 ) goto exit_create_index;
  1609   1609       if( (pISameName = sqliteFindIndex(db, zName, 0))!=0 ){
  1610   1610         sqliteSetString(&pParse->zErrMsg, "index ", zName, 
  1611         -         " already exists", 0);
         1611  +         " already exists", (char*)0);
  1612   1612         pParse->nErr++;
  1613   1613         goto exit_create_index;
  1614   1614       }
  1615   1615       if( (pTSameName = sqliteFindTable(db, zName, 0))!=0 ){
  1616   1616         sqliteSetString(&pParse->zErrMsg, "there is already a table named ",
  1617         -         zName, 0);
         1617  +         zName, (char*)0);
  1618   1618         pParse->nErr++;
  1619   1619         goto exit_create_index;
  1620   1620       }
  1621   1621     }else if( pName==0 ){
  1622   1622       char zBuf[30];
  1623   1623       int n;
  1624   1624       Index *pLoop;
  1625   1625       for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){}
  1626   1626       sprintf(zBuf,"%d)",n);
  1627   1627       zName = 0;
  1628         -    sqliteSetString(&zName, "(", pTab->zName, " autoindex ", zBuf, 0);
         1628  +    sqliteSetString(&zName, "(", pTab->zName, " autoindex ", zBuf, (char*)0);
  1629   1629       if( zName==0 ) goto exit_create_index;
  1630   1630     }else{
  1631   1631       zName = sqliteStrNDup(pName->z, pName->n);
  1632   1632     }
  1633   1633   
  1634   1634     /* Check for authorization to create an index.
  1635   1635     */
................................................................................
  1681   1681     */
  1682   1682     for(i=0; i<pList->nId; i++){
  1683   1683       for(j=0; j<pTab->nCol; j++){
  1684   1684         if( sqliteStrICmp(pList->a[i].zName, pTab->aCol[j].zName)==0 ) break;
  1685   1685       }
  1686   1686       if( j>=pTab->nCol ){
  1687   1687         sqliteSetString(&pParse->zErrMsg, "table ", pTab->zName, 
  1688         -        " has no column named ", pList->a[i].zName, 0);
         1688  +        " has no column named ", pList->a[i].zName, (char*)0);
  1689   1689         pParse->nErr++;
  1690   1690         sqliteFree(pIndex);
  1691   1691         goto exit_create_index;
  1692   1692       }
  1693   1693       pIndex->aiColumn[i] = j;
  1694   1694     }
  1695   1695   

Changes to src/insert.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 INSERT statements in SQLite.
    14     14   **
    15         -** $Id: insert.c,v 1.89 2003/08/05 13:13:38 drh Exp $
           15  +** $Id: insert.c,v 1.90 2003/12/06 21:43:56 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   /*
    20     20   ** This routine is call to handle SQL of the following forms:
    21     21   **
    22     22   **    insert into TABLE (IDLIST) values(EXPRLIST)
................................................................................
   684    684       switch( onError ){
   685    685         case OE_Rollback:
   686    686         case OE_Abort:
   687    687         case OE_Fail: {
   688    688           char *zMsg = 0;
   689    689           sqliteVdbeAddOp(v, OP_Halt, SQLITE_CONSTRAINT, onError);
   690    690           sqliteSetString(&zMsg, pTab->zName, ".", pTab->aCol[i].zName,
   691         -                        " may not be NULL", 0);
          691  +                        " may not be NULL", (char*)0);
   692    692           sqliteVdbeChangeP3(v, -1, zMsg, P3_DYNAMIC);
   693    693           break;
   694    694         }
   695    695         case OE_Ignore: {
   696    696           sqliteVdbeAddOp(v, OP_Pop, nCol+1+hasTwoRecnos, 0);
   697    697           sqliteVdbeAddOp(v, OP_Goto, 0, ignoreDest);
   698    698           break;

Changes to src/main.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** Main file for the SQLite library.  The routines in this file
    13     13   ** implement the programmer interface to the library.  Routines in
    14     14   ** other files are for internal use by SQLite and should not be
    15     15   ** accessed by users of the library.
    16     16   **
    17         -** $Id: main.c,v 1.143 2003/10/18 09:37:26 danielk1977 Exp $
           17  +** $Id: main.c,v 1.144 2003/12/06 21:43:56 drh Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include "os.h"
    21     21   #include <ctype.h>
    22     22   
    23     23   /*
    24     24   ** A pointer to this structure is used to communicate information
................................................................................
    30     30   } InitData;
    31     31   
    32     32   /*
    33     33   ** Fill the InitData structure with an error message that indicates
    34     34   ** that the database is corrupt.
    35     35   */
    36     36   static void corruptSchema(InitData *pData){
    37         -  sqliteSetString(pData->pzErrMsg, "malformed database schema", 0);
           37  +  sqliteSetString(pData->pzErrMsg, "malformed database schema", (char*)0);
    38     38   }
    39     39   
    40     40   /*
    41     41   ** This is the callback routine for the code that initializes the
    42     42   ** database.  See sqliteInit() below for additional information.
    43     43   **
    44     44   ** Each callback contains the following information:
................................................................................
   146    146     rc = sqlite_exec_printf(pData->db,
   147    147       "CREATE TEMP TABLE sqlite_x AS SELECT * FROM '%q'; "
   148    148       "DELETE FROM '%q'; "
   149    149       "INSERT INTO '%q' SELECT * FROM sqlite_x; "
   150    150       "DROP TABLE sqlite_x;",
   151    151       0, 0, &zErr, argv[0], argv[0], argv[0]);
   152    152     if( zErr ){
   153         -    sqliteSetString(pData->pzErrMsg, zErr, 0);
          153  +    sqliteSetString(pData->pzErrMsg, zErr, (char*)0);
   154    154       sqlite_freemem(zErr);
   155    155     }
   156    156   
   157    157     /* If an error occurred in the SQL above, then the transaction will
   158    158     ** rollback which will delete the internal symbol tables.  This will
   159    159     ** cause the structure that pTab points to be deleted.  In case that
   160    160     ** happened, we need to refetch pTab.
................................................................................
   268    268     }
   269    269   
   270    270     /* Create a cursor to hold the database open
   271    271     */
   272    272     if( db->aDb[iDb].pBt==0 ) return SQLITE_OK;
   273    273     rc = sqliteBtreeCursor(db->aDb[iDb].pBt, 2, 0, &curMain);
   274    274     if( rc ){
   275         -    sqliteSetString(pzErrMsg, sqlite_error_string(rc), 0);
          275  +    sqliteSetString(pzErrMsg, sqlite_error_string(rc), (char*)0);
   276    276       return rc;
   277    277     }
   278    278   
   279    279     /* Get the database meta information
   280    280     */
   281    281     rc = sqliteBtreeGetMeta(db->aDb[iDb].pBt, meta);
   282    282     if( rc ){
   283         -    sqliteSetString(pzErrMsg, sqlite_error_string(rc), 0);
          283  +    sqliteSetString(pzErrMsg, sqlite_error_string(rc), (char*)0);
   284    284       sqliteBtreeCloseCursor(curMain);
   285    285       return rc;
   286    286     }
   287    287     db->aDb[iDb].schema_cookie = meta[1];
   288    288     if( iDb==0 ){
   289    289       db->next_cookie = meta[1];
   290    290       db->file_format = meta[2];
................................................................................
   302    302       **                    text datatypes.
   303    303       */
   304    304       if( db->file_format==0 ){
   305    305         /* This happens if the database was initially empty */
   306    306         db->file_format = 4;
   307    307       }else if( db->file_format>4 ){
   308    308         sqliteBtreeCloseCursor(curMain);
   309         -      sqliteSetString(pzErrMsg, "unsupported file format", 0);
          309  +      sqliteSetString(pzErrMsg, "unsupported file format", (char*)0);
   310    310         return SQLITE_ERROR;
   311    311       }
   312    312     }else if( db->file_format!=meta[2] || db->file_format<4 ){
   313    313       assert( db->file_format>=4 );
   314    314       if( meta[2]==0 ){
   315    315         sqliteSetString(pzErrMsg, "cannot attach empty database: ",
   316         -         db->aDb[iDb].zName, 0);
          316  +         db->aDb[iDb].zName, (char*)0);
   317    317       }else{
   318    318         sqliteSetString(pzErrMsg, "incompatible file format in auxiliary "
   319         -         "database: ", db->aDb[iDb].zName, 0);
          319  +         "database: ", db->aDb[iDb].zName, (char*)0);
   320    320       }
   321    321       sqliteBtreeClose(db->aDb[iDb].pBt);
   322    322       db->aDb[iDb].pBt = 0;
   323    323       return SQLITE_FORMAT;
   324    324     }
   325    325     sqliteBtreeSetCacheSize(db->aDb[iDb].pBt, db->cache_size);
   326    326     sqliteBtreeSetSafetyLevel(db->aDb[iDb].pBt, meta[4]==0 ? 2 : meta[4]);
................................................................................
   337    337       sqliteRunParser(&sParse,
   338    338           db->file_format>=2 ? init_script : older_init_script,
   339    339           pzErrMsg);
   340    340     }else{
   341    341       char *zSql = 0;
   342    342       sqliteSetString(&zSql, 
   343    343          "SELECT type, name, rootpage, sql, ", zDbNum, " FROM \"",
   344         -       db->aDb[iDb].zName, "\".sqlite_master", 0);
          344  +       db->aDb[iDb].zName, "\".sqlite_master", (char*)0);
   345    345       sqliteRunParser(&sParse, zSql, pzErrMsg);
   346    346       sqliteFree(zSql);
   347    347     }
   348    348     sqliteBtreeCloseCursor(curMain);
   349    349     if( sqlite_malloc_failed ){
   350         -    sqliteSetString(pzErrMsg, "out of memory", 0);
          350  +    sqliteSetString(pzErrMsg, "out of memory", (char*)0);
   351    351       sParse.rc = SQLITE_NOMEM;
   352    352       sqliteResetInternalSchema(db, 0);
   353    353     }
   354    354     if( sParse.rc==SQLITE_OK ){
   355    355       DbSetProperty(db, iDb, DB_SchemaLoaded);
   356    356       if( iDb==0 ){
   357    357         DbSetProperty(db, 1, DB_SchemaLoaded);
................................................................................
   444    444     if( zFilename[0]==':' && strcmp(zFilename,":memory:")==0 ){
   445    445       db->temp_store = 2;
   446    446     }
   447    447     rc = sqliteBtreeFactory(db, zFilename, 0, MAX_PAGES, &db->aDb[0].pBt);
   448    448     if( rc!=SQLITE_OK ){
   449    449       switch( rc ){
   450    450         default: {
   451         -        sqliteSetString(pzErrMsg, "unable to open database: ", zFilename, 0);
          451  +        sqliteSetString(pzErrMsg, "unable to open database: ",
          452  +           zFilename, (char*)0);
   452    453         }
   453    454       }
   454    455       sqliteFree(db);
   455    456       sqliteStrRealloc(pzErrMsg);
   456    457       return 0;
   457    458     }
   458    459     db->aDb[0].zName = "main";
................................................................................
   497    498         meta[2] = 4;
   498    499         sqliteBtreeUpdateMeta(db->aDb[0].pBt, meta);
   499    500         sqlite_exec(db, "COMMIT", 0, 0, 0);
   500    501       }
   501    502       if( rc!=SQLITE_OK ){
   502    503         sqliteSetString(pzErrMsg, 
   503    504           "unable to upgrade database to the version 2.6 format",
   504         -        zErr ? ": " : 0, zErr, 0);
          505  +        zErr ? ": " : 0, zErr, (char*)0);
   505    506         sqlite_freemem(zErr);
   506    507         sqliteStrRealloc(pzErrMsg);
   507    508         sqlite_close(db);
   508    509         return 0;
   509    510       }
   510    511       sqlite_freemem(zErr);
   511    512     }
   512    513   
   513    514     /* Return a pointer to the newly opened database structure */
   514    515     return db;
   515    516   
   516    517   no_mem_on_open:
   517         -  sqliteSetString(pzErrMsg, "out of memory", 0);
          518  +  sqliteSetString(pzErrMsg, "out of memory", (char*)0);
   518    519     sqliteStrRealloc(pzErrMsg);
   519    520     return 0;
   520    521   }
   521    522   
   522    523   /*
   523    524   ** Return the ROWID of the most recent insert
   524    525   */
................................................................................
   613    614       if( pzErrMsg ){
   614    615         sqliteFree(*pzErrMsg);
   615    616         *pzErrMsg = 0;
   616    617       }
   617    618     }
   618    619     if( db->file_format<3 ){
   619    620       sqliteSafetyOff(db);
   620         -    sqliteSetString(pzErrMsg, "obsolete database file format", 0);
          621  +    sqliteSetString(pzErrMsg, "obsolete database file format", (char*)0);
   621    622       return SQLITE_ERROR;
   622    623     }
   623    624     if( db->pVdbe==0 ){ db->nChange = 0; }
   624    625     memset(&sParse, 0, sizeof(sParse));
   625    626     sParse.db = db;
   626    627     sParse.xCallback = xCallback;
   627    628     sParse.pArg = pArg;
   628    629     sParse.useCallback = ppVm==0;
   629    630     if( db->xTrace ) db->xTrace(db->pTraceArg, zSql);
   630    631     sqliteRunParser(&sParse, zSql, pzErrMsg);
   631    632     if( sqlite_malloc_failed ){
   632         -    sqliteSetString(pzErrMsg, "out of memory", 0);
          633  +    sqliteSetString(pzErrMsg, "out of memory", (char*)0);
   633    634       sParse.rc = SQLITE_NOMEM;
   634    635       sqliteRollbackAll(db);
   635    636       sqliteResetInternalSchema(db, 0);
   636    637       db->flags &= ~SQLITE_InTrans;
   637    638     }
   638    639     if( sParse.rc==SQLITE_DONE ) sParse.rc = SQLITE_OK;
   639    640     if( sParse.rc!=SQLITE_OK && pzErrMsg && *pzErrMsg==0 ){
   640         -    sqliteSetString(pzErrMsg, sqlite_error_string(sParse.rc), 0);
          641  +    sqliteSetString(pzErrMsg, sqlite_error_string(sParse.rc), (char*)0);
   641    642     }
   642    643     sqliteStrRealloc(pzErrMsg);
   643    644     if( sParse.rc==SQLITE_SCHEMA ){
   644    645       sqliteResetInternalSchema(db, 0);
   645    646     }
   646    647     if( sParse.useCallback==0 ){
   647    648       assert( ppVm );
................................................................................
   650    651     }
   651    652     if( sqliteSafetyOff(db) ) goto exec_misuse;
   652    653     return sParse.rc;
   653    654   
   654    655   exec_misuse:
   655    656     if( pzErrMsg ){
   656    657       *pzErrMsg = 0;
   657         -    sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), 0);
          658  +    sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), (char*)0);
   658    659       sqliteStrRealloc(pzErrMsg);
   659    660     }
   660    661     return SQLITE_MISUSE;
   661    662   }
   662    663   
   663    664   /*
   664    665   ** Execute SQL code.  Return one of the SQLITE_ success/failure

Changes to src/os.c.

  1560   1560   ** The calling function is responsible for freeing this space once it
  1561   1561   ** is no longer needed.
  1562   1562   */
  1563   1563   char *sqliteOsFullPathname(const char *zRelative){
  1564   1564   #if OS_UNIX
  1565   1565     char *zFull = 0;
  1566   1566     if( zRelative[0]=='/' ){
  1567         -    sqliteSetString(&zFull, zRelative, 0);
         1567  +    sqliteSetString(&zFull, zRelative, (char*)0);
  1568   1568     }else{
  1569   1569       char zBuf[5000];
  1570         -    sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), "/", zRelative, 0);
         1570  +    sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), "/", zRelative,
         1571  +                    (char*)0);
  1571   1572     }
  1572   1573     return zFull;
  1573   1574   #endif
  1574   1575   #if OS_WIN
  1575   1576     char *zNotUsed;
  1576   1577     char *zFull;
  1577   1578     int nByte;
................................................................................
  1581   1582     GetFullPathName(zRelative, nByte, zFull, &zNotUsed);
  1582   1583     return zFull;
  1583   1584   #endif
  1584   1585   #if OS_MAC
  1585   1586     char *zFull = 0;
  1586   1587     if( zRelative[0]==':' ){
  1587   1588       char zBuf[_MAX_PATH+1];
  1588         -    sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), &(zRelative[1]), 0);
         1589  +    sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), &(zRelative[1]),
         1590  +                    (char*)0);
  1589   1591     }else{
  1590   1592       if( strchr(zRelative, ':') ){
  1591         -      sqliteSetString(&zFull, zRelative, 0);
         1593  +      sqliteSetString(&zFull, zRelative, (char*)0);
  1592   1594       }else{
  1593   1595       char zBuf[_MAX_PATH+1];
  1594         -      sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), zRelative, 0);
         1596  +      sqliteSetString(&zFull, getcwd(zBuf, sizeof(zBuf)), zRelative, (char*)0);
  1595   1597       }
  1596   1598     }
  1597   1599     return zFull;
  1598   1600   #endif
  1599   1601   }
  1600   1602   
  1601   1603   /*

Changes to src/parse.y.

    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains SQLite's grammar for SQL.  Process this file
    13     13   ** using the lemon parser generator to generate C code that runs
    14     14   ** the parser.  Lemon will also generate a header file containing
    15     15   ** numeric codes for all of the tokens.
    16     16   **
    17         -** @(#) $Id: parse.y,v 1.104 2003/11/27 00:48:58 drh Exp $
           17  +** @(#) $Id: parse.y,v 1.105 2003/12/06 21:43:56 drh Exp $
    18     18   */
    19     19   %token_prefix TK_
    20     20   %token_type {Token}
    21     21   %default_type {Token}
    22     22   %extra_argument {Parse *pParse}
    23     23   %syntax_error {
    24     24     if( pParse->zErrMsg==0 ){
    25     25       if( TOKEN.z[0] ){
    26     26         sqliteSetNString(&pParse->zErrMsg, 
    27     27             "near \"", -1, TOKEN.z, TOKEN.n, "\": syntax error", -1, 0);
    28     28       }else{
    29         -      sqliteSetString(&pParse->zErrMsg, "incomplete SQL statement", 0);
           29  +      sqliteSetString(&pParse->zErrMsg, "incomplete SQL statement", (char*)0);
    30     30       }
    31     31     }
    32     32     pParse->nErr++;
    33     33   }
    34     34   %name sqliteParser
    35     35   %include {
    36     36   #include "sqliteInt.h"

Changes to src/table.c.

    81     81           }
    82     82           strcpy(z, colv[i]);
    83     83         }
    84     84         p->azResult[p->nData++] = z;
    85     85       }
    86     86     }else if( p->nColumn!=nCol ){
    87     87       sqliteSetString(&p->zErrMsg,
    88         -       "sqlite_get_table() called with two or more incompatible queries", 0);
           88  +       "sqlite_get_table() called with two or more incompatible queries",
           89  +       (char*)0);
    89     90       p->rc = SQLITE_ERROR;
    90     91       return 1;
    91     92     }
    92     93   
    93     94     /* Copy over the row data
    94     95     */
    95     96     if( argv!=0 ){

Changes to src/tokenize.c.

    11     11   *************************************************************************
    12     12   ** An tokenizer for SQL
    13     13   **
    14     14   ** This file contains C code that splits an SQL input string up into
    15     15   ** individual tokens and sends those tokens one-by-one over to the
    16     16   ** parser for analysis.
    17     17   **
    18         -** $Id: tokenize.c,v 1.64 2003/09/27 13:39:39 drh Exp $
           18  +** $Id: tokenize.c,v 1.65 2003/12/06 21:43:56 drh Exp $
    19     19   */
    20     20   #include "sqliteInt.h"
    21     21   #include "os.h"
    22     22   #include <ctype.h>
    23     23   #include <stdlib.h>
    24     24   
    25     25   /*
................................................................................
   409    409     extern int sqliteParser(void*, int, Token, Parse*);
   410    410   
   411    411     db->flags &= ~SQLITE_Interrupt;
   412    412     pParse->rc = SQLITE_OK;
   413    413     i = 0;
   414    414     pEngine = sqliteParserAlloc((void*(*)(int))malloc);
   415    415     if( pEngine==0 ){
   416         -    sqliteSetString(pzErrMsg, "out of memory", 0);
          416  +    sqliteSetString(pzErrMsg, "out of memory", (char*)0);
   417    417       return 1;
   418    418     }
   419    419     pParse->sLastToken.dyn = 0;
   420    420     pParse->zTail = zSql;
   421    421     while( sqlite_malloc_failed==0 && zSql[i]!=0 ){
   422    422       assert( i>=0 );
   423    423       pParse->sLastToken.z = &zSql[i];
................................................................................
   425    425       pParse->sLastToken.n = sqliteGetToken((unsigned char*)&zSql[i], &tokenType);
   426    426       i += pParse->sLastToken.n;
   427    427       switch( tokenType ){
   428    428         case TK_SPACE:
   429    429         case TK_COMMENT: {
   430    430           if( (db->flags & SQLITE_Interrupt)!=0 ){
   431    431             pParse->rc = SQLITE_INTERRUPT;
   432         -          sqliteSetString(pzErrMsg, "interrupt", 0);
          432  +          sqliteSetString(pzErrMsg, "interrupt", (char*)0);
   433    433             goto abort_parse;
   434    434           }
   435    435           break;
   436    436         }
   437    437         case TK_ILLEGAL: {
   438    438           sqliteSetNString(pzErrMsg, "unrecognized token: \"", -1, 
   439    439              pParse->sLastToken.z, pParse->sLastToken.n, "\"", 1, 0);
................................................................................
   460    460         sqliteParser(pEngine, TK_SEMI, pParse->sLastToken, pParse);
   461    461         pParse->zTail = &zSql[i];
   462    462       }
   463    463       sqliteParser(pEngine, 0, pParse->sLastToken, pParse);
   464    464     }
   465    465     sqliteParserFree(pEngine, free);
   466    466     if( pParse->rc!=SQLITE_OK && pParse->rc!=SQLITE_DONE && pParse->zErrMsg==0 ){
   467         -    sqliteSetString(&pParse->zErrMsg, sqlite_error_string(pParse->rc), 0);
          467  +    sqliteSetString(&pParse->zErrMsg, sqlite_error_string(pParse->rc),
          468  +                    (char*)0);
   468    469     }
   469    470     if( pParse->zErrMsg ){
   470    471       if( pzErrMsg && *pzErrMsg==0 ){
   471    472         *pzErrMsg = pParse->zErrMsg;
   472    473       }else{
   473    474         sqliteFree(pParse->zErrMsg);
   474    475       }

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.242 2003/10/18 09:37:26 danielk1977 Exp $
           46  +** $Id: vdbe.c,v 1.243 2003/12/06 21:43:56 drh Exp $
    47     47   */
    48     48   #include "sqliteInt.h"
    49     49   #include "os.h"
    50     50   #include <ctype.h>
    51     51   #include "vdbeInt.h"
    52     52   
    53     53   /*
................................................................................
   627    627   ** The return address stack is of limited depth.  If too many
   628    628   ** OP_Gosub operations occur without intervening OP_Returns, then
   629    629   ** the return address stack will fill up and processing will abort
   630    630   ** with a fatal error.
   631    631   */
   632    632   case OP_Gosub: {
   633    633     if( p->returnDepth>=sizeof(p->returnStack)/sizeof(p->returnStack[0]) ){
   634         -    sqliteSetString(&p->zErrMsg, "return address stack overflow", 0);
          634  +    sqliteSetString(&p->zErrMsg, "return address stack overflow", (char*)0);
   635    635       p->rc = SQLITE_INTERNAL;
   636    636       return SQLITE_ERROR;
   637    637     }
   638    638     p->returnStack[p->returnDepth++] = pc+1;
   639    639     pc = pOp->p2 - 1;
   640    640     break;
   641    641   }
................................................................................
   644    644   **
   645    645   ** Jump immediately to the next instruction after the last unreturned
   646    646   ** OP_Gosub.  If an OP_Return has occurred for all OP_Gosubs, then
   647    647   ** processing aborts with a fatal error.
   648    648   */
   649    649   case OP_Return: {
   650    650     if( p->returnDepth<=0 ){
   651         -    sqliteSetString(&p->zErrMsg, "return address stack underflow", 0);
          651  +    sqliteSetString(&p->zErrMsg, "return address stack underflow", (char*)0);
   652    652       p->rc = SQLITE_INTERNAL;
   653    653       return SQLITE_ERROR;
   654    654     }
   655    655     p->returnDepth--;
   656    656     pc = p->returnStack[p->returnDepth] - 1;
   657    657     break;
   658    658   }
................................................................................
   676    676   */
   677    677   case OP_Halt: {
   678    678     p->magic = VDBE_MAGIC_HALT;
   679    679     if( pOp->p1!=SQLITE_OK ){
   680    680       p->rc = pOp->p1;
   681    681       p->errorAction = pOp->p2;
   682    682       if( pOp->p3 ){
   683         -      sqliteSetString(&p->zErrMsg, pOp->p3, 0);
          683  +      sqliteSetString(&p->zErrMsg, pOp->p3, (char*)0);
   684    684       }
   685    685       return SQLITE_ERROR;
   686    686     }else{
   687    687       p->rc = SQLITE_OK;
   688    688       return SQLITE_DONE;
   689    689     }
   690    690   }
................................................................................
  1165   1165     }else if( ctx.s.flags & STK_Str ){
  1166   1166       zStack[p->tos] = aStack[p->tos].z;
  1167   1167     }else{
  1168   1168       zStack[p->tos] = 0;
  1169   1169     }
  1170   1170     if( ctx.isError ){
  1171   1171       sqliteSetString(&p->zErrMsg, 
  1172         -       zStack[p->tos] ? zStack[p->tos] : "user function error", 0);
         1172  +       zStack[p->tos] ? zStack[p->tos] : "user function error", (char*)0);
  1173   1173       rc = SQLITE_ERROR;
  1174   1174     }
  1175   1175     break;
  1176   1176   }
  1177   1177   
  1178   1178   /* Opcode: BitAnd * * *
  1179   1179   **
................................................................................
  2225   2225         case SQLITE_BUSY: {
  2226   2226           if( db->xBusyCallback==0 ){
  2227   2227             p->pc = pc;
  2228   2228             p->undoTransOnError = 1;
  2229   2229             p->rc = SQLITE_BUSY;
  2230   2230             return SQLITE_BUSY;
  2231   2231           }else if( (*db->xBusyCallback)(db->pBusyArg, "", busy++)==0 ){
  2232         -          sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), 0);
         2232  +          sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), (char*)0);
  2233   2233             busy = 0;
  2234   2234           }
  2235   2235           break;
  2236   2236         }
  2237   2237         case SQLITE_READONLY: {
  2238   2238           rc = SQLITE_OK;
  2239   2239           /* Fall thru into the next case */
................................................................................
  2363   2363   ** invoked.
  2364   2364   */
  2365   2365   case OP_VerifyCookie: {
  2366   2366     int aMeta[SQLITE_N_BTREE_META];
  2367   2367     assert( pOp->p1>=0 && pOp->p1<db->nDb );
  2368   2368     rc = sqliteBtreeGetMeta(db->aDb[pOp->p1].pBt, aMeta);
  2369   2369     if( rc==SQLITE_OK && aMeta[1]!=pOp->p2 ){
  2370         -    sqliteSetString(&p->zErrMsg, "database schema has changed", 0);
         2370  +    sqliteSetString(&p->zErrMsg, "database schema has changed", (char*)0);
  2371   2371       rc = SQLITE_SCHEMA;
  2372   2372     }
  2373   2373     break;
  2374   2374   }
  2375   2375   
  2376   2376   /* Opcode: OpenRead P1 P2 P3
  2377   2377   **
................................................................................
  2437   2437     wrFlag = pOp->opcode==OP_OpenWrite;
  2438   2438     if( p2<=0 ){
  2439   2439       VERIFY( if( tos<0 ) goto not_enough_stack; );
  2440   2440       Integerify(p, tos);
  2441   2441       p2 = p->aStack[tos].i;
  2442   2442       POPSTACK;
  2443   2443       if( p2<2 ){
  2444         -      sqliteSetString(&p->zErrMsg, "root page number less than 2", 0);
         2444  +      sqliteSetString(&p->zErrMsg, "root page number less than 2", (char*)0);
  2445   2445         rc = SQLITE_INTERNAL;
  2446   2446         break;
  2447   2447       }
  2448   2448     }
  2449   2449     VERIFY( if( i<0 ) goto bad_instruction; )
  2450   2450     if( expandCursorArraySize(p, i) ) goto no_mem;
  2451   2451     sqliteVdbeCleanupCursor(&p->aCsr[i]);
................................................................................
  2457   2457       switch( rc ){
  2458   2458         case SQLITE_BUSY: {
  2459   2459           if( db->xBusyCallback==0 ){
  2460   2460             p->pc = pc;
  2461   2461             p->rc = SQLITE_BUSY;
  2462   2462             return SQLITE_BUSY;
  2463   2463           }else if( (*db->xBusyCallback)(db->pBusyArg, pOp->p3, ++busy)==0 ){
  2464         -          sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), 0);
         2464  +          sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), (char*)0);
  2465   2465             busy = 0;
  2466   2466           }
  2467   2467           break;
  2468   2468         }
  2469   2469         case SQLITE_OK: {
  2470   2470           busy = 0;
  2471   2471           break;
................................................................................
  3440   3440           sqliteBtreeKeySize(pCrsr, &n);
  3441   3441           if( n==nKey
  3442   3442              && sqliteBtreeKeyCompare(pCrsr, zKey, nKey-4, 4, &c)==SQLITE_OK
  3443   3443              && c==0
  3444   3444           ){
  3445   3445             rc = SQLITE_CONSTRAINT;
  3446   3446             if( pOp->p3 && pOp->p3[0] ){
  3447         -            sqliteSetString(&p->zErrMsg, pOp->p3, 0);
         3447  +            sqliteSetString(&p->zErrMsg, pOp->p3, (char*)0);
  3448   3448             }
  3449   3449             goto abort_due_to_error;
  3450   3450           }
  3451   3451           if( res<0 ){
  3452   3452             sqliteBtreeNext(pCrsr, &res);
  3453   3453             res = +1;
  3454   3454           }else{
................................................................................
  4053   4053     }
  4054   4054     if( sqliteStrICmp(pOp->p3,"stdin")==0 ){
  4055   4055       p->pFile = stdin;
  4056   4056     }else{
  4057   4057       p->pFile = fopen(pOp->p3, "r");
  4058   4058     }
  4059   4059     if( p->pFile==0 ){
  4060         -    sqliteSetString(&p->zErrMsg,"unable to open file: ", pOp->p3, 0);
         4060  +    sqliteSetString(&p->zErrMsg,"unable to open file: ", pOp->p3, (char*)0);
  4061   4061       rc = SQLITE_ERROR;
  4062   4062     }
  4063   4063     break;
  4064   4064   }
  4065   4065   
  4066   4066   /* Opcode: FileRead P1 P2 P3
  4067   4067   **
................................................................................
  4651   4651     break;
  4652   4652   }
  4653   4653   
  4654   4654   /* An other opcode is illegal...
  4655   4655   */
  4656   4656   default: {
  4657   4657     sprintf(zBuf,"%d",pOp->opcode);
  4658         -  sqliteSetString(&p->zErrMsg, "unknown opcode ", zBuf, 0);
         4658  +  sqliteSetString(&p->zErrMsg, "unknown opcode ", zBuf, (char*)0);
  4659   4659     rc = SQLITE_INTERNAL;
  4660   4660     break;
  4661   4661   }
  4662   4662   
  4663   4663   /*****************************************************************************
  4664   4664   ** The cases of the switch statement above this line should all be indented
  4665   4665   ** by 6 spaces.  But the left-most 6 spaces have been removed to improve the
................................................................................
  4683   4683       /* The following code adds nothing to the actual functionality
  4684   4684       ** of the program.  It is only here for testing and debugging.
  4685   4685       ** On the other hand, it does burn CPU cycles every time through
  4686   4686       ** the evaluator loop.  So we can leave it out when NDEBUG is defined.
  4687   4687       */
  4688   4688   #ifndef NDEBUG
  4689   4689       if( pc<-1 || pc>=p->nOp ){
  4690         -      sqliteSetString(&p->zErrMsg, "jump destination out of range", 0);
         4690  +      sqliteSetString(&p->zErrMsg, "jump destination out of range", (char*)0);
  4691   4691         rc = SQLITE_INTERNAL;
  4692   4692       }
  4693   4693       if( p->trace && p->tos>=0 ){
  4694   4694         int i;
  4695   4695         fprintf(p->trace, "Stack:");
  4696   4696         for(i=p->tos; i>=0 && i>p->tos-5; i--){
  4697   4697           if( aStack[i].flags & STK_Null ){
................................................................................
  4754   4754     p->magic = VDBE_MAGIC_HALT;
  4755   4755     return rc;
  4756   4756   
  4757   4757     /* Jump to here if a malloc() fails.  It's hard to get a malloc()
  4758   4758     ** to fail on a modern VM computer, so this code is untested.
  4759   4759     */
  4760   4760   no_mem:
  4761         -  sqliteSetString(&p->zErrMsg, "out of memory", 0);
         4761  +  sqliteSetString(&p->zErrMsg, "out of memory", (char*)0);
  4762   4762     rc = SQLITE_NOMEM;
  4763   4763     goto vdbe_halt;
  4764   4764   
  4765   4765     /* Jump to here for an SQLITE_MISUSE error.
  4766   4766     */
  4767   4767   abort_due_to_misuse:
  4768   4768     rc = SQLITE_MISUSE;
................................................................................
  4769   4769     /* Fall thru into abort_due_to_error */
  4770   4770   
  4771   4771     /* Jump to here for any other kind of fatal error.  The "rc" variable
  4772   4772     ** should hold the error number.
  4773   4773     */
  4774   4774   abort_due_to_error:
  4775   4775     if( p->zErrMsg==0 ){
  4776         -    sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), 0);
         4776  +    sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), (char*)0);
  4777   4777     }
  4778   4778     goto vdbe_halt;
  4779   4779   
  4780   4780     /* Jump to here if the sqlite_interrupt() API sets the interrupt
  4781   4781     ** flag.
  4782   4782     */
  4783   4783   abort_due_to_interrupt:
................................................................................
  4784   4784     assert( db->flags & SQLITE_Interrupt );
  4785   4785     db->flags &= ~SQLITE_Interrupt;
  4786   4786     if( db->magic!=SQLITE_MAGIC_BUSY ){
  4787   4787       rc = SQLITE_MISUSE;
  4788   4788     }else{
  4789   4789       rc = SQLITE_INTERRUPT;
  4790   4790     }
  4791         -  sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), 0);
         4791  +  sqliteSetString(&p->zErrMsg, sqlite_error_string(rc), (char*)0);
  4792   4792     goto vdbe_halt;
  4793   4793   
  4794   4794     /* Jump to here if a operator is encountered that requires more stack
  4795   4795     ** operands than are currently available on the stack.
  4796   4796     */
  4797   4797   not_enough_stack:
  4798   4798     sprintf(zBuf,"%d",pc);
  4799         -  sqliteSetString(&p->zErrMsg, "too few operands on stack at ", zBuf, 0);
         4799  +  sqliteSetString(&p->zErrMsg, "too few operands on stack at ", zBuf, (char*)0);
  4800   4800     rc = SQLITE_INTERNAL;
  4801   4801     goto vdbe_halt;
  4802   4802   
  4803   4803     /* Jump here if an illegal or illformed instruction is executed.
  4804   4804     */
  4805   4805   VERIFY(
  4806   4806   bad_instruction:
  4807   4807     sprintf(zBuf,"%d",pc);
  4808         -  sqliteSetString(&p->zErrMsg, "illegal operation at ", zBuf, 0);
         4808  +  sqliteSetString(&p->zErrMsg, "illegal operation at ", zBuf, (char*)0);
  4809   4809     rc = SQLITE_INTERNAL;
  4810   4810     goto vdbe_halt;
  4811   4811   )
  4812   4812   }

Changes to src/vdbeaux.c.

   511    511       if( db->flags & SQLITE_Interrupt ){
   512    512         db->flags &= ~SQLITE_Interrupt;
   513    513         if( db->magic!=SQLITE_MAGIC_BUSY ){
   514    514           p->rc = SQLITE_MISUSE;
   515    515         }else{
   516    516           p->rc = SQLITE_INTERRUPT;
   517    517         }
   518         -      sqliteSetString(&p->zErrMsg, sqlite_error_string(p->rc), 0);
          518  +      sqliteSetString(&p->zErrMsg, sqlite_error_string(p->rc), (char*)0);
   519    519         break;
   520    520       }
   521    521       sprintf(p->zStack[0],"%d",i);
   522    522       sprintf(p->zStack[2],"%d", p->aOp[i].p1);
   523    523       sprintf(p->zStack[3],"%d", p->aOp[i].p2);
   524    524       if( p->aOp[i].p3type==P3_POINTER ){
   525    525         sprintf(p->aStack[4].z, "ptr(%#x)", (int)p->aOp[i].p3);
................................................................................
   815    815   ** again.
   816    816   */
   817    817   int sqliteVdbeReset(Vdbe *p, char **pzErrMsg){
   818    818     sqlite *db = p->db;
   819    819     int i;
   820    820   
   821    821     if( p->magic!=VDBE_MAGIC_RUN && p->magic!=VDBE_MAGIC_HALT ){
   822         -    sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), 0);
          822  +    sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), (char*)0);
   823    823       return SQLITE_MISUSE;
   824    824     }
   825    825     if( p->zErrMsg ){
   826    826       if( pzErrMsg && *pzErrMsg==0 ){
   827    827         *pzErrMsg = p->zErrMsg;
   828    828       }else{
   829    829         sqliteFree(p->zErrMsg);
................................................................................
   899    899   ** the result code.  Write any error message text into *pzErrMsg.
   900    900   */
   901    901   int sqliteVdbeFinalize(Vdbe *p, char **pzErrMsg){
   902    902     int rc;
   903    903     sqlite *db;
   904    904   
   905    905     if( p->magic!=VDBE_MAGIC_RUN && p->magic!=VDBE_MAGIC_HALT ){
   906         -    sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), 0);
          906  +    sqliteSetString(pzErrMsg, sqlite_error_string(SQLITE_MISUSE), (char*)0);
   907    907       return SQLITE_MISUSE;
   908    908     }
   909    909     db = p->db;
   910    910     rc = sqliteVdbeReset(p, pzErrMsg);
   911    911     sqliteVdbeDelete(p);
   912    912     if( db->want_to_close && db->pVdbe==0 ){
   913    913       sqlite_close(db);

Changes to src/where.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 module contains C code that generates VDBE code used to process
    13     13   ** the WHERE clause of SQL statements.
    14     14   **
    15         -** $Id: where.c,v 1.83 2003/09/27 13:39:39 drh Exp $
           15  +** $Id: where.c,v 1.84 2003/12/06 21:43:56 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   /*
    20     20   ** The query generator uses an array of instances of this structure to
    21     21   ** help it analyze the subexpressions of the WHERE clause.  Each WHERE
    22     22   ** clause subexpression is separated from the others by an AND operator.
................................................................................
   379    379     initMaskSet(&maskSet);
   380    380     memset(aExpr, 0, sizeof(aExpr));
   381    381     nExpr = exprSplit(ARRAYSIZE(aExpr), aExpr, pWhere);
   382    382     if( nExpr==ARRAYSIZE(aExpr) ){
   383    383       char zBuf[50];
   384    384       sprintf(zBuf, "%d", (int)ARRAYSIZE(aExpr)-1);
   385    385       sqliteSetString(&pParse->zErrMsg, "WHERE clause too complex - no more "
   386         -       "than ", zBuf, " terms allowed", 0);
          386  +       "than ", zBuf, " terms allowed", (char*)0);
   387    387       pParse->nErr++;
   388    388       return 0;
   389    389     }
   390    390     
   391    391     /* Allocate and initialize the WhereInfo structure that will become the
   392    392     ** return value.
   393    393     */