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 1kBkEm-00080E-4J for pgsql-jdbc@arkaria.postgresql.org; Fri, 28 Aug 2020 19:40:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kBkEk-00028O-RE for pgsql-jdbc@arkaria.postgresql.org; Fri, 28 Aug 2020 19:40:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kBkEk-00028H-KL for pgsql-jdbc@lists.postgresql.org; Fri, 28 Aug 2020 19:40:34 +0000 Received: from out-18.smtp.github.com ([192.30.252.201]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kBkEd-0006NR-GR for pgsql-jdbc@lists.postgresql.org; Fri, 28 Aug 2020 19:40:33 +0000 Received: from github-lowworker-f045d1f.ac4-iad.github.net (github-lowworker-f045d1f.ac4-iad.github.net [10.52.19.54]) by smtp.github.com (Postfix) with ESMTP id 7FEF0340EA1 for ; Fri, 28 Aug 2020 12:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1598643625; bh=PsHcr+RYPMHSPzKDWOJGlmh3EV4K3hDDwg6KiOs8gRw=; h=Date:From:To:Subject:From; b=DwVxIr0RpeymH/zmocRVmSRfVboun0UggSzLOmN3ffEM70sNXDwt55kGz8iXgKRjR kumcjYharRqUgOl8quRY14cEAkdpaHORADhUDwSl5v2hccJHDFaoppKwiJ1cJJH/V8 tzABg1vwucfLClBv/QpYEKSQ452ahUJ9MxGwZ/rQ= Date: Fri, 28 Aug 2020 12:40:25 -0700 From: Vladimir Sitnikov To: pgsql-jdbc@lists.postgresql.org Message-ID: Subject: [pgjdbc/pgjdbc] c745f4: fix: handle nulls when the following clasess are u... 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: Precedence: bulk Branch: refs/heads/release/42.2 Home: https://github.com/pgjdbc/pgjdbc Commit: c745f4e549b119b8332ef48bbc8b8525ccba0f21 https://github.com/pgjdbc/pgjdbc/commit/c745f4e549b119b8332ef48bbc8b8525ccba0f21 Author: Vladimir Sitnikov Date: 2020-08-28 (Fri, 28 Aug 2020) Changed paths: M CHANGELOG.md M pgjdbc/src/main/java/org/postgresql/geometric/PGbox.java M pgjdbc/src/main/java/org/postgresql/geometric/PGcircle.java M pgjdbc/src/main/java/org/postgresql/geometric/PGline.java M pgjdbc/src/main/java/org/postgresql/geometric/PGlseg.java M pgjdbc/src/main/java/org/postgresql/geometric/PGpath.java M pgjdbc/src/main/java/org/postgresql/geometric/PGpoint.java M pgjdbc/src/main/java/org/postgresql/geometric/PGpolygon.java M pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java M pgjdbc/src/main/java/org/postgresql/jdbc/PgPreparedStatement.java M pgjdbc/src/main/java/org/postgresql/util/PGInterval.java M pgjdbc/src/main/java/org/postgresql/util/PGmoney.java M pgjdbc/src/main/java/org/postgresql/util/PGobject.java A pgjdbc/src/test/java/org/postgresql/test/jdbc2/PGObjectGetTest.java A pgjdbc/src/test/java/org/postgresql/test/jdbc2/PGObjectSetTest.java Log Message: ----------- fix: handle nulls when the following clasess are used: PGbox, PGcircle, PGline, PGlseg, PGpath, PGpoint, PGpolygon, and PGmoney 1) PGobject.setValue(null) can be used to set the wrapped value to null Note: previously the sub-classes of PGobject threw NPE for setValue(null) 2) Return null from `getValue` in case the typed null is received from the database 3) Assume PGBinaryObject#lengthInBytes == 0 means the value should be set as null when sending data to the database see #1870