From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 8CEB86EC40; Mon, 16 Aug 2021 19:13:36 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8CEB86EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1629130416; bh=4i0x0FLCgVuXKoot0JBwTF/m1HrLxsfrCbgqaxs1v3E=; h=To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=a8yOw1ah/mqGpkP8noA4wHfwUU9NQnnYEI5LoJNTZ/naH8z9rNM+llufYQ4dZIRkj Arn1myw8Gcd69Pg6tVNROq5rYKcuVuTHLahvIcyDCvE9OeK8z4oGtan21VGFhxmzTr Tyi07FVnieWj0G03oK/FSeBPwV+pmjwYnOsHDTbE= Received: from smtpng2.i.mail.ru (smtpng2.i.mail.ru [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 229296EC40 for ; Mon, 16 Aug 2021 19:13:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 229296EC40 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1mFfF0-0003Uk-GC; Mon, 16 Aug 2021 19:13:34 +0300 To: sergepetrenko@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Mon, 16 Aug 2021 19:13:34 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD972FF4A7D76DB5E242D14FEF1BD8BF4AC182A05F538085040ED76EDE28FE3AE61E362D096788DCAE07EE1941740CAFD407642235E7C1F6085 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7364F8074C6DFACE2C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7CB5C87C4C9A74E8BEA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BBCA57AF85F7723F2739AF7C0A4A3DCC3A830F74D9BD5F950CC7F00164DA146DAFE8445B8C89999728AA50765F7900637BA939FD1B3BAB99B389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8989FD0BDF65E50FBF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BDAE3FA6833AEA0C275ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C5B73F950BC6E7FFBB397CC3530B4B4F36152F4B58B92FD679C2B6934AE262D3EE7EAB7254005DCEDE285C580305385EE1E0A4E2319210D9B64D260DF9561598F01A9E91200F654B00191F08AA555D0B08E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34128DEC38EFF4BE5AEE5FAB0D9FF62CFDC45EF5C2A39510B7BC65F7B0E0738D24DE2C155DA2395F281D7E09C32AA3244C167B1FE0CDFEDB9120D3351F3F184CE095A9E0DC41E9A4CF729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojIrFL/N5KnVH5fCp6+dwyvQ== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D5E0F75FC42836D8EC81B01BBBA9B016583D72C36FC87018B9F80AB2734326CD2FB559BB5D741EB96352A0ABBE4FDA4210A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH v1 1/1] schema: remove assert on wrong insert into _priv X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mergen Imeev via Tarantool-patches Reply-To: imeevma@tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Prior to this patch, an assertion was throwed if a tuple with an incorrect id was inserted into the _priv system space. This bug appeared only in the debug build. Closes #6295 --- https://github.com/tarantool/tarantool/issues/6295 https://github.com/tarantool/tarantool/tree/imeevma/gh-6295-assert-on-insert-with-wrong-id src/box/schema.cc | 1 - .../gh-6295-assert-on-wrong-id.test.lua | 34 +++++++++++++++++++ test/box-tap/suite.ini | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100755 test/box-tap/gh-6295-assert-on-wrong-id.test.lua diff --git a/src/box/schema.cc b/src/box/schema.cc index 1970871cc..ac19a2b1e 100644 --- a/src/box/schema.cc +++ b/src/box/schema.cc @@ -730,7 +730,6 @@ schema_find_name(enum schema_object_type type, uint32_t object_id) default: break; } - assert(false); return "(nil)"; } diff --git a/test/box-tap/gh-6295-assert-on-wrong-id.test.lua b/test/box-tap/gh-6295-assert-on-wrong-id.test.lua new file mode 100755 index 000000000..e4822f395 --- /dev/null +++ b/test/box-tap/gh-6295-assert-on-wrong-id.test.lua @@ -0,0 +1,34 @@ +#!/usr/bin/env tarantool + +local tap = require('tap') +local test = tap.test('gh-6295-assert-on-wrong-id') + +test:plan(5) + +local ok, res + +box.cfg{} + +-- Should be an error, not an assertion. +local _priv = box.space._priv +local errmsg = "Function '1000000' does not exist" +ok, res = pcall(_priv.replace, _priv, {1, 2, 'function', 1000000, box.priv.A}) +test:is_deeply({ok, tostring(res)}, {false, errmsg}, "Function exists") + +errmsg = "Sequence '1000000' does not exist" +ok, res = pcall(_priv.replace, _priv, {1, 2, 'sequence', 1000000, box.priv.A}) +test:is_deeply({ok, tostring(res)}, {false, errmsg}, "Sequence exists") + +errmsg = "Space '1000000' does not exist" +ok, res = pcall(_priv.replace, _priv, {1, 2, 'space', 1000000, box.priv.A}) +test:is_deeply({ok, tostring(res)}, {false, errmsg}, "Space exists") + +errmsg = "User '1000000' is not found" +ok, res = pcall(_priv.replace, _priv, {1, 2, 'user', 1000000, box.priv.A}) +test:is_deeply({ok, tostring(res)}, {false, errmsg}, "User exists") + +errmsg = "Role '1000000' is not found" +ok, res = pcall(_priv.replace, _priv, {1, 2, 'role', 1000000, box.priv.A}) +test:is_deeply({ok, tostring(res)}, {false, errmsg}, "Role exists") + +os.exit(test:check() and 0 or 1) diff --git a/test/box-tap/suite.ini b/test/box-tap/suite.ini index b09d7db4f..fd55d5d24 100644 --- a/test/box-tap/suite.ini +++ b/test/box-tap/suite.ini @@ -3,7 +3,7 @@ core = app description = Database tests with #! using TAP is_parallel = True use_unix_sockets_iproto = True -release_disabled = errinj_set_with_enviroment_vars.test.lua +release_disabled = errinj_set_with_enviroment_vars.test.lua, gh-6295-assert-on-wrong-id.test.lua config = suite.cfg fragile = { "retries": 10, -- 2.25.1