dynamobi/dynamobi — Issue #835: [FRG-35] program generated for string comparison in Fennel calc is wrong
Author: dynamobi-build
Created: 2011-12-30 03:51:55+00:00
State: open
Labels: Fennel Calc Codegen, FRG

[reporter="jvs", created="Mon, 6 Feb 2006 12:33:40 -0500 (GMT-05:00)"]
Script below reproduces the problem. The query should return one row, but instead returns nothing. FNL-13 was the original bug which crashes instead, but I narrowed it down a bit. I verified that the joined tuple going into the calc has the correct data. When SqlStrCmp_Bin gets called, str1LenBytes and str2LenBytes are 30 instead of 8 (length of 'Locicero'). I suspect there's a problem with VARCHAR/CHAR type manipulation somewhere in the code generator. Java calc works fine.

alter system set "calcVirtualMachine"='CALCVM_FENNEL';

create table sales.CUSTOMERS(

CUSTID integer primary key,

LNAME varchar(30) not null);

insert into sales.customers values (0,'Locicero');

select 1

FROM sales.CUSTOMERS M, sales.CUSTOMERS F

WHERE M.LNAME = F.LNAME;