From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp41.i.mail.ru (smtp41.i.mail.ru [94.100.177.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 0B2754696C3 for ; Wed, 5 Feb 2020 19:19:15 +0300 (MSK) From: Nikita Pettik Date: Wed, 5 Feb 2020 19:19:08 +0300 Message-Id: Subject: [Tarantool-patches] [PATCH 0/4] sql: fix NUMBER conversion issues List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org Cc: v.shpilevoy@tarantool.org Branch: https://github.com/tarantool/tarantool/tree/np/gh-4233-fix-number-field-type-in-sql Issue: https://github.com/tarantool/tarantool/issues/4233 https://github.com/tarantool/tarantool/issues/4463 This patch-set makes NUMBER behaviour be closer to the one defined in Tarantool NoSQL. This is rework of https://github.com/tarantool/tarantool/tree/imeevma/gh-4233-fix-number-field-type-in-sql Functional changes: fixed CAST boolean AS NUMBER operation - now it is allowed to cast booleans to number type (since boolean can be casted to integer, and in turn NUMBER type comprises integer type). Refactoring: splitted patch in a series of independent ones; fixed codestyle of sqlVdbeMemNumerify(). To the one who will review: this patch-series goes-around since athour of original patch does not agree with suggested (by me) fixes. Hence I guess second review iteration is required. Nikita Pettik (4): sql: remove cast to INT during FP arithmetic ops sql: refactor sqlVdbeMemNumerify() sql: fix CAST AS NUMBER operator sql: do not force FP representation for NUMBER field src/box/sql/vdbe.c | 15 +---- src/box/sql/vdbeInt.h | 12 +++- src/box/sql/vdbemem.c | 65 +++++++-------------- test/sql-tap/cast.test.lua | 32 +++++------ test/sql-tap/e_select1.test.lua | 2 +- test/sql-tap/numcast.test.lua | 106 ++++++++++++++++++++++++++++++++++- test/sql-tap/sort.test.lua | 12 ++-- test/sql-tap/tkt-91e2e8ba6f.test.lua | 12 ++-- test/sql/boolean.result | 9 ++- test/sql/integer-overflow.result | 2 +- test/sql/types.result | 2 +- 11 files changed, 176 insertions(+), 93 deletions(-) -- 2.15.1