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 AF79822662 for ; Wed, 19 Dec 2018 10:37:30 -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 yrf3sjHql1mj for ; Wed, 19 Dec 2018 10:37:30 -0500 (EST) Received: from smtp61.i.mail.ru (smtp61.i.mail.ru [217.69.128.41]) (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 1265B2259B for ; Wed, 19 Dec 2018 10:37:29 -0500 (EST) From: Kirill Shcherbatov Subject: [tarantool-patches] [PATCH v1 1/3] sql: clean-up vdbe_emit_constraint_checks Date: Wed, 19 Dec 2018 18:37:23 +0300 Message-Id: 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, v.shpilevoy@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. 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