From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 41A4B20DB2 for ; Wed, 30 Jan 2019 08:57:03 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w04CcyLVb3Yp for ; Wed, 30 Jan 2019 08:57:03 -0500 (EST) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id BBCBC20CA7 for ; Wed, 30 Jan 2019 08:57:02 -0500 (EST) Subject: [tarantool-patches] Re: [PATCH v5 3/6] sql: Show currently set sql_default_engine References: From: Vladislav Shpilevoy Message-ID: <3ec5bc03-c10c-243f-fa51-ec471676a347@tarantool.org> Date: Wed, 30 Jan 2019 16:57:00 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org, imeevma@tarantool.org Cc: korablev@tarantool.org On 29/01/2019 17:29, imeevma@tarantool.org wrote: > After this patch, "PRAGMA sql_default_engine" called without > arguments will return currently set sql_default_engine. > --- > src/box/sql/pragma.c | 18 +++++++++++++----- > test/sql-tap/gh-2367-pragma.test.lua | 35 +++++++++++++++++++++++++++-------- > 2 files changed, 40 insertions(+), 13 deletions(-) > > diff --git a/test/sql-tap/gh-2367-pragma.test.lua b/test/sql-tap/gh-2367-pragma.test.lua > index c0792c9..90ecd56 100755 > --- a/test/sql-tap/gh-2367-pragma.test.lua > +++ b/test/sql-tap/gh-2367-pragma.test.lua > +-- > +-- gh-3832: Some statements do not return column type > +-- > +-- Check that "PRAGMA sql_default_engine" called without arguments > +-- returns currently set sql_default_engine. > test:do_catchsql_test( > - "pragma-2.5", > + "pragma-3.1", > [[ > - pragma sql_default_engine 1; > + pragma sql_default_engine='vinyl'; > + pragma sql_default_engine; > ]], { > - 1, 'near \"1\": syntax error' > + -- > + 0, {'vinyl'} > + -- If a test does not fail, you should not use test:do_catchsql_test. We have do_test for this. Also, this file is named gh-2367-***, but you added here a test for gh-3832. This is why it made no sense to create a new file on each issue. Please, rename it to pragma.test.lua. > +}) > + > +test:do_catchsql_test( > + "pragma-3.2", > + [[ > + pragma sql_default_engine='memtx'; > + pragma sql_default_engine; > + ]], { > + -- > + 0, {'memtx'} > + -- > }) > > test:finish_test() > -- > 2.7.4 > >