Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ofXhM-0006yZ-Du for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Oct 2022 02:30:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ofXhL-0002JF-9v for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Oct 2022 02:30:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ofXhK-0002J6-U1 for pgsql-hackers@lists.postgresql.org; Tue, 04 Oct 2022 02:30:19 +0000 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ofXhG-00007C-N6 for pgsql-hackers@postgresql.org; Tue, 04 Oct 2022 02:30:17 +0000 Received: by mail-il1-x131.google.com with SMTP id y17so2010187ilq.8 for ; Mon, 03 Oct 2022 19:30:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=W+hyX1WqI1vhy4yLhTxmhPXATZi2s7QvntIszhRy41s=; b=YoHUaP4piq+evEqZZx0ruiKRy0PKAk+Z4KyG6bwQcIMRaVKfKRWFZcZ1T6NowmKKiV rBxVxCPC03sYDW6XdFUUFLLzaDxZZTNofgR+/G3dI0m9gAATImtiq9SxLthu3eahFuQp BRDiFl/3R1HkxsHOp7O7DUt0PG/xTlQaIkyji6PohX2aj7nxMqFAElxzEZcpbnmVbheV NeKeQD2gr/GyJYhigFDpAhkr2GJHX7RFgiX0+WGxkZSCxKzFQkoBR+CYchJeyY99qLZX RhUm1ubc2rIvwzR/mQFnuFIFhits8mWGCri4yx46YKkdbIFJZBLFGD89Kxpg1cPp2CWd /lQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W+hyX1WqI1vhy4yLhTxmhPXATZi2s7QvntIszhRy41s=; b=ryzgJ220CGX1eHc3HJwnDi3J3/72P/PoVS8dI3mtSeK64452kSug5dHzW/QMkdgin5 +YJKMyxpgPhiv2wyL7AsORSHpe0bS/xqYBmadu2K56/EdZDRNBihHbUXkVt7MyZyXha5 R5sRRfbcUtSZ7McxzewDOnyIjxfdJnoHIGXrXhHApfkKq+gsZ/LVJkw3yNe3GGW1n9Ks C3hum8u3EJgVL2wYnDeXXdWgI9TZqr53hh9Zct/csWqKCpge4kit4VbxHrAEC5yyh75B rJz1XcV92sBfmxG3Rr8dY6ZLv5VhhAw2lJYQPyVEHx/d/r1L9UqIywkDjdl4BZSj+wgq K0ew== X-Gm-Message-State: ACrzQf0zif8clydKO4wiiaDAA4HE2VPHYMoJag8rwykdHA9fE61FPuEQ 1Amlq+FSpIz+BmW+X8S7RaOCyQ== X-Google-Smtp-Source: AMsMyM4kcOSGoP/fWvhE2WY3bAYXHps9Te1Aoo/JE7DQ1hv9zLfWoP6RE+D/SHfkjFqurzowuuBRnA== X-Received: by 2002:a92:1945:0:b0:2f8:c7bc:b339 with SMTP id e5-20020a921945000000b002f8c7bcb339mr9973180ilm.171.1664850613871; Mon, 03 Oct 2022 19:30:13 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id w23-20020a02b0d7000000b003630de3af7fsm2214341jah.179.2022.10.03.19.30.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Oct 2022 19:30:13 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 4B46D80057D; Mon, 3 Oct 2022 21:30:12 -0500 (CDT) Date: Mon, 3 Oct 2022 21:30:12 -0500 From: Justin Pryzby To: David Rowley Cc: pgsql-hackers@postgresql.org, Tomas Vondra , Peter Smith Subject: Re: shadow variables - pg15 edition Message-ID: <20221004023012.GT7745@telsasoft.com> References: <20220819042816.GU26426@telsasoft.com> <20220823011659.GF2342@telsasoft.com> <20220823021412.GG2342@telsasoft.com> <20220824023944.GM2342@telsasoft.com> <20220830054441.GF31833@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Oct 04, 2022 at 02:27:09PM +1300, David Rowley wrote: > On Tue, 30 Aug 2022 at 17:44, Justin Pryzby wrote: > > Would you check if any of these changes are good enough ? > > I looked through v5.txt and modified it so that the fix for the shadow > warnings are more aligned to the spreadsheet I created. Thanks > diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c > index 350039cc86..7848deeea9 100644 > --- a/src/backend/utils/adt/datetime.c > +++ b/src/backend/utils/adt/datetime.c > @@ -1019,17 +1019,17 @@ DecodeDateTime(char **field, int *ftype, int nf, > if (ptype == DTK_JULIAN) > { > char *cp; > - int val; > + int jday; > > if (tzp == NULL) > return DTERR_BAD_FORMAT; > > errno = 0; > - val = strtoint(field[i], &cp, 10); > + jday = strtoint(field[i], &cp, 10); > if (errno == ERANGE || val < 0) > return DTERR_FIELD_OVERFLOW; Here, you forgot to change "val < 0". I tried to see how to make that fail (differently) but can't see yet how pass a negative julian date.. -- Justin