From 2fbdc5ca75ff6982bbbc9cff4ed2ffbd24f92ed2 Mon Sep 17 00:00:00 2001
From: Roman Tokarev <rtokarev@corp.mail.ru>
Date: Tue, 28 Jun 2011 11:47:52 +0400
Subject: [PATCH] Copy DELETE to DELETE_OLD and add `flags' argument to the
 DELETE command.

---
 mod/box/box.h | 3 ++-
 mod/box/box.m | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/mod/box/box.h b/mod/box/box.h
index 8dd66e3c83..5a8531fdf1 100644
--- a/mod/box/box.h
+++ b/mod/box/box.h
@@ -124,7 +124,8 @@ enum box_mode {
         _(SELECT_LIMIT, 15)			\
 	_(SELECT, 17)				\
 	_(UPDATE_FIELDS, 19)			\
-	_(DELETE, 20)
+	_(DELETE_OLD, 20)			\
+	_(DELETE, 21)
 
 ENUM(messages, MESSAGES);
 
diff --git a/mod/box/box.m b/mod/box/box.m
index 2672173919..c6a92be021 100644
--- a/mod/box/box.m
+++ b/mod/box/box.m
@@ -771,7 +771,7 @@ txn_commit(struct box_txn *txn)
 
 		unlock_tuples(txn);
 
-		if (txn->op == DELETE)
+		if (txn->op == DELETE_OLD || txn->op == DELETE)
 			commit_delete(txn);
 		else
 			commit_replace(txn);
@@ -821,6 +821,8 @@ box_dispatch(struct box_txn *txn, struct tbuf *data)
 		break;
 
 	case DELETE:
+		txn->flags |= read_u32(data) & BOX_ALLOWED_REQUEST_FLAGS;
+	case DELETE_OLD:
 		key_len = read_u32(data);
 		if (key_len != 1)
 			tnt_raise(IllegalParams, :"key must be single valued");
-- 
GitLab