From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp44.i.mail.ru (smtp44.i.mail.ru [94.100.177.104]) (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 5F31142EF60 for ; Wed, 17 Jun 2020 15:36:53 +0300 (MSK) From: imeevma@tarantool.org Date: Wed, 17 Jun 2020 15:36:52 +0300 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v2 6/7] sql: remove OP_ApplyType List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: korablev@tarantool.org, tsafin@tarantool.org, tarantool-patches@dev.tarantool.org Opcode OP_ApplyType is not needed now, so it should be removed. Follow-up #4230 --- src/box/sql/vdbe.c | 29 ----------------------------- src/box/sql/wherecode.c | 5 ----- 2 files changed, 34 deletions(-) diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c index a92c9f60f..e22ed98cf 100644 --- a/src/box/sql/vdbe.c +++ b/src/box/sql/vdbe.c @@ -2834,35 +2834,6 @@ case OP_Fetch: { break; } -/* Opcode: ApplyType P1 P2 * P4 * - * Synopsis: type(r[P1@P2]) - * - * Apply types to a range of P2 registers starting with P1. - * - * P4 is a string that is P2 characters long. The nth character of the - * string indicates the column type that should be used for the nth - * memory cell in the range. - */ -case OP_ApplyType: { - enum field_type *types = pOp->p4.types; - assert(types != NULL); - assert(types[pOp->p2] == field_type_MAX); - pIn1 = &aMem[pOp->p1]; - enum field_type type; - while((type = *(types++)) != field_type_MAX) { - assert(pIn1 <= &p->aMem[(p->nMem+1 - p->nCursor)]); - assert(memIsValid(pIn1)); - if (mem_apply_type(pIn1, type) != 0) { - diag_set(ClientError, ER_SQL_TYPE_MISMATCH, - sql_value_to_diag_str(pIn1), - field_type_strs[type]); - goto abort_due_to_error; - } - pIn1++; - } - break; -} - /* Opcode: CheckType P1 P2 * P4 * * Synopsis: type(r[P1@P2]) * diff --git a/src/box/sql/wherecode.c b/src/box/sql/wherecode.c index 1d7c76670..2459054ff 100644 --- a/src/box/sql/wherecode.c +++ b/src/box/sql/wherecode.c @@ -568,11 +568,6 @@ codeEqualityTerm(Parse * pParse, /* The parsing context */ * key value of the loop. If one or more IN operators appear, then * this routine allocates an additional nEq memory cells for internal * use. - * - * Before returning, @types is set to point to a buffer containing a - * copy of the column types array of the index allocated using - * sqlDbMalloc(). This array is passed to OP_ApplyType to provide - * correct implicit conversions. */ static int codeAllEqualityTerms(Parse * pParse, /* Parsing context */ -- 2.25.1