From: Teodor Sigaev Date: Tue, 28 Jul 2009 09:32:45 +0000 (+0000) Subject: Fix incorrect cleanup of tsquery in ts_rewrite(). Per bug #4933 by X-Git-Tag: REL8_3_8~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe37cbb841607f8499ec3d2950397e650a94bf0d;p=thirdparty%2Fpostgresql.git Fix incorrect cleanup of tsquery in ts_rewrite(). Per bug #4933 by Aaron Marcuse-Kubitza --- diff --git a/src/backend/utils/adt/tsquery_rewrite.c b/src/backend/utils/adt/tsquery_rewrite.c index 89f11731dd4..729c878ecbd 100644 --- a/src/backend/utils/adt/tsquery_rewrite.c +++ b/src/backend/utils/adt/tsquery_rewrite.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_rewrite.c,v 1.11 2008/01/01 19:45:53 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_rewrite.c,v 1.11.2.1 2009/07/28 09:32:45 teodor Exp $ * *------------------------------------------------------------------------- */ @@ -215,12 +215,12 @@ dropvoidsubtree(QTNode *root) root->nchild = j; - if (root->valnode->operator.oper == OP_NOT && root->nchild == 0) + if (root->nchild == 0) { QTNFree(root); root = NULL; } - else if (root->nchild == 1) + else if (root->nchild == 1 && root->valnode->operator.oper != OP_NOT) { QTNode *nroot = root->child[0];