Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j6bvw-0001t1-H2 for pgsql-jdbc@arkaria.postgresql.org; Tue, 25 Feb 2020 15:15:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j6bvv-0006PU-8a for pgsql-jdbc@arkaria.postgresql.org; Tue, 25 Feb 2020 15:15:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j6bvu-0006PK-Tx for pgsql-jdbc@lists.postgresql.org; Tue, 25 Feb 2020 15:15:39 +0000 Received: from out-25.smtp.github.com ([192.30.252.208]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j6bvs-0003ve-EI for pgsql-jdbc@lists.postgresql.org; Tue, 25 Feb 2020 15:15:37 +0000 Received: from github-lowworker-cde56e0.va3-iad.github.net (github-lowworker-cde56e0.va3-iad.github.net [10.48.25.52]) by smtp.github.com (Postfix) with ESMTP id 93696281189 for ; Tue, 25 Feb 2020 07:15:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1582643735; bh=5sLoGrqzx4WXAVAWCSKdkUFl5ACmyokBvs9mfT0Hz0U=; h=Date:From:To:Subject:From; b=WYeuOCk1PM9R8V57HoHNgWqXzSKW7RObc70DU7UHb/tiOkBBNXuYo4+J1HYlnictJ w/zg69fvDutrYf5u2WnkfQIYVB0HqHyg3s3OB9OWRXf9BiUJ0dwbRRXmwHpsXJCwcG yVgWXJo2RFYB7tG3Yj5eCrOPUUeV7DWJuvbCoy2Y= Date: Tue, 25 Feb 2020 07:15:35 -0800 From: crwr45 To: pgsql-jdbc@lists.postgresql.org Message-ID: Subject: [pgjdbc/pgjdbc] 30843e: fix: allow DatabaseMetaData.getColumns to describe... 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/master Home: https://github.com/pgjdbc/pgjdbc Commit: 30843e45edc1e2bac499df2d1576c2db4d3d3309 https://github.com/pgjdbc/pgjdbc/commit/30843e45edc1e2bac499df2d1576c2db4d3d3309 Author: crwr45 <34647635+crwr45@users.noreply.github.com> Date: 2020-02-25 (Tue, 25 Feb 2020) Changed paths: M pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java A pgjdbc/src/test/java/org/postgresql/test/jdbc42/DatabaseMetaDataTest.java Log Message: ----------- fix: allow DatabaseMetaData.getColumns to describe an unset scale (#1716) getColumns returns a 0 for the scale of a Decimal or Numeric column when the scale is 0, and when the scale is null. The caller can then not differentiate between a 0 or a null without another query. This change replaces the 0 in the ResultSet for scale with a null when describing an unscaled Decimal or Numeric column. getInt will still convert the null to a 0, but the caller can then use wasNull() to find out if the underlying value was 0 or null. This addresses Issue 1712. It is a breaking change, but if the correct getter (getInt) is used for the column, there is no difference. Other getters may behave differently. Signed-off-by: crwr45