/ Check-in [69aac043]
Login

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

Overview
Comment:Use sqliteErrorMsg instead of sqliteSetString whereever practical. (CVS 1264)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:69aac043af7f93e7b3f036622c0ac9261cae1839
User & Date: drh 2004-02-22 18:40:57
Context
2004-02-22
18:56
Code cleanup in build.c. (CVS 1265) check-in: 9211e14c user: drh tags: trunk
18:40
Use sqliteErrorMsg instead of sqliteSetString whereever practical. (CVS 1264) check-in: 69aac043 user: drh tags: trunk
17:49
Code cleanup in the date and time functions. (CVS 1263) check-in: 9b3bcde1 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.11 2003/12/06 21:43:56 drh Exp $
           17  +** $Id: auth.c,v 1.12 2004/02/22 18:40:57 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   */
................................................................................
    81     81   }
    82     82   
    83     83   /*
    84     84   ** Write an error message into pParse->zErrMsg that explains that the
    85     85   ** user-supplied authorization function returned an illegal value.
    86     86   */
    87     87   static void sqliteAuthBadReturnCode(Parse *pParse, int rc){
    88         -  char zBuf[20];
    89         -  sprintf(zBuf, "(%d)", rc);
    90         -  sqliteSetString(&pParse->zErrMsg, "illegal return value ", zBuf,
    91         -    " from the authorization function - should be SQLITE_OK, "
    92         -    "SQLITE_IGNORE, or SQLITE_DENY", (char*)0);
    93         -  pParse->nErr++;
           88  +  sqliteErrorMsg(pParse, "illegal return value (%d) from the "
           89  +    "authorization function - should be SQLITE_OK, SQLITE_IGNORE, "
           90  +    "or SQLITE_DENY", rc);
    94     91     pParse->rc = SQLITE_MISUSE;
    95     92   }
    96     93   
    97     94   /*
    98     95   ** The pExpr should be a TK_COLUMN expression.  The table referred to
    99     96   ** is in pTabList or else it is the NEW or OLD table of a trigger.  
   100     97   ** Check to see if it is OK to read this particular column.
................................................................................
   146    143     zDBase = db->aDb[pExpr->iDb].zName;
   147    144     rc = db->xAuth(db->pAuthArg, SQLITE_READ, pTab->zName, zCol, zDBase, 
   148    145                    pParse->zAuthContext);
   149    146     if( rc==SQLITE_IGNORE ){
   150    147       pExpr->op = TK_NULL;
   151    148     }else if( rc==SQLITE_DENY ){
   152    149       if( db->nDb>2 || pExpr->iDb!=0 ){
   153         -      sqliteSetString(&pParse->zErrMsg,"access to ", zDBase, ".",
   154         -          pTab->zName, ".", zCol, " is prohibited", (char*)0);
          150  +      sqliteErrorMsg(pParse, "access to %s.%s.%s is prohibited", 
          151  +         zDBase, pTab->zName, zCol);
   155    152       }else{
   156         -      sqliteSetString(&pParse->zErrMsg,"access to ", pTab->zName, ".",
   157         -                      zCol, " is prohibited", (char*)0);
          153  +      sqliteErrorMsg(pParse, "access to %s.%s is prohibited", pTab->zName,zCol);
   158    154       }
   159         -    pParse->nErr++;
   160    155       pParse->rc = SQLITE_AUTH;
   161    156     }else if( rc!=SQLITE_OK ){
   162    157       sqliteAuthBadReturnCode(pParse, rc);
   163    158     }
   164    159   }
   165    160   
   166    161   /*
................................................................................
   180    175     int rc;
   181    176   
   182    177     if( db->xAuth==0 ){
   183    178       return SQLITE_OK;
   184    179     }
   185    180     rc = db->xAuth(db->pAuthArg, code, zArg1, zArg2, zArg3, pParse->zAuthContext);
   186    181     if( rc==SQLITE_DENY ){
   187         -    sqliteSetString(&pParse->zErrMsg, "not authorized", (char*)0);
          182  +    sqliteErrorMsg(pParse, "not authorized");
   188    183       pParse->rc = SQLITE_AUTH;
   189         -    pParse->nErr++;
   190    184     }else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){
   191    185       rc = SQLITE_DENY;
   192    186       sqliteAuthBadReturnCode(pParse, rc);
   193    187     }
   194    188     return rc;
   195    189   }
   196    190   

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.171 2004/02/21 13:31:10 drh Exp $
           26  +** $Id: build.c,v 1.172 2004/02/22 18:40:57 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
................................................................................
   470    470   
   471    471     /* Before trying to create a temporary table, make sure the Btree for
   472    472     ** holding temporary tables is open.
   473    473     */
   474    474     if( isTemp && db->aDb[1].pBt==0 && !pParse->explain ){
   475    475       int rc = sqliteBtreeFactory(db, 0, 0, MAX_PAGES, &db->aDb[1].pBt);
   476    476       if( rc!=SQLITE_OK ){
   477         -      sqliteSetString(&pParse->zErrMsg, "unable to open a temporary database "
   478         -        "file for storing temporary tables", (char*)0);
          477  +      sqliteErrorMsg(pParse, "unable to open a temporary database "
          478  +        "file for storing temporary tables");
   479    479         pParse->nErr++;
   480    480         return;
   481    481       }
   482    482       if( db->flags & SQLITE_InTrans ){
   483    483         rc = sqliteBtreeBeginTrans(db->aDb[1].pBt);
   484    484         if( rc!=SQLITE_OK ){
   485         -        sqliteSetNString(&pParse->zErrMsg, "unable to get a write lock on "
   486         -          "the temporary database file", 0);
          485  +        sqliteErrorMsg(pParse, "unable to get a write lock on "
          486  +          "the temporary database file");
   487    487           pParse->nErr++;
   488    488           return;
   489    489         }
   490    490       }
   491    491     }
   492    492   
   493    493     /* Make sure the new table name does not collide with an existing
................................................................................
   496    496     ** If we are re-reading the sqlite_master table because of a schema
   497    497     ** change and a new permanent table is found whose name collides with
   498    498     ** an existing temporary table, that is not an error.
   499    499     */
   500    500     pTable = sqliteFindTable(db, zName, 0);
   501    501     iDb = isTemp ? 1 : db->init.iDb;
   502    502     if( pTable!=0 && (pTable->iDb==iDb || !db->init.busy) ){
   503         -    sqliteSetNString(&pParse->zErrMsg, "table ", 0, pName->z, pName->n,
   504         -        " already exists", 0, 0);
          503  +    sqliteErrorMsg(pParse, "table %T already exists", pName);
   505    504       sqliteFree(zName);
   506         -    pParse->nErr++;
   507    505       return;
   508    506     }
   509    507     if( (pIdx = sqliteFindIndex(db, zName, 0))!=0 &&
   510    508             (pIdx->iDb==0 || !db->init.busy) ){
   511         -    sqliteSetString(&pParse->zErrMsg, "there is already an index named ", 
   512         -       zName, (char*)0);
          509  +    sqliteErrorMsg(pParse, "there is already an index named %s", zName);
   513    510       sqliteFree(zName);
   514         -    pParse->nErr++;
   515    511       return;
   516    512     }
   517    513     pTable = sqliteMalloc( sizeof(Table) );
   518    514     if( pTable==0 ){
   519    515       sqliteFree(zName);
   520    516       return;
   521    517     }
