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
1decf9c5
Commit
1decf9c5
authored
9 years ago
by
Alexandr Lyapunov
Browse files
Options
Downloads
Patches
Plain Diff
Added special error detection - old (1.6.5) style of upsert lua call
parent
11d3b90a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/box/lua/schema.lua
+9
-3
9 additions, 3 deletions
src/box/lua/schema.lua
test/box/update.result
+1
-1
1 addition, 1 deletion
test/box/update.result
test/box/update.test.lua
+1
-1
1 addition, 1 deletion
test/box/update.test.lua
with
11 additions
and
5 deletions
src/box/lua/schema.lua
+
9
−
3
View file @
1decf9c5
...
...
@@ -833,7 +833,13 @@ function box.schema.space.bless(space)
index_mt
.
update
=
function
(
index
,
key
,
ops
)
return
internal
.
update
(
index
.
space_id
,
index
.
id
,
keify
(
key
),
ops
);
end
index_mt
.
upsert
=
function
(
index
,
tuple_key
,
ops
)
index_mt
.
upsert
=
function
(
index
,
tuple_key
,
ops
,
deprecated
)
if
deprecated
~=
nil
then
local
msg
=
"Error: extra argument in upsert call: "
msg
=
msg
..
tostring
(
deprecated
)
msg
=
msg
..
". Usage :upsert(tuple, operations)"
box
.
error
(
box
.
error
.
PROC_LUA
,
msg
)
end
return
internal
.
upsert
(
index
.
space_id
,
index
.
id
,
tuple_key
,
ops
);
end
index_mt
.
delete
=
function
(
index
,
key
)
...
...
@@ -895,9 +901,9 @@ function box.schema.space.bless(space)
check_index
(
space
,
0
)
return
space
.
index
[
0
]:
update
(
key
,
ops
)
end
space_mt
.
upsert
=
function
(
space
,
tuple_key
,
ops
)
space_mt
.
upsert
=
function
(
space
,
tuple_key
,
ops
,
deprecated
)
check_index
(
space
,
0
)
return
space
.
index
[
0
]:
upsert
(
tuple_key
,
ops
)
return
space
.
index
[
0
]:
upsert
(
tuple_key
,
ops
,
deprecated
)
end
space_mt
.
delete
=
function
(
space
,
key
)
check_index
(
space
,
0
)
...
...
This diff is collapsed.
Click to expand it.
test/box/update.result
+
1
−
1
View file @
1decf9c5
...
...
@@ -807,7 +807,7 @@ ops = {}
for i = 1,10 do table.insert(ops, {'=', 2, '1234567890'}) end
---
...
s:upsert({0}, ops
, {0}
)
s:upsert({0}, ops)
---
...
--#stop server default
...
...
This diff is collapsed.
Click to expand it.
test/box/update.test.lua
+
1
−
1
View file @
1decf9c5
...
...
@@ -248,7 +248,7 @@ s:update({0}, {{0, 0, 0}})
-- broken WAL during upsert
ops
=
{}
for
i
=
1
,
10
do
table.insert
(
ops
,
{
'='
,
2
,
'1234567890'
})
end
s
:
upsert
({
0
},
ops
,
{
0
}
)
s
:
upsert
({
0
},
ops
)
--#stop server default
--#start server default
s
=
box
.
space
.
tweedledum
...
...
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