Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH v2 0/8] sql: uniform SQL and Lua functions subsystem
@ 2019-08-08 14:50 Kirill Shcherbatov
  2019-08-08 14:50 ` [tarantool-patches] [PATCH v2 1/8] sql: remove SQL_PreferBuiltin flag Kirill Shcherbatov
                   ` (7 more replies)
  0 siblings, 8 replies; 38+ messages in thread
From: Kirill Shcherbatov @ 2019-08-08 14:50 UTC (permalink / raw)
  To: tarantool-patches, korablev; +Cc: Kirill Shcherbatov

This patchset reworks SQL functions subsystem. Previously Tarantool's
SQL used an own FuncDef function representation and corresponding
FuncDef cache. Replacing it with Tarantool's uniform function
representation makes possible to call any function on any supported
language in SQL.

Changes in version 2:
  - introduced GREATER, LESSER entries
  - reworked multiple signatures for functions: only SQL builtins
    support name overload and it is trivial and processed by
    single function implementation
  - introduced OP_BuiltinFunction to use func_sql_builtin's
    function implementation directly without port proxy object

Branch: http://github.com/tarantool/tarantool/tree/kshch/gh-4182-persistent-functions
Issue: https://github.com/tarantool/tarantool/issues/2233

Kirill Shcherbatov (8):
  sql: remove SQL_PreferBuiltin flag
  sql: GREATEST, LEAST instead of MIN/MAX overload
  sql: wrap all trim functions in dispatcher
  sql: get rid of SQL_FUNC_COUNT flag
  sql: introduce a signature_mask for functions
  sql: rename OP_Function to OP_BuiltinFunction
  sql: get rid of FuncDef function hash
  box: get rid of box.internal.sql_function_create

 src/box/func_def.h              |   2 +-
 src/box/lua/lua_sql.h           |  39 --
 src/box/port.h                  |  17 +
 src/box/sql.h                   |   5 +
 src/box/sql/sqlInt.h            | 240 ++++--------
 src/box/sql/vdbe.h              |   9 +-
 src/box/sql/vdbeInt.h           |  26 +-
 src/lib/core/port.h             |  19 +
 src/box/call.c                  |   1 +
 src/box/execute.c               |   1 +
 src/box/func.c                  |  34 +-
 src/box/lua/call.c              |   6 +-
 src/box/lua/lua_sql.c           | 205 -----------
 src/box/port.c                  |   4 +
 src/box/sql.c                   |  24 ++
 src/box/sql/analyze.c           |  41 +--
 src/box/sql/callback.c          | 212 +----------
 src/box/sql/date.c              |  28 --
 src/box/sql/expr.c              |  64 ++--
 src/box/sql/func.c              | 627 ++++++++++++++++++++++++++------
 src/box/sql/global.c            |   7 -
 src/box/sql/main.c              | 137 -------
 src/box/sql/resolve.c           |  50 +--
 src/box/sql/select.c            |   9 +-
 src/box/sql/vdbe.c              |  94 +++--
 src/box/sql/vdbeapi.c           |  11 +-
 src/box/sql/vdbeaux.c           |  31 +-
 src/box/sql/vdbemem.c           |  50 ++-
 src/box/sql/whereexpr.c         |   2 +-
 src/box/CMakeLists.txt          |   1 -
 src/box/bootstrap.snap          | Bin 5907 -> 5944 bytes
 src/box/lua/schema.lua          |   3 +-
 src/box/lua/upgrade.lua         |  20 +
 test-run                        |   2 +-
 test/box-py/bootstrap.result    |   4 +-
 test/box/access.result          |   2 +-
 test/box/access.test.lua        |   2 +-
 test/box/access_bin.result      |   2 +-
 test/box/access_bin.test.lua    |   2 +-
 test/box/access_misc.result     | 134 +++----
 test/box/access_sysview.result  |   8 +-
 test/box/function1.result       | 179 ++++++++-
 test/box/function1.test.lua     |  62 +++-
 test/sql-tap/alias.test.lua     |  11 +-
 test/sql-tap/check.test.lua     |  11 +-
 test/sql-tap/coalesce.test.lua  |   2 +-
 test/sql-tap/func3.test.lua     |  12 +-
 test/sql-tap/func5.test.lua     |  61 ++--
 test/sql-tap/in1.test.lua       |   6 +-
 test/sql-tap/insert1.test.lua   |   2 +-
 test/sql-tap/lua_sql.test.lua   | 121 +++---
 test/sql-tap/misc1.test.lua     |   2 +-
 test/sql-tap/select1.test.lua   |  22 +-
 test/sql-tap/select2.test.lua   |   6 +-
 test/sql-tap/select3.test.lua   |   2 +-
 test/sql-tap/subquery.test.lua  |  21 +-
 test/sql-tap/trigger9.test.lua  |   8 +-
 test/sql-tap/where2.test.lua    |   4 +-
 test/sql-tap/with1.test.lua     |   2 +-
 test/sql/errinj.result          |  26 --
 test/sql/errinj.test.lua        |  10 -
 test/sql/func-recreate.result   |  41 ++-
 test/sql/func-recreate.test.lua |  26 +-
 test/sql/iproto.result          |   8 +-
 test/sql/iproto.test.lua        |   4 +-
 test/sql/types.result           |  12 +-
 test/sql/types.test.lua         |   6 +-
 test/wal_off/func_max.result    |   8 +-
 68 files changed, 1458 insertions(+), 1392 deletions(-)
 delete mode 100644 src/box/lua/lua_sql.h
 delete mode 100644 src/box/lua/lua_sql.c

