[Pljava-dev] VARLEN Patch for UDT.c

From: schabi at logix-tt(dot)com (Markus Schaber)
To:
Subject: [Pljava-dev] VARLEN Patch for UDT.c
Date: 2006-09-25 17:06:43
Message-ID: 45180CA3.2040908@logix-tt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

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: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20060925/f6a70697/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20060925/f6a70697/attachment.bin>

In response to

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Markus Schaber 2006-09-25 17:45:51 [Pljava-dev] UDT send and receive
Previous Message Thomas Hallgren 2006-09-25 16:23:19 [Pljava-dev] Error trapping help