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 3493870353; Thu, 28 Oct 2021 13:53:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3493870353 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1635418382; bh=5pBOjw4goFKHDC+suZwwJCOlLVu1YroIeSWsShsSEAU=; 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=qHN4gqx9ekktU0Zd8EAp+o3LQBNfBMhCC/ahgpkAAGRuCTvV0RuvqEnJxav/0heJA lGkYEFOmC5j6aRPqrM40b6NKWDu0ZhKUaqe66o/4A3t4HguXoci42XH337dSwufssg U++xuSLVqw2pyMA0NjuSDZBwrecj44BAYl7ADeww= 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 5909A70353 for ; Thu, 28 Oct 2021 13:52:30 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5909A70353 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1mg31J-00047N-Qw; Thu, 28 Oct 2021 13:52:30 +0300 To: v.shpilevoy@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Thu, 28 Oct 2021 13:52:29 +0300 Message-Id: <7943814b5d8f459be135bbb14a55c6f7ecb7e50d.1635418233.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: 4F1203BC0FB41BD9E6B4260954843F6F1E295CE9DD6897B49E3CDCEC2471435800894C459B0CD1B9D4B0D6DC8DA14C49C601AF8D436C7096907A1929F371C46D21809EC83B530B45 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F544D30F1A6FA191EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637B997C8222C70C3D98638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D84DA5AE277E7C782CFC09EE5D79B0E291117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC2EE5AD8F952D28FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD182CC0D3CB04F14752D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B62CFFCC7B69C47339089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458834459D11680B5053192DBFE7505CB243567BE1F4D5B03B0 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C4C7A0BC55FA0FE5FC22FBBC87FA1F02BA623F8A91077B9E5D75046D3F95155132B1881A6453793CE9C32612AADDFBE061C801D989C91DAA47C32612AADDFBE061ED943DBD20860CC29510FB958DCE06DB6ED91DBE5ABE359A48600B0EAD68145B1B2EFE7B39F7738393EDB24507CE13387DFF0A840B692CF8 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3433E9BC74ABA5769FECE11A3C8E8D4E6D4E17E265B3401D72D88CC54CFF9AB43BC022B644DD3643741D7E09C32AA3244C82F0472ABD4022D283969B6502961B55E8FBBEFAE1C4874C729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojdMRfVmNkPDhUJSoWGQQHUA== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D1C1FB94454418AF3C89980A11498EAB383D72C36FC87018B9F80AB2734326CD2FB559BB5D741EB96352A0ABBE4FDA4210A04DAD6CC59E33667EA787935ED9F1B 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 db8355f33..d3fde9501 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; } @@ -3886,6 +3887,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