Tarantool development patches archive
 help / color / mirror / Atom feed
From: Mergen Imeev via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: kyukhin@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH v2 0/6] Rework implicit cast
Date: Fri,  6 Aug 2021 09:42:36 +0300	[thread overview]
Message-ID: <cover.1628231991.git.imeevma@gmail.com> (raw)

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


             reply	other threads:[~2021-08-06  6:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06  6:42 Mergen Imeev via Tarantool-patches [this message]
2021-08-06  6:42 ` [Tarantool-patches] [PATCH v2 1/6] sql: rework implicit cast fo assignment Mergen Imeev via Tarantool-patches
2021-08-06  6:42 ` [Tarantool-patches] [PATCH v2 2/6] sql: remove implicit cast from comparison opcodes Mergen Imeev via Tarantool-patches
2021-08-06  6:42 ` [Tarantool-patches] [PATCH v2 3/6] sql: rework OP_Seek* opcodes Mergen Imeev via Tarantool-patches
2021-08-06  6:42 ` [Tarantool-patches] [PATCH v2 4/6] sql: remove unnecessary calls of OP_ApplyType Mergen Imeev via Tarantool-patches
2021-08-06  6:42 ` [Tarantool-patches] [PATCH v2 5/6] sql: remove implicit cast from OP_MakeRecord Mergen Imeev via Tarantool-patches
2021-08-06  6:42 ` [Tarantool-patches] [PATCH v2 6/6] sql: remove unused MEM cast functions Mergen Imeev via Tarantool-patches
2021-08-06 12:19   ` Vitaliia Ioffe via Tarantool-patches
2021-08-06  7:04 ` [Tarantool-patches] [PATCH v2 0/6] Rework implicit cast Kirill Yukhin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1628231991.git.imeevma@gmail.com \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imeevma@tarantool.org \
    --cc=kyukhin@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 0/6] Rework implicit cast' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox