From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 8C5846DB24; Thu, 11 Nov 2021 14:01:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8C5846DB24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1636628501; bh=MbfhxY2MWGP2iRvfcSC57TaCKh1ubrBx5TY77tDSkpU=; h=To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=IeMC9yclvcyYvFdbcbWwxIWvRVEclHTn6BWQg+YQlymGw7ntajKVfZs5XG3m/xsF4 boJMYMONz26NqDu6TSJZZeCccqNICRUQ6V4/T1DApNbc3pnrJn/FLDIPnkfU69IuUk 6BIC5/eQw7RTOeRQOaqpXm4zBCSRw2ILQq0CA7YY= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (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 33E3071180 for ; Thu, 11 Nov 2021 13:53:38 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 33E3071180 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1ml7i5-0007nf-9j; Thu, 11 Nov 2021 13:53:37 +0300 To: kyukhin@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Thu, 11 Nov 2021 13:53:37 +0300 Message-Id: <51cd01732d6b5b12644464110b06168ec9db4ace.1636627944.git.imeevma@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9731B3922EC063979F8160E2FE2FDCF123B0537AAB149205200894C459B0CD1B9244BF2F1EB569D11B249A8428BD347FE6156B6F96FCCACDCAC22AB14350DA595 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE737BB76880A4CA9A4EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006375A514678F9DF65078638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D869B70965CF7C15FD3049CE126D9D6863117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC2EE5AD8F952D28FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD182CC0D3CB04F14752D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B66F6A3E018CF4DC80089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C4C7A0BC55FA0FE5FCC193C2BF92AA97644BC8C1AAD6B00FB55A678A1E138F4F04B1881A6453793CE9C32612AADDFBE061C801D989C91DAA47C32612AADDFBE061ED943DBD20860CC29510FB958DCE06DB6ED91DBE5ABE359A805C47957401F4811F9270390973918F93EDB24507CE13387DFF0A840B692CF8 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34C0DDD40374D3501710DD3F91A81FA98015E0DE7037EA2844E73D7194A5073381CFC886F97ECFEF941D7E09C32AA3244CC6DCA93BA6EAD4894782207663726D9B1E098CBE561D6343729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj4t8MBgWr8bJRbYMyUtOr2Q== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5DBC15E6690912773D616ACA48272C836683D72C36FC87018B9F80AB2734326CD2FB559BB5D741EB96352A0ABBE4FDA4210A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH v1 1/3] sql: properly set INTEGER type in struct Expr X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mergen Imeev via Tarantool-patches Reply-To: imeevma@tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Prior to this patch, in some cases a struct Expr value with an opcode TK_INTEGER could have field type ANY. This patch sets such values to the INTEGER field type. Part of #3174 --- src/box/sql/expr.c | 2 ++ src/box/sql/resolve.c | 1 + src/box/sql/select.c | 1 + 3 files changed, 4 insertions(+) diff --git a/src/box/sql/expr.c b/src/box/sql/expr.c index 25c390062..2c8021060 100644 --- a/src/box/sql/expr.c +++ b/src/box/sql/expr.c @@ -1010,6 +1010,7 @@ sql_expr_new_int(struct sql *db, int value) { struct Expr *e = sql_expr_new_empty(db, TK_INTEGER, 0); if (e != NULL) { + e->type = FIELD_TYPE_INTEGER; e->flags |= EP_IntValue; e->u.iValue = value; } @@ -3917,6 +3918,7 @@ sqlExprCodeTarget(Parse * pParse, Expr * pExpr, int target) return target; } else { tempX.op = TK_INTEGER; + tempX.type = FIELD_TYPE_INTEGER; tempX.flags = EP_IntValue | EP_TokenOnly; tempX.u.iValue = 0; r1 = sqlExprCodeTemp(pParse, &tempX, diff --git a/src/box/sql/resolve.c b/src/box/sql/resolve.c index 21fe124d7..22b4e6799 100644 --- a/src/box/sql/resolve.c +++ b/src/box/sql/resolve.c @@ -928,6 +928,7 @@ resolveCompoundOrderBy(Parse * pParse, /* Parsing context. Leave error messages } pNew->flags |= EP_IntValue; pNew->u.iValue = iCol; + pNew->type = FIELD_TYPE_INTEGER; if (pItem->pExpr == pE) { pItem->pExpr = pNew; } else { diff --git a/src/box/sql/select.c b/src/box/sql/select.c index 8ca967108..2f97d121d 100644 --- a/src/box/sql/select.c +++ b/src/box/sql/select.c @@ -3566,6 +3566,7 @@ multiSelectOrderBy(Parse * pParse, /* Parsing context */ } pNew->flags |= EP_IntValue; pNew->u.iValue = i; + pNew->type = FIELD_TYPE_INTEGER; pOrderBy = sql_expr_list_append(pParse->db, pOrderBy, pNew); if (pOrderBy) -- 2.25.1