Commit d650a6f5 authored by Barry Lind's avatar Barry Lind

updated patch from Mark Lillywhite per Tom Lane's comments: subtract VARHDRSZ...

updated patch from Mark Lillywhite per Tom Lane's comments: subtract VARHDRSZ first then and with 0xffff
parent d80d4baa
...@@ -13,7 +13,7 @@ import org.postgresql.util.PSQLException; ...@@ -13,7 +13,7 @@ import org.postgresql.util.PSQLException;
/** /**
* This class provides information about the database as a whole. * This class provides information about the database as a whole.
* *
* $Id: DatabaseMetaData.java,v 1.40 2001/10/25 05:59:59 momjian Exp $ * $Id: DatabaseMetaData.java,v 1.41 2001/10/30 05:09:51 barry Exp $
* *
* <p>Many of the methods here return lists of information in ResultSets. You * <p>Many of the methods here return lists of information in ResultSets. You
* can use the normal ResultSet methods such as getString and getInt to * can use the normal ResultSet methods such as getString and getInt to
...@@ -2014,12 +2014,12 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData ...@@ -2014,12 +2014,12 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
// Decimal digits = scale // Decimal digits = scale
// From the source (see e.g. backend/utils/adt/numeric.c, // From the source (see e.g. backend/utils/adt/numeric.c,
// function numeric()) the scale and precision can be calculated // function numeric()) the scale and precision can be calculated
// from the typmod value. mark@plasticsoftware.com.au // from the typmod value.
if (typname.equals("numeric") || typname.equals("decimal")) if (typname.equals("numeric") || typname.equals("decimal"))
{ {
int attypmod = r.getInt(8); int attypmod = r.getInt(8);
tuple[8] = tuple[8] =
Integer.toString((attypmod & 0xffff) - VARHDRSZ).getBytes(); Integer.toString((attypmod - VARHDRSZ) & 0xffff).getBytes();
} }
else else
tuple[8] = "0".getBytes(); tuple[8] = "0".getBytes();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment