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 E63A22A5F3 for ; Tue, 2 Apr 2019 04:30:16 -0400 (EDT) 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 Vq-DivkiXywi for ; Tue, 2 Apr 2019 04:30:16 -0400 (EDT) Received: from smtp39.i.mail.ru (smtp39.i.mail.ru [94.100.177.99]) (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 997B127EDD for ; Tue, 2 Apr 2019 04:30:16 -0400 (EDT) Date: Tue, 2 Apr 2019 11:30:10 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH v2 1/1] sql: parameter binding for box.execute() Message-ID: <20190402083010.GN25072@chai> References: <01d0c735518c8de3b48050395d9f83cf4dc77d7e.1554148852.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01d0c735518c8de3b48050395d9f83cf4dc77d7e.1554148852.git.v.shpilevoy@tarantool.org> 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 Cc: kyukhin@tarantool.org, imeevma@tarantool.org, Mergen Imeev * Vladislav Shpilevoy [19/04/01 23:03]: > + /* Check that the table is one-row sized. */ Check that the table has only one row. > + /* > + * Name should be saved in allocated memory as it > + * will be poped from Lua stack. > + */ popped > + case MP_STR: > + /* > + * Data should be saved in allocated memory as it > + * will be poped from Lua stack. > + */ popped > + case MP_BOOL: > + /* SQLite doesn't support boolean. Use int instead. */ SQL The patch itself is LGTM. Mergen, please create a test case for sql bind parameters in lua such as: - it uses a simple SQL select: SELECT ? - it uses an extensible list of bind values as test subjects - for each bind value in the list, it verifies that what goes into the bind, is returned back by SQL intact or SQL produces an error. - for each Lua data type such as double, integer, cdata integer, cdata unsigned, string, lua table, lua array, userdata, append the following values to the list of test subjects: - minimal value of the data type - maximal value of the data type (if present) - zero value of the data type ("" for strings, null pointer for userdata) - nil We need a similar test for each host language (C, Java, Python, PHP, etc), but it's a separate subject matter. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov