Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org, v.shpilevoy@tarantool.org
Cc: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Subject: [tarantool-patches] [PATCH v1 1/3] sql: clean-up vdbe_emit_constraint_checks
Date: Wed, 19 Dec 2018 18:37:23 +0300	[thread overview]
Message-ID: <ec9419a6c0f69d93eb0f6d71445b040f0b814bde.1545233551.git.kshcherbatov@tarantool.org> (raw)
In-Reply-To: <cover.1545233551.git.kshcherbatov@tarantool.org>

Removed vdbe code generation making type checks from
vdbe_emit_constraint_checks as it is useless since strict types
have been introduced.

Needed for #3850
---
 src/box/sql/insert.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/src/box/sql/insert.c b/src/box/sql/insert.c
index 6b76bb6da..1b02ea907 100644
--- a/src/box/sql/insert.c
+++ b/src/box/sql/insert.c
@@ -965,27 +965,6 @@ vdbe_emit_constraint_checks(struct Parse *parse_context, struct Table *tab,
 		}
 	}
 	sql_emit_table_affinity(v, tab->def, new_tuple_reg);
-	/*
-	 * If PK is marked as INTEGER, use it as strict type,
-	 * not as affinity. Emit code for type checking.
-	 * FIXME: should be removed after introducing
-	 * strict typing.
-	 */
-	struct index *pk = space_index(tab->space, 0);
-	uint32_t part_count = pk->def->key_def->part_count;
-	if (part_count == 1) {
-		uint32_t fieldno = pk->def->key_def->parts[0].fieldno;
-		int reg_pk = new_tuple_reg + fieldno;
-		if (def->fields[fieldno].affinity == AFFINITY_INTEGER) {
-			int skip_if_null = sqlite3VdbeMakeLabel(v);
-			if (autoinc_fieldno != UINT32_MAX) {
-				sqlite3VdbeAddOp2(v, OP_IsNull, reg_pk,
-						  skip_if_null);
-			}
-			sqlite3VdbeAddOp2(v, OP_MustBeInt, reg_pk, 0);
-			sqlite3VdbeResolveLabel(v, skip_if_null);
-		}
-	}
 	/*
 	 * Other actions except for REPLACE and UPDATE OR IGNORE
 	 * can be handled by setting appropriate flag in OP_Halt.
-- 
2.19.2

  reply	other threads:[~2018-12-19 15:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-19 15:37 [tarantool-patches] [PATCH v1 0/3] sql: do not use OP_Delete+OP_Insert for UPDATES Kirill Shcherbatov
2018-12-19 15:37 ` Kirill Shcherbatov [this message]
2018-12-25 17:26   ` [tarantool-patches] Re: [PATCH v1 1/3] sql: clean-up vdbe_emit_constraint_checks n.pettik
2018-12-19 15:37 ` [tarantool-patches] [PATCH v1 2/3] sql: fix sql_vdbe_mem_alloc_region result memory Kirill Shcherbatov
2018-12-25 17:26   ` [tarantool-patches] " n.pettik
2018-12-19 15:37 ` [tarantool-patches] [PATCH v1 3/3] sql: do not use OP_Delete+OP_Insert for UPDATES Kirill Shcherbatov
2018-12-25 17:26   ` [tarantool-patches] " n.pettik
2018-12-26  8:35     ` Kirill Shcherbatov
2018-12-28 14:17       ` n.pettik
2018-12-20 20:41 ` [tarantool-patches] Re: [PATCH v1 0/3] " Vladislav Shpilevoy

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=ec9419a6c0f69d93eb0f6d71445b040f0b814bde.1545233551.git.kshcherbatov@tarantool.org \
    --to=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [tarantool-patches] [PATCH v1 1/3] sql: clean-up vdbe_emit_constraint_checks' \
    /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