Skip to content
Snippets Groups Projects
Commit 1decf9c5 authored by Alexandr Lyapunov's avatar Alexandr Lyapunov
Browse files

Added special error detection - old (1.6.5) style of upsert lua call

parent 11d3b90a
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment