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 1pDShE-0003bj-5q for pgsql-jdbc@arkaria.postgresql.org; Thu, 05 Jan 2023 16:02:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pDSgD-0006pY-K8 for pgsql-jdbc@arkaria.postgresql.org; Thu, 05 Jan 2023 16:01:21 +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 1pDSgD-0006pP-Ay for pgsql-jdbc@lists.postgresql.org; Thu, 05 Jan 2023 16:01:21 +0000 Received: from out-18.smtp.github.com ([192.30.252.201] helo=smtp.github.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pDSgA-0006gm-HS for pgsql-jdbc@lists.postgresql.org; Thu, 05 Jan 2023 16:01:20 +0000 Received: from github.com (hubbernetes-node-324bc5f.va3-iad.github.net [10.48.204.66]) by smtp.github.com (Postfix) with ESMTPA id 4CF4434104A for ; Thu, 5 Jan 2023 08:01:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1672934477; bh=j55M36eFhvM8ZbLupP04rIeS52N/6z/5cRw4HjYCaaY=; h=Date:From:To:Subject:From; b=ufZizrczkI7WWZDc49imZZ6WtjZ0dBc6CGNlrQqbxqCeX3bxlvDt29k9YWMajgB8g +s4y9kgxBceZrmlgpl9r6tDfGfKLU3B9228YkLPT8onMjRT1Z7IXVm8vt9y5bbOAYq ewJmGk+4tmpQ0k/sm5zvTgiS9EocF9LOB4NeFaik= Date: Thu, 05 Jan 2023 08:01:17 -0800 From: Brett Okken To: pgsql-jdbc@lists.postgresql.org Message-ID: Subject: [pgjdbc/pgjdbc] 41e4ca: fix binary transfer floating point overflow (#2710) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Approved: 58GruLoMopuc X-GitHub-Recipient-Address: pgsql-jdbc@lists.postgresql.org X-Auto-Response-Suppress: All List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Branch: refs/heads/master Home: https://github.com/pgjdbc/pgjdbc Commit: 41e4ca6ea0f55814691b479e7c4e651475b1f77c https://github.com/pgjdbc/pgjdbc/commit/41e4ca6ea0f55814691b479e7c4e651475b1f77c Author: Brett Okken Date: 2023-01-05 (Thu, 05 Jan 2023) Changed paths: M pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java M pgjdbc/src/test/java/org/postgresql/test/jdbc2/ResultSetTest.java Log Message: ----------- fix binary transfer floating point overflow (#2710) * fix binary transfer floating point overflow https://github.com/pgjdbc/pgjdbc/issues/2696 for float4 and float8 only use BigDecimal for values outside range of java int. float4 convert to double for BigDecimal calculation this maintains the precision present in the binary value even if the string representation strips it * binary floating point math :( Co-authored-by: Dave Cramer