From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [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 19BE846970E for ; Thu, 30 Jan 2020 15:04:13 +0300 (MSK) Date: Thu, 30 Jan 2020 15:04:12 +0300 From: Nikita Pettik Message-ID: <20200130120412.GD16149@tarantool.org> References: <20200127140420.52553-1-k.sosnin@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200127140420.52553-1-k.sosnin@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH] sql: fix segfault in pragma table_info List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chris Sosnin Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org On 27 Jan 17:04, Chris Sosnin wrote: > We should first check that primary key is not NULL. > > Closes #4745 > --- Patch is OK as obvious. I've come up with few nits concernings test. > --- a/test/sql/engine.cfg > +++ b/test/sql/engine.cfg > @@ -2,6 +2,7 @@ > "vinyl-opts.test.lua" : { > "vinyl": {"engine": "vinyl"} > }, > + "gh-4745-table-info-assertion.test.lua": { }, > "bind.test.lua": { > "remote": {"remote": "true"}, > "local": {"remote": "false"} > diff --git a/test/sql/gh-4745-table-info-assertion.result b/test/sql/gh-4745-table-info-assertion.result > new file mode 100644 > index 000000000..51a75b816 > --- /dev/null > +++ b/test/sql/gh-4745-table-info-assertion.result > @@ -0,0 +1,8 @@ > +-- test-run result file version 2 > +-- > +-- The following pragma shouldn't cause > +-- assertion fault > +-- > +table_info = box.execute('pragma table_info("_vinyl_deferred_delete")') > + | --- > + | ... > diff --git a/test/sql/gh-4745-table-info-assertion.test.lua b/test/sql/gh-4745-table-info-assertion.test.lua > new file mode 100644 > index 000000000..19d2f6955 > --- /dev/null > +++ b/test/sql/gh-4745-table-info-assertion.test.lua > @@ -0,0 +1,5 @@ > +-- > +-- The following pragma shouldn't cause > +-- assertion fault > +-- I'd add a bit of details: -- Make sure that 'pragma table_info()' correctly handles tables -- without primary key. > +table_info = box.execute('pragma table_info("_vinyl_deferred_delete")') To ignore statement result as a rule we use underscore: _ = box.execute(...) Finally, personally I wouldn't focus on particular '_vinyl_deferred_delete' system space, but rather create casual space without pk and/or format and use it in the test. Then we could run it using both engines. > -- > 2.21.1 (Apple Git-122.3) >