From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [217.69.128.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 1F69C469719 for ; Sun, 15 Mar 2020 20:41:27 +0300 (MSK) From: Vladislav Shpilevoy Date: Sun, 15 Mar 2020 18:41:25 +0100 Message-Id: <073c9b48376b0d53df7cc826a8774a7f4f35f087.1584293997.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 1/1] sql: trust column duplicate check to box List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, korablev@tarantool.org CREATE TABLE used to check column name duplicates before going to box. But it is not necessary, because the same check is done by box. --- Branch: http://github.com/tarantool/tarantool/tree/gerold103/drop-column-duplicate-check-from-sql src/box/sql/build.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/box/sql/build.c b/src/box/sql/build.c index fbfd05cbf..7511fad37 100644 --- a/src/box/sql/build.c +++ b/src/box/sql/build.c @@ -324,13 +324,6 @@ sqlAddColumn(Parse * pParse, Token * pName, struct type_def *type_def) pParse->is_aborted = true; return; } - for (uint32_t i = 0; i < def->field_count; i++) { - if (strcmp(z, def->fields[i].name) == 0) { - diag_set(ClientError, ER_SPACE_FIELD_IS_DUPLICATE, z); - pParse->is_aborted = true; - return; - } - } struct field_def *column_def = &def->fields[def->field_count]; memcpy(column_def, &field_def_default, sizeof(field_def_default)); column_def->name = z; -- 2.21.1 (Apple Git-122.3)