[tarantool-patches] [PATCH 0/3] sql: move column's default value to Tarantool's core

Kirill Yukhin kyukhin at tarantool.org
Thu Mar 29 09:42:05 MSK 2018


This patches-set consists of 3 almost independent patches:
 1. It adds a nullable field to space _schema, which will make it easier
    to use from within SQL engine.
 2. [tiny] Remove couple of dead functions from SQL engine.
 3. [main] Moves DEFAULT values, both string and compiled AST to Tarantool's
    core. New routine which will allow to compile SQL-context free expressions
    was introduced. Compiled AST is stored inside space_def and allocated
    using single top-most malloc().

NB1: It should be mentioned, that duplication routines for expressions are not elegant
enough to do single malloc(), it allocates nodes on demand and this may and will
be refactored. Issue to be submitted.

NB2: Handle `struct sqlite3 *` use used only for regacy memory allocation. And should
be removed from all API parameters, after we'll choose right allocator and emply it.
Another issue to be submitted.

Branch: https://github.com/tarantool/tarantool/tree/kyukhin/gh-3235-move-default
Issue: https://github.com/tarantool/tarantool/issues/3235

Kirill Yukhin (3):
  Add value field to _schema space
  sql: remove dead find DB functions.
  sql: move default col values to Tarantool's core

 src/CMakeLists.txt           |   2 +-
 src/box/alter.cc             |  17 +
 src/box/bootstrap.snap       | Bin 1638 -> 1657 bytes
 src/box/box.cc               |   3 +-
 src/box/field_def.c          |   5 +-
 src/box/field_def.h          |   4 +
 src/box/lua/upgrade.lua      |  14 +-
 src/box/space_def.c          | 105 ++++--
 src/box/space_def.h          |  10 +-
 src/box/sql.c                |  64 +++-
 src/box/sql.h                |  30 ++
 src/box/sql/build.c          |  48 +--
 src/box/sql/delete.c         |  12 +-
 src/box/sql/expr.c           | 114 +++---
 src/box/sql/fkey.c           |  13 +-
 src/box/sql/insert.c         |  32 +-
 src/box/sql/main.c           |  15 -
 src/box/sql/parse.c          | 876 ++++++++++++++++++++++---------------------
 src/box/sql/parse.y          |  32 +-
 src/box/sql/resolve.c        |  12 +-
 src/box/sql/select.c         |  28 +-
 src/box/sql/sqliteInt.h      |  11 +-
 src/box/sql/tokenize.c       | 121 ++++++
 src/box/sql/trigger.c        |  12 +-
 src/box/sql/update.c         |   2 +-
 src/box/sql/wherecode.c      |   2 +-
 src/box/sql/whereexpr.c      |   6 +-
 test/box-py/bootstrap.result |   3 +-
 test/box/access_misc.result  |   3 +-
 test/xlog/upgrade.result     |   3 +-
 30 files changed, 948 insertions(+), 651 deletions(-)

-- 
2.11.0





More information about the Tarantool-patches mailing list