Disallow ORDER BY and LIMIT on UPDATE and DELETE of views and WITHOUT ROWID
tables. This is a temporary fix for ticket [d4beea1633f1b88f] until a better
solution can be found.
FossilOrigin-Name: 62fe56b59270d9d7372b1bb8a53788a40d20d0f111fe38c61dd6269848592c70
diff --git a/src/resolve.c b/src/resolve.c
index 4a1e828..945654e 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -596,7 +596,11 @@
SrcList *pSrcList = pNC->pSrcList;
struct SrcList_item *pItem;
assert( pSrcList && pSrcList->nSrc==1 );
- pItem = pSrcList->a;
+ pItem = pSrcList->a;
+ if( !HasRowid(pItem->pTab) || pItem->pTab->pSelect!=0 ){
+ sqlite3ErrorMsg(pParse, "ORDER BY and LIMIT not support for table %s",
+ pItem->pTab->zName);
+ }
pExpr->op = TK_COLUMN;
pExpr->pTab = pItem->pTab;
pExpr->iTable = pItem->iCursor;