[tarantool-patches] [PATCH 0/2] Improve operability of typeof() function

Nikita Pettik korablev at tarantool.org
Sat Jul 27 21:45:34 MSK 2019


Branch: https://github.com/tarantool/tarantool/compare/np/gh-4148-add-field-type-to-mem
Issue: https://github.com/tarantool/tarantool/issues/4148

First patch adds field_type member to struct Mem. It allows to
improve type calculation for NULL values: when value is fetched
from tuple, field_type is assigned to the type of corresponding
field in space format. So that NULL from field with INTEGER type
now has INTEGER type, from REAL - REAL etc. The only exception is
SCALAR type since it's not basic type but rather aggregation of
types. Thus, NULL values from SCALAR field features default type
(in the next patch it is changed to BOOLEAN).

Second patch switches default type of NULL literal to boolean as it
was decided to do during numerous discussions in mailing list. See
commit message for details.

Nikita Pettik (2):
  sql: extend struct Mem with field_type member
  sql: make default type of NULL be boolean

 src/box/sql/func.c          | 14 +++++++++++++-
 src/box/sql/vdbe.c          | 36 +++++++++++++++++++++++++++++++++++-
 src/box/sql/vdbeInt.h       | 11 +++++++++++
 src/box/sql/vdbeapi.c       |  1 +
 src/box/sql/vdbeaux.c       |  1 +
 src/box/sql/vdbemem.c       |  3 +++
 src/box/sql/vdbesort.c      |  6 ++++++
 test/sql-tap/cast.test.lua  | 12 ++++++------
 test/sql-tap/func.test.lua  | 12 ++++++------
 test/sql-tap/table.test.lua |  4 ++--
 test/sql/types.result       | 35 ++++++++++++++++++++++++++++++++++-
 test/sql/types.test.lua     | 11 +++++++++++
 12 files changed, 129 insertions(+), 17 deletions(-)

-- 
2.15.1





More information about the Tarantool-patches mailing list