]> granicus.if.org Git - postgresql/commitdiff
Fix incorrect cleanup of tsquery in ts_rewrite(). Per bug #4933 by
authorTeodor Sigaev <teodor@sigaev.ru>
Tue, 28 Jul 2009 09:32:23 +0000 (09:32 +0000)
committerTeodor Sigaev <teodor@sigaev.ru>
Tue, 28 Jul 2009 09:32:23 +0000 (09:32 +0000)
 Aaron Marcuse-Kubitza <aaronmk@blackducksoftware.com>

src/backend/utils/adt/tsquery_rewrite.c

index 22db8609f3ac0860b6b50abc7c617dce732eb65e..c9dbd862a0061d44c0b17302003dac795b1041b9 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_rewrite.c,v 1.14 2009/01/07 13:44:36 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_rewrite.c,v 1.14.2.1 2009/07/28 09:32:23 teodor Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -217,12 +217,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];