From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 265F5741EE; Fri, 6 Aug 2021 09:42:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 265F5741EE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1628232159; bh=7C7IXyD3MW8Dvy/J/21wALh3sSt9EkCBBWxLJhyL8GA=; h=To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=ba7731JsX/pNvpKULFA1hyt+BmA0KiM1INLf/d7inZ1g8h5ARlZRwamstpBqwy70t YJpuYsGjEhS67a4cA76oRNc7cxpY+DLcD65FMUdWtuC4/SbD8tIaKIcb+UQoEsrgOn QrbXlbKdFcpQ0GqkUq4xfbO0qbRPMknSEpO9wn3M= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (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 3505A741EE for ; Fri, 6 Aug 2021 09:42:38 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3505A741EE Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1mBtYy-0008VQ-VD; Fri, 06 Aug 2021 09:42:37 +0300 To: kyukhin@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Fri, 6 Aug 2021 09:42:36 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD9D5AC6413C25DCF08CC98B8FCC5CD86F3182A05F538085040C6AB31535979363997FEC16E013730DF96F7064E7B86D6332F2C064A8607CAD3 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7AEF9C2E372EE2CB3EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D0177A61392D8FF38638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8CD30674EA23F57DBCB6FC769660E977D117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAE9A1BBD95851C5BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751FE5D25F19253116ADD2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6300D3B61E77C8D3B089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C30CE973C7F71088DE86A3CD4212112AC29B3549E82464F849C2B6934AE262D3EE7EAB7254005DCEDD39702B95798B1671E0A4E2319210D9B64D260DF9561598F01A9E91200F654B0AEA200A0D3D80EA68E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3429499E429979B7C7B1F637DD19B8D561A7AFD39EA8E7520B7FC10BE4916353F5D7B69A48390F74741D7E09C32AA3244CEB0759E24E51E522E6C4BE2E506ED1D0725D5B54B2FE4575729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojFhlvmGwdUwQCvR6vNeBE7g== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D0E5DBECCB1EF8CE23FDB88CC459D3B2683D72C36FC87018B9F80AB2734326CD2FB559BB5D741EB96352A0ABBE4FDA4210A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 0/6] Rework implicit cast X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mergen Imeev via Tarantool-patches Reply-To: imeevma@tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This patch-set reworks implicit cast in SQL according to new rules. According to these rules, all scalar values can be cast to SCALAR, all numeric values can be cast to NUMBER, and any numeric value can be cast to another numeric type only if the conversion is exact. No other implicit cast is allowed. https://github.com/tarantool/tarantool/issues/4230 https://github.com/tarantool/tarantool/issues/4470 https://github.com/tarantool/tarantool/tree/imeevma/gh-4230-remove-implicit-cast-for-comparison-v2 Changes in v2: - Instead of removing, mem_cast_implicit() was reworked. - Removed commit that become unnecessary due to chage to mem_cast_implicit(). - New function mem_cast_implicit_number() was moved to another commit. Mergen Imeev (6): sql: rework implicit cast fo assignment sql: remove implicit cast from comparison opcodes sql: rework OP_Seek* opcodes sql: remove unnecessary calls of OP_ApplyType sql: remove implicit cast from OP_MakeRecord sql: remove unused MEM cast functions .../gh-4230-implicit-cast-for-comparison.md | 6 + .../gh-4470-implicit-cast-for-assignment.md | 6 + src/box/sql.c | 69 +- src/box/sql/analyze.c | 7 +- src/box/sql/cursor.c | 14 - src/box/sql/cursor.h | 1 - src/box/sql/delete.c | 8 +- src/box/sql/expr.c | 39 +- src/box/sql/fk_constraint.c | 9 +- src/box/sql/func.c | 29 +- src/box/sql/insert.c | 14 - src/box/sql/mem.c | 592 ++++++++-------- src/box/sql/mem.h | 57 +- src/box/sql/sqlInt.h | 25 - src/box/sql/tarantoolInt.h | 3 + src/box/sql/update.c | 14 +- src/box/sql/vdbe.c | 665 ++++++------------ src/box/sql/vdbe.h | 2 +- src/box/sql/vdbeaux.c | 6 +- src/box/sql/where.c | 20 +- src/box/sql/wherecode.c | 217 +----- src/box/sql/whereexpr.c | 4 +- test/sql-tap/cast.test.lua | 152 +++- test/sql-tap/func5.test.lua | 6 +- test/sql-tap/identifier_case.test.lua | 10 +- test/sql-tap/in1.test.lua | 15 +- test/sql-tap/in3.test.lua | 4 +- test/sql-tap/in4.test.lua | 4 +- test/sql-tap/index1.test.lua | 4 +- test/sql-tap/insert3.test.lua | 2 +- test/sql-tap/join.test.lua | 8 +- test/sql-tap/misc1.test.lua | 45 +- test/sql-tap/numcast.test.lua | 5 +- test/sql-tap/select1.test.lua | 6 +- test/sql-tap/select7.test.lua | 2 +- test/sql-tap/sql-errors.test.lua | 4 +- test/sql-tap/subquery.test.lua | 4 +- test/sql-tap/tkt-9a8b09f8e6.test.lua | 54 +- test/sql-tap/tkt3493.test.lua | 54 +- test/sql-tap/transitive1.test.lua | 16 +- test/sql-tap/uuid.test.lua | 60 +- test/sql-tap/where2.test.lua | 143 +--- test/sql-tap/where5.test.lua | 12 +- test/sql/boolean.result | 220 +++--- test/sql/types.result | 10 +- 45 files changed, 991 insertions(+), 1656 deletions(-) create mode 100644 changelogs/unreleased/gh-4230-implicit-cast-for-comparison.md create mode 100644 changelogs/unreleased/gh-4470-implicit-cast-for-assignment.md -- 2.25.1