/ Check-in [43a77f01]
Login

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

Overview
Comment:Fix for bug #16: Check for invalid functions in the VALUES clause of an INSERT statement. (CVS 525)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:43a77f019d34e1a6b3f502ad0ec31a00c8fdbe6e
User & Date: drh 2002-04-12 03:55:16
Context
2002-04-12
10:08
Fix for bug #15: Add the sqlite_changes() API function for retrieving the number of rows that changed in the previous operation. (CVS 526) check-in: 6e71493b user: drh tags: trunk
03:55
Fix for bug #16: Check for invalid functions in the VALUES clause of an INSERT statement. (CVS 525) check-in: 43a77f01 user: drh tags: trunk
2002-04-09
03:28
Fix for bug #11: Output the correct row count when and INSERT does an IGNORE action. (CVS 524) check-in: bb83642e user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

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.50 2002/04/09 03:28:01 drh Exp $
           15  +** $Id: insert.c,v 1.51 2002/04/12 03:55:16 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)
................................................................................
    95     95       srcTab = -1;
    96     96       assert( pList );
    97     97       nColumn = pList->nExpr;
    98     98       dummy.nId = 0;
    99     99       for(i=0; i<nColumn; i++){
   100    100         if( sqliteExprResolveIds(pParse, 0, &dummy, 0, pList->a[i].pExpr) ){
   101    101           goto insert_cleanup;
          102  +      }
          103  +      if( sqliteExprCheck(pParse, pList->a[i].pExpr, 0, 0) ){
          104  +        goto insert_cleanup;
   102    105         }
   103    106       }
   104    107     }
   105    108   
   106    109     /* Make sure the number of columns in the source data matches the number
   107    110     ** of columns to be inserted into the table.
   108    111     */