Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org, korablev@tarantool.org
Cc: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Subject: [tarantool-patches] [PATCH v2 1/5] sql: clean-up vdbe_emit_constraint_checks
Date: Sat, 29 Dec 2018 13:48:58 +0300	[thread overview]
Message-ID: <92039458ddd8dde92a59077114a41f96dca129e4.1546079994.git.kshcherbatov@tarantool.org> (raw)
In-Reply-To: <cover.1546079994.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.
---
 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-29 10:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-29 10:48 [tarantool-patches] [PATCH v2 0/5] sql: do not use OP_Delete+OP_Insert for UPDATES Kirill Shcherbatov
2018-12-29 10:48 ` Kirill Shcherbatov [this message]
2018-12-29 10:48 ` [tarantool-patches] [PATCH v2 2/5] sql: fix sql_vdbe_mem_alloc_region result memory Kirill Shcherbatov
2018-12-29 10:49 ` [tarantool-patches] [PATCH v2 3/5] sql: fix fkey exception for self-referenced table Kirill Shcherbatov
2018-12-29 13:26   ` [tarantool-patches] " n.pettik
2018-12-29 10:49 ` [tarantool-patches] [PATCH v2 4/5] sql: encode tuples with mpstream on Vdbe run Kirill Shcherbatov
2018-12-29 13:26   ` [tarantool-patches] " n.pettik
2018-12-29 15:28     ` Kirill Shcherbatov
2019-01-09 12:29       ` n.pettik
2018-12-29 10:49 ` [tarantool-patches] [PATCH v2 5/5] sql: do not use OP_Delete+OP_Insert for UPDATES Kirill Shcherbatov
2018-12-29 13:35   ` [tarantool-patches] " n.pettik
2018-12-29 15:31     ` Kirill Shcherbatov
2019-01-10 12:30 ` [tarantool-patches] Re: [PATCH v2 0/5] " Kirill Yukhin

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=92039458ddd8dde92a59077114a41f96dca129e4.1546079994.git.kshcherbatov@tarantool.org \
    --to=kshcherbatov@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH v2 1/5] 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