PG_RETURN_POINTER(query);
}
memcpy((void *) GETQUERY(query), (void *) res, len * sizeof(QueryItem));
+
+ if ( len != query->size ) {
+ char *oldoperand = GETOPERAND(query);
+ int4 lenoperand = VARSIZE(query) - (oldoperand - (char*)query);
+
+ Assert( len < query->size );
+
+ query->size = len;
+ memcpy((void *) GETOPERAND(query), oldoperand, VARSIZE(query) - (oldoperand - (char*)query) );
+ SET_VARSIZE(query, COMPUTESIZE( len, lenoperand ));
+ }
+
pfree(res);
PG_RETURN_TSQUERY(query);
}
PG_RETURN_POINTER(query);
}
memcpy((void *) GETQUERY(query), (void *) res, len * sizeof(QueryItem));
+
+ if ( len != query->size ) {
+ char *oldoperand = GETOPERAND(query);
+ int4 lenoperand = VARSIZE(query) - (oldoperand - (char*)query);
+
+ Assert( len < query->size );
+
+ query->size = len;
+ memcpy((void *) GETOPERAND(query), oldoperand, lenoperand );
+ SET_VARSIZE(query, COMPUTESIZE( len, lenoperand ));
+ }
+
pfree(res);
PG_RETURN_POINTER(query);
}