diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-02-28 22:44:38 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-02-28 22:44:38 +0000 |
commit | 9f652d430fbd1e757caaec9fe64d3e94c8693158 (patch) | |
tree | 9215d2131d85e73caeb96fe23ba442c17b8d4575 /contrib/tsearch2/query.c | |
parent | d1ce4f7396aac34233e075d0342ac704593799ce (diff) | |
download | postgresql-9f652d430fbd1e757caaec9fe64d3e94c8693158.tar.gz postgresql-9f652d430fbd1e757caaec9fe64d3e94c8693158.zip |
Fix up several contrib modules that were using varlena datatypes in not-so-obvious
ways. I'm not totally sure that I caught everything, but at least now they pass
their regression tests with VARSIZE/SET_VARSIZE defined to reverse byte order.
Diffstat (limited to 'contrib/tsearch2/query.c')
-rw-r--r-- | contrib/tsearch2/query.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/tsearch2/query.c b/contrib/tsearch2/query.c index eb2d30e1592..62a305ed1e8 100644 --- a/contrib/tsearch2/query.c +++ b/contrib/tsearch2/query.c @@ -658,7 +658,7 @@ static QUERYTYPE * (errmsg("tsearch query doesn't contain lexeme(s): \"%s\"", state.buffer))); query = (QUERYTYPE *) palloc(HDRSIZEQT); - query->len = HDRSIZEQT; + SET_VARSIZE(query, HDRSIZEQT); query->size = 0; return query; } @@ -666,7 +666,7 @@ static QUERYTYPE * /* make finish struct */ commonlen = COMPUTESIZE(state.num, state.sumlen); query = (QUERYTYPE *) palloc(commonlen); - query->len = commonlen; + SET_VARSIZE(query, commonlen); query->size = state.num; ptr = GETQUERY(query); @@ -961,7 +961,7 @@ to_tsquery(PG_FUNCTION_ARGS) res = clean_fakeval_v2(GETQUERY(query), &len); if (!res) { - query->len = HDRSIZEQT; + SET_VARSIZE(query, HDRSIZEQT); query->size = 0; PG_RETURN_POINTER(query); } @@ -1016,7 +1016,7 @@ plainto_tsquery(PG_FUNCTION_ARGS) res = clean_fakeval_v2(GETQUERY(query), &len); if (!res) { - query->len = HDRSIZEQT; + SET_VARSIZE(query, HDRSIZEQT); query->size = 0; PG_RETURN_POINTER(query); } |