Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwWsL-0003n1-5x for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Oct 2016 16:04:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bwWsK-0001Ud-NI for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Oct 2016 16:04:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bwWsK-0001UX-D1 for pgsql-bugs@postgresql.org; Tue, 18 Oct 2016 16:04:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bwWsH-0004nf-NQ for pgsql-bugs@postgresql.org; Tue, 18 Oct 2016 16:04:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u9IG4Igt016621; Tue, 18 Oct 2016 12:04:18 -0400 From: Tom Lane To: pq@lengkeek.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14379: Different results In-reply-to: <20161018152550.1413.6439@wrigleys.postgresql.org> References: <20161018152550.1413.6439@wrigleys.postgresql.org> Comments: In-reply-to pq@lengkeek.com message dated "Tue, 18 Oct 2016 15:25:50 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16619.1476806658.1@sss.pgh.pa.us> Date: Tue, 18 Oct 2016 12:04:18 -0400 Message-ID: <16620.1476806658@sss.pgh.pa.us> X-Pg-Spam-Score: -2.2 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org pq@lengkeek.com writes: > The following query: > SELECT '2147483648'::cid; > Returns '2147483648' on Linux server (9.5.1) and '2147483647' (=INT32_MAX) > on windows server (9.4.9 and 9.5.4). > Not sure if this is a bug. I thought it surprising that results differ. I > couldn't see any uint32 to int32 conversion in a fast scan of the source. Hmm. cidin() just uses atoi() and doesn't worry about overflow. I'm not sure how much we care about detecting invalid input, since CID isn't really a user-facing type, but nonetheless atoi() seems like the wrong thing here because CommandId is uint32 not int32. It really ought to use strtoul() like xidin() does, so that it can correctly read any output of cidout(). Thanks for the report! regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs