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 D2ED42FAF9 for ; Sat, 17 Nov 2018 09:03:52 -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 7t5PcZRPXxap for ; Sat, 17 Nov 2018 09:03:52 -0500 (EST) 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 turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 8BBD22FAEF for ; Sat, 17 Nov 2018 09:03:52 -0500 (EST) From: imeevma@tarantool.org Subject: [tarantool-patches] [PATCH v1 00/10] sql: remove box.sql.execute Date: Sat, 17 Nov 2018 17:03:48 +0300 Message-Id: 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, v.shpilevoy@tarantool.org The goal of this patch-set is to make functions from execute.c the only way to execute SQL statements. This goal includes identical output for executed SQL statements no matter how they were executed: through net.box or through box. This version of patch-set is not complete. It doesn't have last part, which is replacing box.sql.execute by box.execute, because it will lead to massive test editing. The main goal of this version of patch-set is to get comments about design of vstream and general comments about this patch-set. A bit about patches in this patch-set: Patch 1 allows to use SQL query as plain text in sql_request. Patch 2 makes execute.c a bit more universal by removing IPROTO functions from there. Patch 3 allows us to design vstream by wrapping mpstream functions. Patch 4 creates interface vstream and its mpstream implementation. Patch 5 fixes bug with EXPLAIN being executed through net.box throws SEGMENTATION FAULT. Patch 6 fixes bug with SELECT from system spaces returns some columns as unpacked msgpack. Patch 7 fixes bug with region being cleared twice during execution of VDBE. Patch 8 creates method for port which will allow us to dump port directly to Lua stack. Patch 9 creates vstream implementation for Lua and defines new box.sql.new_execute() function that will become box.execute() in next vesions. Patch 10 is created to check that box.sql.new_execute() is able to pass through test created for box.sql.execute(). Created new implementation of box.sql.execute() that transforms output of box.sql.new_execute() to format of old box.sql.execute(). Kirill Shcherbatov (1): box: store sql text and length in sql_request Mergen Imeev (9): iproto: remove iproto functions from execute.c iproto: replace obuf by mpstream in execute.c sql: create interface vstream sql: EXPLAIN through net.box leads to SEGFAULT sql: SELECT from system spaces returns unpacked msgpack. sql: too many autogenerated ids leads to SEGFAULT box: add method dump_lua to port lua: create vstream implementation for Lua sql: check new box.sql.execute() src/box/CMakeLists.txt | 1 + src/box/execute.c | 218 ++++++++++------------------- src/box/execute.h | 43 +++--- src/box/iproto.cc | 93 ++++++++++++- src/box/lua/call.c | 1 + src/box/lua/net_box.c | 15 +- src/box/lua/schema.lua | 23 ++++ src/box/lua/sql.c | 107 +++------------ src/box/port.c | 22 +++ src/box/port.h | 12 ++ src/box/sql/vdbe.c | 8 +- src/box/sql/vdbeaux.c | 6 - src/box/vstream.c | 348 +++++++++++++++++++++++++++++++++++++++++++++++ src/box/vstream.h | 194 ++++++++++++++++++++++++++ src/box/xrow.c | 39 ------ src/box/xrow.h | 14 -- test/sql/iproto.result | 36 +++++ test/sql/iproto.test.lua | 20 ++- 18 files changed, 870 insertions(+), 330 deletions(-) create mode 100644 src/box/vstream.c create mode 100644 src/box/vstream.h -- 2.7.4