dynamobi/dynamobi — Issue #597: [FRG-275] FennelTupleAccessor doesn't properly distinguish between zero-length string and null value
Author: dynamobi-build
Created: 2011-12-30 03:37:33+00:00
State: closed
Labels: FRG, Tuple

[reporter="jvs", created="Mon, 18 Jun 2007 19:08:38 -0500 (GMT-05:00)"]
In vanilla Farrago, values ('') will return a null rather than an empty string. This happens because the plan is processed as Fennel-only, and package net.sf.farrago.fennel.tuple has a bug in it.

In FennelAttributeAccessor, FennelFixedWidthAccessor and FennelVarWidthAccessor both have the following incorrect logic:

if (value.getLength() > 0) {

srcBuf.position(offset);

srcBuf.get(

value.setRawBytes(),

0,

value.getLength());

}

When the length is 0, setRawBytes never gets called, so the value is interpreted as null.