................................................................................
   565    561     Column *pCol;
   566    562     if( (p = pParse->pNewTable)==0 ) return;
   567    563     sqliteSetNString(&z, pName->z, pName->n, 0);
   568    564     if( z==0 ) return;
   569    565     sqliteDequote(z);
   570    566     for(i=0; i<p->nCol; i++){
   571    567       if( sqliteStrICmp(z, p->aCol[i].zName)==0 ){
   572         -      sqliteSetString(&pParse->zErrMsg, "duplicate column name: ", z, (char*)0);
   573         -      pParse->nErr++;
          568  +      sqliteErrorMsg(pParse, "duplicate column name: %s", z);
   574    569         sqliteFree(z);
   575    570         return;
   576    571       }
   577    572     }
   578    573     if( (p->nCol & 0x7)==0 ){
   579    574       Column *aNew;
   580    575       aNew = sqliteRealloc( p->aCol, (p->nCol+8)*sizeof(p->aCol[0]));
................................................................................
   685    680   */
   686    681   void sqliteAddPrimaryKey(Parse *pParse, IdList *pList, int onError){
   687    682     Table *pTab = pParse->pNewTable;
   688    683     char *zType = 0;
   689    684     int iCol = -1, i;
   690    685     if( pTab==0 ) goto primary_key_exit;
   691    686     if( pTab->hasPrimKey ){
   692         -    sqliteSetString(&pParse->zErrMsg, "table \"", pTab->zName, 
   693         -        "\" has more than one primary key", (char*)0);
   694         -    pParse->nErr++;
          687  +    sqliteErrorMsg(pParse, 
          688  +      "table \"%s\" has more than one primary key", pTab->zName);
   695    689       goto primary_key_exit;
   696    690     }
   697    691     pTab->hasPrimKey = 1;
   698    692     if( pList==0 ){
   699    693       iCol = pTab->nCol - 1;
   700    694       pTab->aCol[iCol].isPrimKey = 1;
   701    695     }else{
................................................................................
  1103   1097     **     CREATE VIEW one AS SELECT * FROM two;
  1104   1098     **     CREATE VIEW two AS SELECT * FROM one;
  1105   1099     **
  1106   1100     ** Actually, this error is caught previously and so the following test
  1107   1101     ** should always fail.  But we will leave it in place just to be safe.
  1108   1102     */
  1109   1103     if( pTable->nCol<0 ){
  1110         -    sqliteSetString(&pParse->zErrMsg, "view ", pTable->zName,
  1111         -         " is circularly defined", (char*)0);
  1112         -    pParse->nErr++;
         1104  +    sqliteErrorMsg(pParse, "view %s is circularly defined", pTable->zName);
  1113   1105       return 1;
  1114   1106     }
  1115   1107   
  1116   1108     /* If we get this far, it means we need to compute the table names.
  1117   1109     */
  1118   1110     assert( pTable->pSelect ); /* If nCol==0, then pTable must be a VIEW */
  1119   1111     pSel = pTable->pSelect;
................................................................................
  1194   1186     char *zName;
  1195   1187     Table *pTab;
  1196   1188     zName = sqliteTableNameFromToken(pTok);
  1197   1189     if( zName==0 ) return 0;
  1198   1190     pTab = sqliteFindTable(pParse->db, zName, 0);
  1199   1191     sqliteFree(zName);
  1200   1192     if( pTab==0 ){
  1201         -    sqliteSetNString(&pParse->zErrMsg, "no such table: ", 0, 
  1202         -        pTok->z, pTok->n, 0);
  1203         -    pParse->nErr++;
         1193  +    sqliteErrorMsg(pParse, "no such table: %T", pTok);
  1204   1194     }
  1205   1195     return pTab;
  1206   1196   }
  1207   1197   
  1208   1198   /*
  1209   1199   ** This routine is called to do the work of a DROP TABLE statement.
  1210   1200   ** pName is the name of the table to be dropped.
................................................................................
  1247   1237       }
  1248   1238       if( sqliteAuthCheck(pParse, SQLITE_DELETE, pTable->zName, 0, zDb) ){
  1249   1239         return;
  1250   1240       }
  1251   1241     }
  1252   1242   #endif
  1253   1243     if( pTable->readOnly ){
  1254         -    sqliteSetString(&pParse->zErrMsg, "table ", pTable->zName, 
  1255         -       " may not be dropped", (char*)0);
         1244  +    sqliteErrorMsg(pParse, "table %s may not be dropped", pTable->zName);
  1256   1245       pParse->nErr++;
  1257   1246       return;
  1258   1247     }
  1259   1248     if( isView && pTable->pSelect==0 ){
  1260         -    sqliteSetString(&pParse->zErrMsg, "use DROP TABLE to delete table ",
  1261         -      pTable->zName, (char*)0);
  1262         -    pParse->nErr++;
         1249  +    sqliteErrorMsg(pParse, "use DROP TABLE to delete table %s", pTable->zName);
  1263   1250       return;
  1264   1251     }
  1265   1252     if( !isView && pTable->pSelect ){
  1266         -    sqliteSetString(&pParse->zErrMsg, "use DROP VIEW to delete view ",
  1267         -      pTable->zName, (char*)0);
  1268         -    pParse->nErr++;
         1253  +    sqliteErrorMsg(pParse, "use DROP VIEW to delete view %s", pTable->zName);
  1269   1254       return;
  1270   1255     }
  1271   1256   
  1272   1257     /* Generate code to remove the table from the master table
  1273   1258     ** on disk.
  1274   1259     */
  1275   1260     v = sqliteGetVdbe(pParse);
................................................................................
  1404   1389   
  1405   1390     assert( pTo!=0 );
  1406   1391     if( p==0 || pParse->nErr ) goto fk_end;
  1407   1392     if( pFromCol==0 ){
  1408   1393       int iCol = p->nCol-1;
  1409   1394       if( iCol<0 ) goto fk_end;
  1410   1395       if( pToCol && pToCol->nId!=1 ){
  1411         -      sqliteSetNString(&pParse->zErrMsg, "foreign key on ", -1,
  1412         -         p->aCol[iCol].zName, -1, 
  1413         -         " should reference only one column of table ", -1,
  1414         -         pTo->z, pTo->n, 0);
  1415         -      pParse->nErr++;
         1396  +      sqliteErrorMsg(pParse, "foreign key on %s"
         1397  +         " should reference only one column of table %T",
         1398  +         p->aCol[iCol].zName, pTo);
  1416   1399         goto fk_end;
  1417   1400       }
  1418   1401       nCol = 1;
  1419   1402     }else if( pToCol && pToCol->nId!=pFromCol->nId ){
  1420         -    sqliteSetString(&pParse->zErrMsg, 
         1403  +    sqliteErrorMsg(pParse,
  1421   1404           "number of columns in foreign key does not match the number of "
  1422         -        "columns in the referenced table", (char*)0);
  1423         -    pParse->nErr++;
         1405  +        "columns in the referenced table");
  1424   1406       goto fk_end;
  1425   1407     }else{
  1426   1408       nCol = pFromCol->nId;
  1427   1409     }
  1428   1410     nByte = sizeof(*pFKey) + nCol*sizeof(pFKey->aCol[0]) + pTo->n + 1;
  1429   1411     if( pToCol ){
  1430   1412       for(i=0; i<pToCol->nId; i++){
................................................................................
  1452   1434         for(j=0; j<p->nCol; j++){
  1453   1435           if( sqliteStrICmp(p->aCol[j].zName, pFromCol->a[i].zName)==0 ){
  1454   1436             pFKey->aCol[i].iFrom = j;
  1455   1437             break;
  1456   1438           }
  1457   1439         }
  1458   1440         if( j>=p->nCol ){
  1459         -        sqliteSetString(&pParse->zErrMsg, "unknown column \"", 
  1460         -          pFromCol->a[i].zName, "\" in foreign key definition", (char*)0);
  1461         -        pParse->nErr++;
         1441  +        sqliteErrorMsg(pParse, 
         1442  +          "unknown column \"%s\" in foreign key definition", 
         1443  +          pFromCol->a[i].zName);
  1462   1444           goto fk_end;
  1463   1445         }
  1464   1446       }
  1465   1447     }
  1466   1448     if( pToCol ){
  1467   1449       for(i=0; i<nCol; i++){
  1468   1450         int n = strlen(pToCol->a[i].zName);
................................................................................
  1549   1531       pTab =  sqliteSrcListLookup(pParse, pTable);
  1550   1532     }else{
  1551   1533       assert( pName==0 );
  1552   1534       pTab =  pParse->pNewTable;
  1553   1535     }
  1554   1536     if( pTab==0 || pParse->nErr ) goto exit_create_index;
  1555   1537     if( pTab->readOnly ){
  1556         -    sqliteSetString(&pParse->zErrMsg, "table ", pTab->zName,
  1557         -      " may not be indexed", (char*)0);
  1558         -    pParse->nErr++;
         1538  +    sqliteErrorMsg(pParse, "table %s may not be indexed", pTab->zName);
  1559   1539       goto exit_create_index;
  1560   1540     }
  1561   1541     if( pTab->iDb>=2 && db->init.busy==0 ){
  1562         -    sqliteSetString(&pParse->zErrMsg, "table ", pTab->zName, 
  1563         -      " may not have indices added", (char*)0);
  1564         -    pParse->nErr++;
         1542  +    sqliteErrorMsg(pParse, "table %s may not have indices added", pTab->zName);
  1565   1543       goto exit_create_index;
  1566   1544     }
  1567   1545     if( pTab->pSelect ){
  1568         -    sqliteSetString(&pParse->zErrMsg, "views may not be indexed", (char*)0);
  1569         -    pParse->nErr++;
         1546  +    sqliteErrorMsg(pParse, "views may not be indexed");
  1570   1547       goto exit_create_index;
  1571   1548     }
  1572   1549     isTemp = pTab->iDb==1;
  1573   1550   
  1574   1551     /*
  1575   1552     ** Find the name of the index.  Make sure there is not already another
  1576   1553     ** index or table with the same name.  
................................................................................
  1586   1563     */
  1587   1564     if( pName && !db->init.busy ){
  1588   1565       Index *pISameName;    /* Another index with the same name */
  1589   1566       Table *pTSameName;    /* A table with same name as the index */
  1590   1567       zName = sqliteStrNDup(pName->z, pName->n);
  1591   1568       if( zName==0 ) goto exit_create_index;
  1592   1569       if( (pISameName = sqliteFindIndex(db, zName, 0))!=0 ){
  1593         -      sqliteSetString(&pParse->zErrMsg, "index ", zName, 
  1594         -         " already exists", (char*)0);
  1595         -      pParse->nErr++;
         1570  +      sqliteErrorMsg(pParse, "index %s already exists", zName);
  1596   1571         goto exit_create_index;
  1597   1572       }
  1598   1573       if( (pTSameName = sqliteFindTable(db, zName, 0))!=0 ){
  1599         -      sqliteSetString(&pParse->zErrMsg, "there is already a table named ",
  1600         -         zName, (char*)0);
  1601         -      pParse->nErr++;
         1574  +      sqliteErrorMsg(pParse, "there is already a table named %s", zName);
  1602   1575         goto exit_create_index;
  1603   1576       }
  1604   1577     }else if( pName==0 ){
  1605   1578       char zBuf[30];
  1606   1579       int n;
  1607   1580       Index *pLoop;
  1608   1581       for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){}
................................................................................
  1663   1636     ** if any column is not found.
  1664   1637     */
  1665   1638     for(i=0; i<pList->nId; i++){
  1666   1639       for(j=0; j<pTab->nCol; j++){
  1667   1640         if( sqliteStrICmp(pList->a[i].zName, pTab->aCol[j].zName)==0 ) break;
  1668   1641       }
  1669   1642       if( j>=pTab->nCol ){
  1670         -      sqliteSetString(&pParse->zErrMsg, "table ", pTab->zName, 
  1671         -        " has no column named ", pList->a[i].zName, (char*)0);
  1672         -      pParse->nErr++;
         1643  +      sqliteErrorMsg(pParse, "table %s has no column named %s",
         1644  +        pTab->zName, pList->a[i].zName);
  1673   1645         sqliteFree(pIndex);
  1674   1646         goto exit_create_index;
  1675   1647       }
  1676   1648       pIndex->aiColumn[i] = j;
  1677   1649     }
  1678   1650   
  1679   1651     /* Link the new Index structure to its table and to the other

Changes to src/expr.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 routines used for analyzing expressions and
    13     13   ** for generating VDBE code that evaluates expressions in SQLite.
    14     14   **
    15         -** $Id: expr.c,v 1.109 2004/02/21 19:17:18 drh Exp $
           15  +** $Id: expr.c,v 1.110 2004/02/22 18:40:57 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include <ctype.h>
    19     19   
    20     20   /*
    21     21   ** Construct a new expression node and return a pointer to it.  Memory
    22     22   ** for this node is obtained from sqliteMalloc().  The calling function
................................................................................
   843    843           }else{
   844    844             wrong_num_args = 1;
   845    845           }
   846    846         }else{
   847    847           is_agg = pDef->xFunc==0;
   848    848         }
   849    849         if( is_agg && !allowAgg ){
   850         -        sqliteSetNString(&pParse->zErrMsg, "misuse of aggregate function ", -1,
   851         -           zId, nId, "()", 2, 0);
   852         -        pParse->nErr++;
          850  +        sqliteErrorMsg(pParse, "misuse of aggregate function %.*s()", nId, zId);
   853    851           nErr++;
   854    852           is_agg = 0;
   855    853         }else if( no_such_func ){
   856         -        sqliteSetNString(&pParse->zErrMsg, "no such function: ", -1, zId,nId,0);
   857         -        pParse->nErr++;
          854  +        sqliteErrorMsg(pParse, "no such function: %.*s", nId, zId);
   858    855           nErr++;
   859    856         }else if( wrong_num_args ){
   860         -        sqliteSetNString(&pParse->zErrMsg, 
   861         -           "wrong number of arguments to function ", -1, zId, nId, "()", 2, 0);
   862         -        pParse->nErr++;
          857  +        sqliteErrorMsg(pParse,"wrong number of arguments to function %.*s()",
          858  +             nId, zId);
   863    859           nErr++;
   864    860         }
   865         -      if( is_agg ) pExpr->op = TK_AGG_FUNCTION;
   866         -      if( is_agg && pIsAgg ) *pIsAgg = 1;
          861  +      if( is_agg ){
          862  +        pExpr->op = TK_AGG_FUNCTION;
          863  +        if( pIsAgg ) *pIsAgg = 1;
          864  +      }
   867    865         for(i=0; nErr==0 && i<n; i++){
   868    866           nErr = sqliteExprCheck(pParse, pExpr->pList->a[i].pExpr,
   869    867                                  allowAgg && !is_agg, pIsAgg);
   870    868         }
   871    869         if( pDef==0 ){
   872    870           if( is_type_of ){
   873    871             pExpr->op = TK_STRING;

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.111 2004/02/22 16:27:00 drh Exp $
           17  +** @(#) $Id: parse.y,v 1.112 2004/02/22 18:40:57 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         -      sqliteSetNString(&pParse->zErrMsg, 
    27         -          "near \"", -1, TOKEN.z, TOKEN.n, "\": syntax error", -1, 0);
           26  +      sqliteErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
    28     27       }else{
    29         -      sqliteSetString(&pParse->zErrMsg, "incomplete SQL statement", (char*)0);
           28  +      sqliteErrorMsg(pParse, "incomplete SQL statement");
    30     29       }
    31     30     }
    32         -  pParse->nErr++;
    33     31   }
    34     32   %name sqliteParser
    35     33   %include {
    36     34   #include "sqliteInt.h"
    37     35   #include "parse.h"
    38     36   
    39     37   /*

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.87 2004/01/14 21:59:24 drh Exp $
           15  +** $Id: where.c,v 1.88 2004/02/22 18:40:57 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.
................................................................................
   376    376     ** array fills up, the last entry might point to an expression which
   377    377     ** contains additional unfactored AND operators.
   378    378     */
   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         -    char zBuf[50];
   384         -    sprintf(zBuf, "%d", (int)ARRAYSIZE(aExpr)-1);
   385         -    sqliteSetString(&pParse->zErrMsg, "WHERE clause too complex - no more "
   386         -       "than ", zBuf, " terms allowed", (char*)0);
   387         -    pParse->nErr++;
          383  +    sqliteErrorMsg(pParse, "WHERE clause too complex - no more "
          384  +       "than %d terms allowed", (int)ARRAYSIZE(aExpr)-1);
   388    385       return 0;
   389    386     }
   390    387     
   391    388     /* Allocate and initialize the WhereInfo structure that will become the
   392    389     ** return value.
   393    390     */
   394    391     pWInfo = sqliteMalloc( sizeof(WhereInfo) + pTabList->nSrc*sizeof(WhereLevel));