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 22D2B25580 for ; Sat, 27 Jul 2019 14:45:41 -0400 (EDT) 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 cCL9DNAQeu3c for ; Sat, 27 Jul 2019 14:45:40 -0400 (EDT) Received: from smtp47.i.mail.ru (smtp47.i.mail.ru [94.100.177.107]) (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 4E35825497 for ; Sat, 27 Jul 2019 14:45:40 -0400 (EDT) From: Nikita Pettik Subject: [tarantool-patches] [PATCH 0/2] Improve operability of typeof() function Date: Sat, 27 Jul 2019 21:45:34 +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 Cc: v.shpilevoy@tarantool.org, Nikita Pettik 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