[tarantool-patches] [PATCH 1/8] sql: remove SQLITE_ENABLE_UPDATE_DELETE_LIMIT define

Nikita Pettik korablev at tarantool.org
Fri Dec 28 12:34:45 MSK 2018


Code under this define is dead. What is more, it uses affinity, so lets
remove it.

Needed for #3698
---
 src/box/sql/parse.y   |  2 --
 src/box/sql/resolve.c | 20 --------------------
 2 files changed, 22 deletions(-)

diff --git a/src/box/sql/parse.y b/src/box/sql/parse.y
index 50bb2ba01..b664a4101 100644
--- a/src/box/sql/parse.y
+++ b/src/box/sql/parse.y
@@ -727,7 +727,6 @@ where_opt(A) ::= WHERE expr(X).       {A = X.pExpr;}
 
 ////////////////////////// The UPDATE command ////////////////////////////////
 //
-%ifndef SQLITE_ENABLE_UPDATE_DELETE_LIMIT
 cmd ::= with(C) UPDATE orconf(R) fullname(X) indexed_opt(I) SET setlist(Y)
         where_opt(W).  {
   sqlite3WithPush(pParse, C, 1);
@@ -738,7 +737,6 @@ cmd ::= with(C) UPDATE orconf(R) fullname(X) indexed_opt(I) SET setlist(Y)
   pParse->initiateTTrans = true;
   sqlite3Update(pParse,X,Y,W,R);
 }
-%endif
 
 %type setlist {ExprList*}
 %destructor setlist {sql_expr_list_delete(pParse->db, $$);}
diff --git a/src/box/sql/resolve.c b/src/box/sql/resolve.c
index 9a2d6ff4e..c1253ab95 100644
--- a/src/box/sql/resolve.c
+++ b/src/box/sql/resolve.c
@@ -579,26 +579,6 @@ resolveExprStep(Walker * pWalker, Expr * pExpr)
 	}
 #endif
 	switch (pExpr->op) {
-
-#if defined(SQLITE_ENABLE_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 = AFFINITY_INTEGER;
-			break;
-		}
-#endif				/* defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT) */
-
 		/* A lone identifier is the name of a column.
 		 */
 	case TK_ID:{
-- 
2.15.1





More information about the Tarantool-patches mailing list