LucidDB / luciddb

DEFUNCT: See README
https://github.com/LucidDB/luciddb
Apache License 2.0
53 stars 24 forks source link

[FRG-275] FennelTupleAccessor doesn't properly distinguish between zero-length string and null value #597

Closed dynamobi-build closed 12 years ago

dynamobi-build commented 12 years ago

[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.

dynamobi-build commented 12 years ago

[author="jvs", created="Mon, 18 Jun 2007 19:09:31 -0500 (GMT-05:00)"] I'm fixing it.

dynamobi-build commented 12 years ago

[author="jvs", created="Tue, 19 Jun 2007 01:14:35 -0500 (GMT-05:00)"] Fixed on lu/dev in eigenchange 9474.