pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Radosław Smogura <rsmogura@softperience.eu>
To: pgsql-jdbc@postgresql.org
Subject: Re: Binary protocol support for JDBC
Date: Sat, 24 Jul 2010 17:21:00 +0200
Message-ID: <201007241721.00711.rsmogura@softperience.eu> (raw)

Hello,

At the begining I would like to ask if those patches, from can be applied to 
trunk sources from CVS, because I want to build complete version.

In the second part of message I wuould like to correct a little a method for 
BigDecimal I posted before. There, I don't know way was a small mistake in 
last "tail" if. In particullary sign number disappered should be 
BigInteger(bigDecimalSign, buffer);, and complete version is.

 if (tail % 2 == 1) {
            buffer = new byte[2];
            buffer[0] = number[number.length - 2];
            buffer[1] = number[number.length - 1];
            BigInteger valBigInteger = new BigInteger(bigDecimalSign, buffer);
            unscaledValue = unscaledValue.multiply(nbase).add(valBigInteger);
//                System.out.println("Value (2)  unscaled =" +  unscaledValue
//                        +", valBI = "+ valBigInteger);
        }

I know that this version can work for version 8 of PostgreSQL, but 
unfortunalty I don't have sources to check for 7.x versions. I don't know way 
how to get valid nbase for given version, so I use nbase encoded in sources 
(this nbase doesnt depend on compile parameters). Maybe it isn't problem as 
version 9.0 is incoming. 

Regards,
Radek



view thread (6+ messages)

Message-ID: <201007241721.00711.rsmogura@softperience.eu>
Permalink:  ../201007241721.00711.rsmogura@softperience.eu/
Also on:    postgresql.org/message-id/201007241721.00711.rsmogura@softperience.eu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: rsmogura@softperience.eu
  Subject: Re: Binary protocol support for JDBC
  In-Reply-To: <201007241721.00711.rsmogura@softperience.eu>
  References: <201007241721.00711.rsmogura@softperience.eu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox