Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 0E7101337B4E for ; Wed, 24 Nov 2010 14:18:54 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 09464-08; Wed, 24 Nov 2010 18:18:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from progressive.micfo.com (progressive.micfo.com [174.34.188.2]) by mail.postgresql.org (Postfix) with ESMTP id 713F31337B39; Wed, 24 Nov 2010 14:18:44 -0400 (AST) Received: from 87-204-194-135.dg-net.pl ([87.204.194.135]:55020 helo=radek.localnet) by progressive.micfo.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1PLJvT-00071g-Md; Wed, 24 Nov 2010 12:18:40 -0600 From: =?utf-8?q?Rados=C5=82aw_Smogura?= To: Maciek Sakrejda Subject: Re: [JDBC] JDBC and Binary protocol error, for some statements Date: Wed, 24 Nov 2010 19:18:40 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.34-gentoo-r12; KDE/4.4.5; x86_64; ; ) Cc: PG Hackers , PostgreSQL JDBC List References: In-Reply-To: MIME-Version: 1.0 Message-Id: <201011241918.40930.rsmogura@softperience.eu> Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - progressive.micfo.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - softperience.eu X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201011/1629 X-Sequence-Number: 174772 I didn't described log correctly, 1st attached response is normal execution; flags QUERY_SUPPRESS_BEGIN | QUERY_ONESHOT, 2nd is compiled statement QUERY_SUPPRESS_BEGIN only. Text format is marked as 0, binary format is 1. The 1st shown execution (flags=17) is good, it tells that result is sended in binary format, as int4, but 2nd one (flags=16) (statement compiled) result is bad because Server described row as text 07:52:06.061 (54) <=BE RowDescription(1) 07:52:06.061 (54) Field(,INT4,4,T) but recieved "tuple" was clearly in binary format, 0x00, 0x00, 0x00, 0x02. (Look at length should be 1 or 2 if it's text format and value 2) Speaking it simple, server said "you will recive text data", but sent it as binary encoded int. I've checked this againt 8.4 and 9.0.1. Maciek Sakrejda Wednesday 24 November 2010 18:02:27 > >Result is oid=23, format=(0) T, value = 0x00,0x00,0x00,0x02 > > What do you mean regarding the format? Are you just inferring that > from the data? If memory serves, the format of a particular column is > not specified anywhere other than the RowDescription, and according to > your JDBC log output above, the server is telling you the format is > text (1) (which is your point--it doesn't match the resulting > data--but I want to make sure we're clear on what's actually going > on). It's jdbc2.PreparedStatementTest, form JDBC driver unit tests. I've exposed sources here http://www.rsmogura.net/pgsql/pgjdbc_exp_20101124.tar.gz compiled driver and unit tests are in parent directory. In above all not related to this bug tests has been commented, just run ant test. > Also, can you narrow this down to a simple, self-contained test case > (with code)? Even if it's against a custom driver build, that would be > easier to investigate. > --- > Maciek Sakrejda | System Architect | Truviso > > 1065 E. Hillsdale Blvd., Suite 215 > Foster City, CA 94404 > (650) 242-3500 Main > www.truviso.com Kind regards, Radek