A problem here is that _create_hash_desc is called many times to
create a TupleDesc with int32 attribute.
I've tried to implement the function like this ,
TupleDesc _create_hash_desc()
{
static bool firstcall = true;
static TupleDesc tupdesc;
if(firstcall){
tupdesc = CreateTemplateTupleDesc(1, false);
TupleDescInitEntry(tupdesc, 1, "hashcode", INT4OID, -1, 0);
}
firstcall = false;
return tupdesc;
}
but it failed because tupdesc is free later, IMHO.
Any advice?
--
Best Regards,
Xiao Meng
DKERC, Harbin Institute of Technology, China
Gtalk: mx(dot)cogito(at)gmail(dot)com
MSN: cnEnder(at)live(dot)com
http://xiaomeng.yo2.cn