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 DAA6F3103C for ; Fri, 7 Jun 2019 11:37:50 -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 RCjK0eRDDHsh for ; Fri, 7 Jun 2019 11:37:50 -0400 (EDT) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 8CD943102E for ; Fri, 7 Jun 2019 11:37:50 -0400 (EDT) From: Nikita Pettik Subject: [tarantool-patches] [PATCH 0/6] Introduce UNSIGNED type in SQL Date: Fri, 7 Jun 2019 18:37:40 +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/tree/np/introduce-uint Issues: https://github.com/tarantool/tarantool/issues/3810 https://github.com/tarantool/tarantool/issues/4015 Current patch-set allows using UNSIGNED as a column type and operating on integer values in range up to [2^64 - 1]. This means that result of all basic routines such as arithmetic operations and built-in functions is extended to unsigned range. The basic idea under the hood is separating storing positive and negative integers into different memory cells. We've added new type of VDBE memory - MEM_UInt. Now all positive values are stored with featuring this flag; in turn, negative integers have MEM_Int type. It's quite similar to MP_* format types. For more details see content of patches. Nikita Pettik (6): sql: refactor sql_atoi64() sql: separate VDBE memory holding positive and negative ints sql: refactor arithmetic operations to support unsigned ints sql: make built-in functions operate on unsigned values sql: introduce extended range for INTEGER type sql: allow to specify UNSIGNED column type extra/mkkeywordhash.c | 1 + src/box/bind.c | 13 +- src/box/bind.h | 1 + src/box/errcode.h | 2 +- src/box/execute.c | 19 +- src/box/lua/execute.c | 9 +- src/box/lua/lua_sql.c | 3 + src/box/sql/build.c | 4 +- src/box/sql/expr.c | 68 ++-- src/box/sql/func.c | 92 ++--- src/box/sql/main.c | 3 +- src/box/sql/parse.y | 1 + src/box/sql/pragma.c | 2 +- src/box/sql/sqlInt.h | 97 ++--- src/box/sql/sqlLimit.h | 9 + src/box/sql/util.c | 371 +++++++++--------- src/box/sql/vdbe.c | 268 ++++++++----- src/box/sql/vdbe.h | 3 +- src/box/sql/vdbeInt.h | 19 +- src/box/sql/vdbeapi.c | 52 ++- src/box/sql/vdbeaux.c | 60 ++- src/box/sql/vdbemem.c | 149 ++++---- test/sql-tap/cast.test.lua | 8 +- test/sql-tap/check.test.lua | 2 +- test/sql-tap/cse.test.lua | 6 +- test/sql-tap/default.test.lua | 2 +- test/sql-tap/fkey2.test.lua | 4 +- test/sql-tap/func.test.lua | 46 ++- test/sql-tap/hexlit.test.lua | 2 +- test/sql-tap/position.test.lua | 2 +- test/sql-tap/sql-errors.test.lua | 4 +- test/sql-tap/table.test.lua | 2 +- test/sql-tap/tkt3493.test.lua | 4 +- test/sql/bind.result | 46 ++- test/sql/bind.test.lua | 4 + test/sql/gh-2347-max-int-literals.result | 39 -- test/sql/gh-2347-max-int-literals.test.lua | 11 - test/sql/integer-overflow.result | 77 +++- test/sql/integer-overflow.test.lua | 10 + test/sql/iproto.result | 6 +- test/sql/types.result | 587 ++++++++++++++++++++++++++++- test/sql/types.test.lua | 115 ++++++ 42 files changed, 1602 insertions(+), 621 deletions(-) delete mode 100644 test/sql/gh-2347-max-int-literals.result delete mode 100644 test/sql/gh-2347-max-int-literals.test.lua -- 2.15.1