-- 
2.22.0

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2019-08-20 19:36 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-08 14:50 [tarantool-patches] [PATCH v2 0/8] sql: uniform SQL and Lua functions subsystem Kirill Shcherbatov
2019-08-08 14:50 ` [tarantool-patches] [PATCH v2 1/8] sql: remove SQL_PreferBuiltin flag Kirill Shcherbatov
2019-08-09 16:07   ` [tarantool-patches] " n.pettik
2019-08-12 21:58   ` Konstantin Osipov
2019-08-08 14:50 ` [tarantool-patches] [PATCH v2 2/8] sql: GREATEST, LEAST instead of MIN/MAX overload Kirill Shcherbatov
2019-08-09 17:37   ` [tarantool-patches] " n.pettik
2019-08-13  8:26     ` Kirill Shcherbatov
2019-08-12 21:59   ` Konstantin Osipov
2019-08-08 14:50 ` [tarantool-patches] [PATCH v2 3/8] sql: wrap all trim functions in dispatcher Kirill Shcherbatov
2019-08-09 18:05   ` [tarantool-patches] " n.pettik
2019-08-13  8:28     ` Kirill Shcherbatov
2019-08-13 22:19       ` n.pettik
2019-08-12 22:00   ` Konstantin Osipov
2019-08-08 14:50 ` [tarantool-patches] [PATCH v2 4/8] sql: get rid of SQL_FUNC_COUNT flag Kirill Shcherbatov
2019-08-12 22:01   ` [tarantool-patches] " Konstantin Osipov
2019-08-13 20:35   ` n.pettik
2019-08-14  7:25     ` Kirill Shcherbatov
2019-08-08 14:50 ` [tarantool-patches] [PATCH v2 5/8] sql: introduce a signature_mask for functions Kirill Shcherbatov
2019-08-12 22:04   ` [tarantool-patches] " Konstantin Osipov
2019-08-13  8:32     ` Kirill Shcherbatov
2019-08-13  8:44       ` Konstantin Osipov
2019-08-13 20:38   ` n.pettik
2019-08-14  7:21     ` Kirill Shcherbatov
2019-08-08 14:50 ` [tarantool-patches] [PATCH v2 6/8] sql: rename OP_Function to OP_BuiltinFunction Kirill Shcherbatov
2019-08-12 22:04   ` [tarantool-patches] " Konstantin Osipov
2019-08-13 20:36   ` n.pettik
2019-08-08 14:50 ` [tarantool-patches] [PATCH v2 7/8] sql: get rid of FuncDef function hash Kirill Shcherbatov
2019-08-12 22:11   ` [tarantool-patches] " Konstantin Osipov
2019-08-13  7:29     ` Kirill Shcherbatov
2019-08-13  8:42       ` Konstantin Osipov
2019-08-13  9:45         ` Kirill Shcherbatov
2019-08-13 20:40   ` n.pettik
2019-08-16 12:57     ` Kirill Shcherbatov
2019-08-20 16:06       ` n.pettik
2019-08-08 14:50 ` [tarantool-patches] [PATCH v2 8/8] box: get rid of box.internal.sql_function_create Kirill Shcherbatov
2019-08-13 20:43   ` [tarantool-patches] " n.pettik
2019-08-16 12:57     ` Kirill Shcherbatov
2019-08-20 19:36       ` n.pettik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox