From 71a0f41775d09f6ee96ba3dc3feeff637036372a Mon Sep 17 00:00:00 2001
From: Konstantin Osipov <kostja.osipov@gmail.com>
Date: Wed, 31 Aug 2011 19:37:44 +0400
Subject: [PATCH] box-protocol.txt: document splice.

---
 doc/box-protocol.txt | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/doc/box-protocol.txt b/doc/box-protocol.txt
index a1b1b5f2ae..4c3bf2c100 100644
--- a/doc/box-protocol.txt
+++ b/doc/box-protocol.txt
@@ -265,6 +265,9 @@
 ; 2 - bitwise AND of argument and field <field_no>
 ; 3 - bitwise XOR of argument and field <field_no>
 ; 4 - bitwise OR of argument and field <field_no>
+; Tarantool 1.3.5 features one more command, which operates
+; on strings:
+; 5 - implementation of Perl 'splice' command
 
 <op_code> ::= <int8> # 0 | 1 | 2 | 3
 
@@ -272,8 +275,26 @@
 ; It's an error to specify an argument of a type that
 ; differs from expected type.
 ;
+; 'splice' operates on string field, and has 4 arguments:
+; field number, offset in the field, number of bytes to remove,
+; length of the string argument to inject, the string
 
-<op_arg> ::= <field>
+<op_arg> ::= <field> | <splice_op_arg>
+
+;
+; <offset> is a non-negative integer, within the size of the
+; original field. If offset is beyond the length of the
+; field, it is set to the current length of the field.
+; <length> is an integer, indicating the number of bytes to remove.
+; If <length> ; is negative, all bytes until <length> to the
+; end of the field are removed. <field> is injected in place of the
+; removed string.
+;
+<splice_op_arg> ::= <offset><length><field>
+
+<length> ::= <int32>
+
+;
 
 <update_response_body> ::= <insert_response_body>
 
-- 
GitLab