aboutsummaryrefslogtreecommitdiff
path: root/src/resolve.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-10-06 13:54:35 +0000
committerdrh <drh@noemail.net>2008-10-06 13:54:35 +0000
commit41204f1fdd3d0492cc12bd5fe129d09963841497 (patch)
tree7450333920f5d44cfe1599eebbd4f1d7f4a4c83d /src/resolve.c
parent488e7b6323d7f6f7e67d8e3691092de9b55ea865 (diff)
downloadsqlite-41204f1fdd3d0492cc12bd5fe129d09963841497.tar.gz
sqlite-41204f1fdd3d0492cc12bd5fe129d09963841497.zip
Expression nodes of type TK_ROW mean the rowid of the first table in the
source list. (CVS 5769) FossilOrigin-Name: 2f7db6c98f17e0b7110258093c283091a91d4e4f
Diffstat (limited to 'src/resolve.c')
-rw-r--r--src/resolve.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/resolve.c b/src/resolve.c
index dfbc3b17a..4b30350c7 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -14,7 +14,7 @@
** resolve all identifiers by associating them with a particular
** table and column.
**
-** $Id: resolve.c,v 1.5 2008/08/29 02:14:03 drh Exp $
+** $Id: resolve.c,v 1.6 2008/10/06 13:54:35 drh Exp $
*/
#include "sqliteInt.h"
#include <stdlib.h>
@@ -418,6 +418,26 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
}
#endif
switch( pExpr->op ){
+
+#ifndef SQLITE_OMIT_UPDATE_DELETE_LIMIT
+ /* The special operator TK_ROW means use the rowid for the first
+ ** column in the FROM clause. This is used by the LIMIT and ORDER BY
+ ** clause processing on UPDATE and DELETE statements.
+ */
+ case TK_ROW: {
+ SrcList *pSrcList = pNC->pSrcList;
+ struct SrcList_item *pItem;
+ assert( pSrcList && pSrcList->nSrc==1 );
+ pItem = pSrcList->a;
+ pExpr->op = TK_COLUMN;
+ pExpr->pTab = pItem->pTab;
+ pExpr->iTable = pItem->iCursor;
+ pExpr->iColumn = -1;
+ pExpr->affinity = SQLITE_AFF_INTEGER;
+ break;
+ }
+#endif /* SQLITE_OMIT_UPDATE_DELETE_LIMIT
+
/* A lone identifier is the name of a column.
*/
case TK_ID: {