1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-27 23:21:58 +03:00

Fix two-argument form of ts_rewrite() so it actually works for cases where

a later rewrite rule should change a subtree modified by an earlier one.
Per my gripe of a few days ago.
This commit is contained in:
Tom Lane
2007-10-23 01:44:40 +00:00
parent bb36c51fcd
commit 12f25e70a6
4 changed files with 30 additions and 4 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_util.c,v 1.4 2007/09/07 16:03:40 teodor Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_util.c,v 1.5 2007/10/23 01:44:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -381,3 +381,20 @@ QTNCopy(QTNode *in)
return out;
}
void
QTNClearFlags(QTNode *in, uint32 flags)
{
/* since this function recurses, it could be driven to stack overflow. */
check_stack_depth();
in->flags &= ~flags;
if (in->valnode->type != QI_VAL)
{
int i;
for (i = 0; i < in->nchild; i++)
QTNClearFlags(in->child[i], flags);
}
}