[PATCH v4 0/5] Remove box.sql.execute()

imeevma at tarantool.org imeevma at tarantool.org
Fri Nov 30 22:00:56 MSK 2018


The goal of this patch-set is to make functions from execute.c
the only way to execute SQL statements. This goal includes
similar output for executed SQL statements no matter how they
were executed: through net.box or through box.

This is the fourth version of patch-set. It is not complete. It
still has no 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 look at design of
new box.sql.execute().

The main purpose of this version of the patch-set is to look at
the new design of the box.sql.execute().

For now this patch-set blocked by #3832. Small temporary fix added
to temporary patch of patch-set.

https://github.com/tarantool/tarantool/issues/3505
https://github.com/tarantool/tarantool/tree/imeevma/gh-3505-replace-box_sql_execute-by-box_execute

General information of difference from previous version of
patch-set:
- Some patches were removed from patch-set because they were
  pushed to 2.1.
- New patch was added. It moves port to src/ from src/box

A bit about patches of patch-set with comments about changes in
this version:

Patch 1 moves port to src/ from src/box. It allows us to use port
in mpstream.c/mpstream.h.

Patch 2 allows us to design vstream by wrapping mpstream
functions. At the moment, this is the most dubious patch due to
the implicit use of mpstream as a stream for obuf.

Patch 3 creates interface vstream and its mpstream implementation.
Difference from previous version:
- Function mpsvtream_init() was created and function
  mp_vstream_init_vtab() was removed.

Patch 4 creates vstream implementation for Lua and defines new
box.sql.new_execute() function that will become box.execute() in
next vesions.
Difference from previous version:
- luastream.c moved to src/lua from src/box/lua.
- luastream.h created. Some functionality were moved here from
  luastream.c.
- Function luasvtream_init() was created and function
  lua_vstream_init_vtab() was removed.
- Some refactoring has been done.

Patch 5 is temporary patch. It created to check that
box.sql.new_execute() is able to pass through tests created for
box.sql.execute(). Now it contains small fix that allows us to
pass to sql_response_dump() result with rows without types.

v1: https://www.freelists.org/post/tarantool-patches/PATCH-v1-0010-sql-remove-boxsqlexecute
v2: https://www.freelists.org/post/tarantool-patches/PATCH-v2-07-Remove-boxsqlexecute
v3: https://www.freelists.org/post/tarantool-patches/PATCH-v3-07-Remove-boxsqlexecute

Mergen Imeev (4):
  iproto: replace obuf by mpstream in execute.c
  sql: create interface vstream
  lua: create vstream implementation for Lua
  sql: check new box.sql.execute()

Vladislav Shpilevoy (1):
  box: move port to src/

 src/CMakeLists.txt     |   2 +
 src/box/execute.c      | 320 +++++++++++++++++++++++++++++++++++++------------
 src/box/execute.h      |  39 +++++-
 src/box/iproto.cc      |  23 +++-
 src/box/lua/schema.lua |  23 ++++
 src/box/lua/sql.c      | 109 ++++-------------
 src/box/lua/sql.h      |   4 +
 src/box/port.c         |  30 -----
 src/box/port.h         | 103 +---------------
 src/lua/luastream.c    | 148 +++++++++++++++++++++++
 src/lua/luastream.h    |  47 ++++++++
 src/mpstream.c         |  57 +++++++++
 src/mpstream.h         |   7 ++
 src/port.c             |  37 ++++++
 src/port.h             | 127 ++++++++++++++++++++
 src/vstream.h          | 176 +++++++++++++++++++++++++++
 16 files changed, 949 insertions(+), 303 deletions(-)
 create mode 100644 src/lua/luastream.c
 create mode 100644 src/lua/luastream.h
 create mode 100644 src/port.c
 create mode 100644 src/port.h
 create mode 100644 src/vstream.h

-- 
2.7.4




More information about the Tarantool-patches mailing list