/ Check-in [2f7db6c9]
Login

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

Overview
Comment:Expression nodes of type TK_ROW mean the rowid of the first table in the source list. (CVS 5769)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:2f7db6c98f17e0b7110258093c283091a91d4e4f
User & Date: drh 2008-10-06 13:54:35
Context
2008-10-06
15:18
Fix a typo in check-in (5769) (CVS 5770) check-in: 24891902 user: drh tags: trunk
13:54
Expression nodes of type TK_ROW mean the rowid of the first table in the source list. (CVS 5769) check-in: 2f7db6c9 user: drh tags: trunk
12:46
In sqlite3_bind() interfaces, avoid acquiring the mutex until after the statement handle has been validated. Ticket #3418. (CVS 5768) check-in: 693503e2 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/resolve.c.

    10     10   **
    11     11   *************************************************************************
    12     12   **
    13     13   ** This file contains routines used for walking the parser tree and
    14     14   ** resolve all identifiers by associating them with a particular
    15     15   ** table and column.
    16     16   **
    17         -** $Id: resolve.c,v 1.5 2008/08/29 02:14:03 drh Exp $
           17  +** $Id: resolve.c,v 1.6 2008/10/06 13:54:35 drh Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include <stdlib.h>
    21     21   #include <string.h>
    22     22   
    23     23   /*
    24     24   ** Turn the pExpr expression into an alias for the iCol-th column of the
................................................................................
   414    414       int i;
   415    415       for(i=0; i<pNC->pSrcList->nSrc; i++){
   416    416         assert( pSrcList->a[i].iCursor>=0 && pSrcList->a[i].iCursor<pParse->nTab);
   417    417       }
   418    418     }
   419    419   #endif
   420    420     switch( pExpr->op ){
          421  +
          422  +#ifndef SQLITE_OMIT_UPDATE_DELETE_LIMIT
          423  +    /* The special operator TK_ROW means use the rowid for the first
          424  +    ** column in the FROM clause.  This is used by the LIMIT and ORDER BY
          425  +    ** clause processing on UPDATE and DELETE statements.
          426  +    */
          427  +    case TK_ROW: {
          428  +      SrcList *pSrcList = pNC->pSrcList;
          429  +      struct SrcList_item *pItem;
          430  +      assert( pSrcList && pSrcList->nSrc==1 );
          431  +      pItem = pSrcList->a; 
          432  +      pExpr->op = TK_COLUMN;
          433  +      pExpr->pTab = pItem->pTab;
          434  +      pExpr->iTable = pItem->iCursor;
          435  +      pExpr->iColumn = -1;
          436  +      pExpr->affinity = SQLITE_AFF_INTEGER;
          437  +      break;
          438  +    }
          439  +#endif /* SQLITE_OMIT_UPDATE_DELETE_LIMIT
          440  +
   421    441       /* A lone identifier is the name of a column.
   422    442       */
   423    443       case TK_ID: {
   424    444         lookupName(pParse, 0, 0, &pExpr->token, pNC, pExpr);
   425    445         return WRC_Prune;
   426    446       }
   427    447