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 0A95C46970F for ; Wed, 27 Nov 2019 13:33:11 +0300 (MSK) Date: Wed, 27 Nov 2019 13:33:10 +0300 From: Mergen Imeev Message-ID: <20191127103309.GA16066@tarantool.org> References: <12ed4be2e7e433fdca58a43fc3b937eb9a54f52f.1573121685.git.imeevma@gmail.com> <9fe3bd05-17de-e878-4395-4d15cf2f0b38@tarantool.org> <20191107141209.GA10466@tarantool.org> <93979a0b-1708-1125-1142-74f22734b088@tarantool.org> <20191115140609.GA15961@tarantool.org> <3d76e64a-cd03-1bf1-5830-0d0b142a5e27@tarantool.org> <194ae7ab-61bc-797a-527e-81704ade2545@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <194ae7ab-61bc-797a-527e-81704ade2545@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v3 3/5] sql: introduce SET statement List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org Hi! Thanks for the suggestion! I think your points are correct, but I think we should create a new issue after pushing SET. Issue #4621 about using VDBE in SET/control pragmas. All other pragmas already use VDBE. Since SET will use VDBE, I think we should close #4621 with #4511. I will create this issue when SET is pushed if you have no objections. On Sun, Nov 17, 2019 at 09:32:17PM +0100, Vladislav Shpilevoy wrote: > I was thinking about it, and realized, that SET is > really castrated. For example: > > box.cfg{} > box.execute('CREATE TABLE test (id INTEGER PRIMARY KEY, a BOOLEAN)') > box.execute('INSERT INTO test VALUES (1, TRUE)') > tarantool> box.execute('UPDATE test SET a = FALSE AND TRUE') > --- > - row_count: 1 > ... > > This UPDATE SET works. Settings SET does not work: > > tarantool> box.execute('SET sql_full_column_names = FALSE AND TRUE;') > --- > - null > - Keyword 'AND' is reserved. Please use double quotes if 'AND' is an identifier. > ... > > I think we need to make them working the same. We can't expect that a user > will always pass a trivial constant boolean value. > > Binding also does not work: > > tarantool> box.execute('SET sql_full_column_names = ?;', {true}) > --- > - null > - Syntax error near '?' > ... > > And as well, we can't force a user to always concatenate its > settings into a query string. At least this is not safe. > > But I think this might be moved to 4621 issue. Because PRAGMA > also does not understand complex expressions, nor bound > parameters.