postgres.git / summary / log / commit / refs
commit a142498e76a74b64ea03b13809db96c7c5e6f62e
Author: Teodor Sigaev <teodor@sigaev.ru>
Date: Tue Jul 28 09:33:09 2009 +0000
First released in: 9.0.0, 8.2.14, 8.3.8, 8.4.1
Fix incorrect cleanup of tsquery in ts_rewrite(). Per bug #4933 by
Aaron Marcuse-Kubitza <aaronmk@blackducksoftware.com>
contrib/tsearch2/query_rewrite.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/tsearch2/query_rewrite.c b/contrib/tsearch2/query_rewrite.c
index 63d8140a6c2..2b917373112 100644
--- a/contrib/tsearch2/query_rewrite.c
+++ b/contrib/tsearch2/query_rewrite.c
@@ -174,12 +174,12 @@ dropvoidsubtree(QTNode * root)
root->nchild = j;
- if (root->valnode->val == (int4) '!' && root->nchild == 0)
+ if (root->nchild == 0)
{
QTNFree(root);
root = NULL;
}
- else if (root->nchild == 1)
+ else if (root->nchild == 1 && root->valnode->val != (int4) '!')
{
QTNode *nroot = root->child[0];
[parent: 4b284aff655f]