diff --git a/src/box/lua/schema.lua b/src/box/lua/schema.lua index 0d776cbdaba1dc87160eb3892eb99b0fce0ea716..61d977df22432a8bf0c394837db036d52e829910 100644 --- a/src/box/lua/schema.lua +++ b/src/box/lua/schema.lua @@ -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) diff --git a/test/box/update.result b/test/box/update.result index 30fc9c0772924c1a4fde71519d8d78726a8f699e..95e5ad7afa53cb893ff0b24d94d41688aec27939 100644 --- a/test/box/update.result +++ b/test/box/update.result @@ -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 diff --git a/test/box/update.test.lua b/test/box/update.test.lua index cacf9b9a6926574bec101d590ff6994d372b1a13..66782da0d2c69aa23ce260ffe326c8e916b96747 100644 --- a/test/box/update.test.lua +++ b/test/box/update.test.lua @@ -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