Re: Collection of small fixes to binary transfer code and unit tests - Mailing list pgsql-jdbc

From Mikko Tiihonen
Subject Re: Collection of small fixes to binary transfer code and unit tests
Date
Msg-id 4E84FB50.2000000@nitorcreations.com
Whole thread Raw
In response to Re: Collection of small fixes to binary transfer code and unit tests  (Dave Cramer <pg@fastcrypt.com>)
List pgsql-jdbc
On 09/29/2011 07:10 PM, Dave Cramer wrote:
> Interestingly I do not see these errors when I run the test inside of
> eclipse, but I do when I run it from ant.

The build.xml forces binary transfers by default.
(maybe we should alter it to run all tests twice, once with binary transfer enabled, another with disabled?)

> On Thu, Sep 29, 2011 at 7:53 AM, Dave Cramer<pg@fastcrypt.com>  wrote:
>> Mikko,
>>
>> I get the following errors after applying your patch.
>>
>>     [junit] Testcase:
>> testMaxFieldSize(org.postgresql.test.jdbc2.ResultSetTest):
>> FAILED
>>     [junit] null expected:<[12345]>  but was:<[09]>
>>     [junit] junit.framework.ComparisonFailure: null expected:<[12345]>
>> but was:<[09]>
>>     [junit]     at
>> org.postgresql.test.jdbc2.ResultSetTest.testMaxFieldSize(ResultSetTest.java:174)

Are you sure you applied the binary-fix-maxfieldlength-test.patch - the above failure looks like what it is trying to
fix.

>>     [junit] Testcase:
>> testGetTimestampWTZ(org.postgresql.test.jdbc2.TimestampTest):
>> FAILED
>>     [junit] expected:<2000-07-07 11:00:00.123>  but was:<2000-07-07
>> 11:00:00.122999>
>>     [junit] junit.framework.AssertionFailedError: expected:<2000-07-07
>> 11:00:00.123>  but was:<2000-07-07 11:00:00.122999>
>>     [junit]     at
>> org.postgresql.test.jdbc2.TimestampTest.timestampTestWTZ(TimestampTest.java:436)
>>     [junit]     at
>> org.postgresql.test.jdbc2.TimestampTest.testGetTimestampWTZ(TimestampTest.java:188)
>>     [junit]
>>     [junit]
>>     [junit] Testcase:
>> testSetTimestampWTZ(org.postgresql.test.jdbc2.TimestampTest):
>> FAILED
>>     [junit] expected:<2000-07-07 11:00:00.123>  but was:<2000-07-07
>> 11:00:00.122999>
>>     [junit] junit.framework.AssertionFailedError: expected:<2000-07-07
>> 11:00:00.123>  but was:<2000-07-07 11:00:00.122999>
>>     [junit]     at
>> org.postgresql.test.jdbc2.TimestampTest.timestampTestWTZ(TimestampTest.java:436)
>>     [junit]     at
>> org.postgresql.test.jdbc2.TimestampTest.testSetTimestampWTZ(TimestampTest.java:258)

This is quite interesting: Expected <2000-07-07 11:00:00.123>  but was:<2000-07-07 11:00:00.122999>
It looks like a rounding error. Do you happen to have integer datetime disabled in backend (which means
that it is using float8 internally to store the time).

-Mikko

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Collection of small fixes to binary transfer code and unit tests
Next
From: Thomas Strunz
Date:
Subject: metadata.getColumns() using Apache Tomcat / jndi