Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fDEEb-0001y3-FF for pgsql-committers@arkaria.postgresql.org; Mon, 30 Apr 2018 19:13:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fDEEa-0008Fr-A9 for pgsql-committers@arkaria.postgresql.org; Mon, 30 Apr 2018 19:13:12 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fDEEZ-0008Fi-Um for pgsql-committers@lists.postgresql.org; Mon, 30 Apr 2018 19:13:12 +0000 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fDEEX-0006Io-1Q for pgsql-committers@lists.postgresql.org; Mon, 30 Apr 2018 19:13:10 +0000 Received: by mail-qk0-x242.google.com with SMTP id z75so7421200qkb.6 for ; Mon, 30 Apr 2018 12:13:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=vXUS6WyxTHdtXlE6p5IULn2xiM4+XrTLXkUGzlcRzdw=; b=nN23mIoINRvYoUwS0M7SAFRjineyZXAZNMTcTIfPlp8CLek9rZWxVdhxXGzC3GOyMB tHEpRMZdi4F8MeSlY8nBHD7xyq875j01nNidoeX+Wvlz+avEXFZq/WgZyc84UFAumjVM Ey0gmi3jVV7X/oNlm85bY69gi4P2kw1NdHD70dNhu/EmhActpSi9vmEiYZnyhrD1H1qB 7NxFVxaGNYptFa/1Z0iWbgc07lyA5tEr3hWNC/r9Lvi1pMvAN6R9bo2mHL6BGKOz23wl qRHui94ksOB/pdy3Vf3Y9puf0l+4PRG+gd4NAJxhLjsP7lcEt+uR1oGjoC0XRSCk9w4c CnkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=vXUS6WyxTHdtXlE6p5IULn2xiM4+XrTLXkUGzlcRzdw=; b=EqUQqq02BAdFox5mU2QP/pilvhROhnpA2rTha+GxYubsveNq7nOFTt4Tk+KuSUEdI4 EQx2gLHxfzQbj8w2I2ZdZiNtg8qB3HSfIkWnusS8ptDK/t1YMT+Fg250JjYHNc9ELAXk DOwX5EoWW/Ua4Re8sSILJlOOUo7iGC2QLUSyi2owbc17kZ4/yf6ZzzFNw4JgaGfVJC+X +QlTrODRWWV8o8y0qx+/2G9Dg06QTZHwsQBbjIQH7USUrDR3L27WGOOUYWfe6hCgZsXL ZhkbRGy9ytqTLSXlUk6dvxDO9JutL+RJxbHSsvWPi10/XDWQVz35hEzmHkWyUHwvxAPS qyGA== X-Gm-Message-State: ALQs6tBJQsLrGLOVAuoqB2kYE4TTSMRXgFLrGptOhHB7NXXZfsuiqiLQ /tn2J1ZIJGu4i7Bs9t3SaXDYBdIBKjGTv5jcBH770Airnxv4fi4IdxM8MzbyO+wB1njAbM0StYo 7ZmSFg5J6ohZbo0lIPlwsGQhjAbZE5dK5JNVcrt062n9o7pjO5DRI6w37og+h1qabmzWrviSmgJ aqELF9I3sz4I7do9HGhOqVFVZk X-Google-Smtp-Source: AB8JxZrcleFpS6Zp+N/jf8sYBBkVQgr+AZUungPBbiCHwN+Z7KiJfzd/yC3qdL2PfKyQeGB2UxPhqQ== X-Received: by 10.55.31.161 with SMTP id n33mr11245238qkh.393.1525115587306; Mon, 30 Apr 2018 12:13:07 -0700 (PDT) Received: from [192.168.10.146] ([98.122.175.38]) by smtp.gmail.com with ESMTPSA id x28-v6sm7250188qtx.95.2018.04.30.12.13.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Apr 2018 12:13:06 -0700 (PDT) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: pgsql: Prevent infinity and NaN in jsonb/plperl transform To: Tom Lane , Peter Eisentraut Cc: Andrew Dunstan , pgsql-committers@lists.postgresql.org References: <21194.1525110966@sss.pgh.pa.us> <59e5787f-314e-6e5d-db5e-bcb6b9dbc25c@2ndquadrant.com> <23691.1525113718@sss.pgh.pa.us> Message-ID: <213242a0-0ed8-ade6-822c-0270f7064799@2ndQuadrant.com> Date: Mon, 30 Apr 2018 15:13:05 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <23691.1525113718@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-MW List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 04/30/2018 02:41 PM, Tom Lane wrote: > Peter Eisentraut writes: >> On 4/30/18 13:56, Tom Lane wrote: >>> So this isn't working on Windows: ... >>> The reason seems to be this kluge in plperl.h: >>> >>> /* stop perl headers from hijacking stdio and other stuff on Windows */ >>> #ifdef WIN32 >>> #define WIN32IO_IS_STDIO >>> /* >>> * isnan is defined in both the perl and mingw headers. We don't use it, >>> * so this just clears up the compile warning. >>> */ >>> #ifdef isnan >>> #undef isnan >>> #endif >>> #endif /* WIN32 */ >>> >>> Looks like the half-life of that hack just expired. What shall >>> we do about it? >> I have removed this for now. If it's really just about a compiler >> warning, then we can find a different workaround later. > I was just about to propose exactly that fix. This undef'ing of isnan > traces back to Andrew's 2006 commit ea73a78b0. I think perhaps that's not > necessary with any still-supported version of Perl; I see no evidence on > my machines that any Perl header #defines isnan. There is this bit: > > #ifdef UNDER_CE > int isnan(double d); > #endif > > which would cause trouble if isnan is a macro, but we can hope that > that doesn't apply to us. > > Fingers crossed we'll be OK. Looking at the perl headers on a Windows machine I'm doing some other stuff on, the #define is protected by an #ifndef. I'm always happy when my hacks can be removed :-) cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services