Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TWX6i-0000ey-Em for pgsql-jdbc@postgresql.org; Thu, 08 Nov 2012 18:45:40 +0000 Received: from mail63.csoft.net ([205.205.214.4]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TWX6g-00086h-EE for pgsql-jdbc@postgresql.org; Thu, 08 Nov 2012 18:45:39 +0000 Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 7605D284A3; Thu, 8 Nov 2012 13:45:37 -0500 (EST) Received: by leary.csoft.net (Postfix, from userid 1112) id 26D681FBC8; Thu, 8 Nov 2012 13:45:37 -0500 (EST) Date: Thu, 8 Nov 2012 13:45:36 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Peter Cooner cc: dmp , pgsql-jdbc@postgresql.org Subject: Re: Possible bug / regression from generated keys In-Reply-To: Message-ID: References: <509A8FDC.6040403@ttc-cmc.net> <509A989D.5020108@ttc-cmc.net> <509B0539.1050601@ttc-cmc.net> <509BD654.5030500@ttc-cmc.net> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-632758616-1352400336=:29600" X-Pg-Spam-Score: -2.3 (--) X-Archive-Number: 201211/36 X-Sequence-Number: 23503 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-632758616-1352400336=:29600 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 8 Nov 2012, Peter Cooner wrote: > I tried to write a test case for a few days before I mailed the list > and was unable to produce the problem :( Based on this description, I created a self contained test which is attached. The problem is that the driver is splicing together a single generated keys ResultSet from each individual batch execution, but some results come back in text format and some come back in binary. The combined result has a single per column format flag and it gets confused when trying to parse a text result that it thinks is in binary format. The driver needs to be taught not to change the requested format mid batch execution, but this is a tricky area. Kris Jurka --0-632758616-1352400336=:29600 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=BinBatchPS.java Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=BinBatchPS.java aW1wb3J0IGphdmEuc3FsLio7DQoNCnB1YmxpYyBjbGFzcyBCaW5CYXRjaFBT IHsNCg0KCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZyBhcmdzW10p IHRocm93cyBFeGNlcHRpb24gew0KCQlDbGFzcy5mb3JOYW1lKCJvcmcucG9z dGdyZXNxbC5Ecml2ZXIiKTsNCgkJQ29ubmVjdGlvbiBjb25uID0gRHJpdmVy TWFuYWdlci5nZXRDb25uZWN0aW9uKCJqZGJjOnBvc3RncmVzcWw6Ly9sb2Nh bGhvc3Q6NTQzMi9qdXJrYT9sb2dsZXZlbD0yIiwgImp1cmthIiwgIiIpOw0K DQoJCVN0YXRlbWVudCBzdG10ID0gY29ubi5jcmVhdGVTdGF0ZW1lbnQoKTsN CgkJc3RtdC5leGVjdXRlKCJDUkVBVEUgVEVNUCBUQUJMRSB0bXB0YWIgKGlk IGJpZ3NlcmlhbCwgdmFsIHRleHQpIik7DQoJCXN0bXQuY2xvc2UoKTsNCg0K CQlQcmVwYXJlZFN0YXRlbWVudCBwcyA9IGNvbm4ucHJlcGFyZVN0YXRlbWVu dCgiSU5TRVJUIElOVE8gdG1wdGFiICh2YWwpIFZBTFVFUyAoPykiLCBTdGF0 ZW1lbnQuUkVUVVJOX0dFTkVSQVRFRF9LRVlTKTsNCgkJUGFyYW1ldGVyTWV0 YURhdGEgcG1kID0gcHMuZ2V0UGFyYW1ldGVyTWV0YURhdGEoKTsNCgkJZm9y IChpbnQgaT0wOyBpPDU7IGkrKykgew0KCQkJcHMuc2V0U3RyaW5nKDEsICJh Iik7DQoJCQlwcy5hZGRCYXRjaCgpOw0KCQl9DQoJCXBzLmV4ZWN1dGVCYXRj aCgpOw0KCQlSZXN1bHRTZXQgcnMgPSBwcy5nZXRHZW5lcmF0ZWRLZX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