Teodor Sigaev wrote: > Heikki, I see some strange changes in your patch, not related to tsearch > at all: > contrib/pageinspect/pageinspect.sql.in > contrib/pageinspect/rawpage.c
Oh, sorry about that. Just ignore them, they are some quick&dirty debugging functions I had in the same source tree. >> The usage of the QueryItem struct was very confusing. It was used for >> both operators and operands. For operators, "val" was a single character >> casted to a int4, marking the operator type. For operands, val was the >> CRC-32 of the value. Other fields were used only either for operands or >> for operators. The biggest change in the patch is that I broke the >> QueryItem struct into QueryOperator and QueryOperand. Type was really > ... >> - Removed ParseQueryNode struct used internally by makepol and friends. >> push*-functions now construct QueryItems directly. > > It's needed to set unused bytes in QueryItem to zero, it's common > requiremens for types in pgsql. After allocating space for tsquery in > parse_tsquery you copy just sizeof(QueryOperator) bytes and leave > sizeof(QueryItem) - sizeof(QueryOperator) bytes untouched. QueryOperand > is a biggest component in QueryItem union. I don't check other places. Ok. Probably easiest to do that by changing the palloc to palloc0 in parse_tsquery. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster