From: schabi at logix-tt.com (Markus Schaber) Date: Mon, 25 Sep 2006 19:06:43 +0200 Subject: [Pljava-dev] VARLEN Patch for UDT.c In-Reply-To: <45150E10.8030907@logix-tt.com> References: <4512F5E4.9060600@logix-tt.com> <45139C17.3050006@tada.se> <4513A107.4060809@logix-tt.com> <4513A3ED.3050401@tada.se> <4513E2C0.3050804@logix-tt.com> <4513E52B.5080108@tada.se> <4513F1A0.8020800@logix-tt.com> <4513F639.3000108@tada.se> <45140A51.8030605@logix-tt.com> <45144DEB.2050107@tada.se> <45150E10.8030907@logix-tt.com> Message-ID: <45180CA3.2040908@logix-tt.com> Hi, Thomas, Here's my try for a VARLEN patch for UDT.c, as we discussed on Friday. I implemented the size to be 0-able, with strict check if it does not match on non-0 values, as discussed. I use the same error code, but slightly different error message (to ease debugging), as the fixed length path. One caveat still applies: For the coerceScalarDatum case, the Java code has to apply the Bitmask VARATT_MASK_SIZE aka 0x3fffffff itsself, as I'm not confident that I'm allowed to change the data inplace. What do you think about that? I also changed dataLen to be int32, as Datums can be larger than 65535 bytes on PostgreSQL. Btw, the old Code contained: appendBinaryStringInfo(&buffer, (char*)&dataLen, sizeof(int32)); In my eyes, this would have produced garbage, as well as the error message using %d formatting for int16 dataLen. I also added the fixed versions of the .java files, It seems that I really switched the LE and BE branches in some cases. :-(+ The c->java side of the path was tested quick'n'dirty, but not the other way round, due to time restrictions. I'm going to implement at least the POINT mapping for PostGIS, and use that as test case for both directions tomorrow. Thanks, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org www.nosoftwarepatents.org -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: UDT.diff URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature URL: