[Monetdb-developers] M4 Automatic multiplex version of .tostr: weird behavior
lsidir at gmail.com
Sun Feb 1 13:03:43 CET 2009
The following behavior is strange to me, but I am not sure if it is a
bug or I have done something wrong.
dayTimeDuration (dtduration) is defined in mil as:
.ATOM dtduration = lng;
.FROMSTR = dtduration_fromstr;
.TOSTR = dtduration_tostr;
and in c as :
typedef long long dtduration;
also .tostr has the following sign.
int dtduration_tostr(str *buf, int *len, dtduration *val)
you can find all this in MonetDB4/src/modules/plain/monettime.mx
Now, if I do either:
I get the correct value printed. But if I create a BAT (void,str):
var a0006 := new (void,str).seqbase (0 at 0);
It gives back "PT0S", which means 0 duration, and thus the value of
*val in dtduration_tostr is 0 (I checked that).
So, could that be some bug with correct dealing of long values in the
multiplex creation (btw. where is that happening?) Or am I missing
some special case that I should take into consideration with long
P.S. yearMonthDuration which is defined as int works like a charm.
More information about the developers-list