From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 44E9322B9F for ; Sat, 29 Dec 2018 05:49:06 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wVccjnmbqNPF for ; Sat, 29 Dec 2018 05:49:06 -0500 (EST) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id EC8D522835 for ; Sat, 29 Dec 2018 05:49:05 -0500 (EST) From: Kirill Shcherbatov Subject: [tarantool-patches] [PATCH v2 1/5] sql: clean-up vdbe_emit_constraint_checks Date: Sat, 29 Dec 2018 13:48:58 +0300 Message-Id: <92039458ddd8dde92a59077114a41f96dca129e4.1546079994.git.kshcherbatov@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org, korablev@tarantool.org Cc: Kirill Shcherbatov 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