Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
cd247c19
Commit
cd247c19
authored
13 years ago
by
pcherenkov
Browse files
Options
Downloads
Patches
Plain Diff
bug944126: documented insert/delete ops in UPDATE
parent
044a5e07
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/box-protocol.txt
+10
-3
10 additions, 3 deletions
doc/box-protocol.txt
doc/user/stored-programs.xml
+12
-0
12 additions, 0 deletions
doc/user/stored-programs.xml
with
22 additions
and
3 deletions
doc/box-protocol.txt
+
10
−
3
View file @
cd247c19
...
...
@@ -262,8 +262,11 @@ Tarantool/Box IPROTO protocol.
<field_no> ::= <int32>
;
; 0 - assign operation argument to field <field_no>
; The rest of operations are only defined for 32-bit integer
; The operation(s) below operate on fields of arbitrary types:
; 0 - assign operation argument to field <field_no>;
; will extend the tuple if <field_no> == <max_field_no> + 1
;
; The following operation(s) are only defined for 32-bit integer
; types:
; 1 - add argument to field <field_no>, both arguments
; are treated as signed 32-bit ints
...
...
@@ -273,8 +276,12 @@ Tarantool/Box IPROTO protocol.
; Tarantool 1.3.5 features one more command, which operates
; on strings:
; 5 - implementation of Perl 'splice' command
;
; The operation(s) below operate on fields of arbitrary types:
; 6 - delete <field_no>
; 7 - insert before <field_no>
<op_code> ::= <int8> # 0 | 1 | 2 | 3 | 4 | 5
<op_code> ::= <int8> # 0 | 1 | 2 | 3 | 4 | 5
| 6 | 7
;
; It's an error to specify an argument of a type that
...
...
This diff is collapsed.
Click to expand it.
doc/user/stored-programs.xml
+
12
−
0
View file @
cd247c19
...
...
@@ -346,6 +346,10 @@ localhost> lua box.select(5, 1, 'firstname', 'lastname')
<member><code>
:p
</code>
—
splice a
field: start at offset, cut length bytes, and add a
string.
</member>
<member><code>
#p
</code>
—
delete a
field.
</member>
<member><code>
!p
</code>
—
insert a field
(before the one specified).
</member>
</simplelist>
Possible format specifiers are:
<quote>
+
</quote>
for addition,
<quote>
-
</quote>
for subtraction,
...
...
@@ -374,6 +378,14 @@ localhost> lua box.update(0, 0, '+p', 1, 1)
---
- 0: {2}
...
localhost> lua box.update(0, 2, '!p', 1, 'Bienvenue tout le monde!')
---
- 2: {'Bienvenue tout le monde!', 'Hello world!'}
...
localhost> lua box.update(0, 2, '#p', 2, 'Biennvenue tout le monde!')
---
- 2: {'Bienvenue tout le monde!'}
...
</programlisting>
</para>
</listitem>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment