Skip to content

Commit 1f4b046

Browse files
committed
Fix incorrect cleanup of tsquery in ts_rewrite(). Per bug #4933 by
Aaron Marcuse-Kubitza <aaronmk@blackducksoftware.com>
1 parent c1b9ec2 commit 1f4b046

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/utils/adt/tsquery_rewrite.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_rewrite.c,v 1.15 2009/07/16 06:33:44 petere Exp $
10+
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_rewrite.c,v 1.16 2009/07/28 09:31:55 teodor Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -217,12 +217,12 @@ dropvoidsubtree(QTNode *root)
217217

218218
root->nchild = j;
219219

220-
if (root->valnode->qoperator.oper == OP_NOT && root->nchild == 0)
220+
if (root->nchild == 0)
221221
{
222222
QTNFree(root);
223223
root = NULL;
224224
}
225-
else if (root->nchild == 1)
225+
else if (root->nchild == 1 && root->valnode->qoperator.oper != OP_NOT)
226226
{
227227
QTNode *nroot = root->child[0];
228228

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy