mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +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:
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_rewrite.c,v 1.4 2007/09/07 16:03:40 teodor Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_rewrite.c,v 1.5 2007/10/23 01:44:39 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -467,6 +467,13 @@ tsquery_rewrite(PG_FUNCTION_ARGS)
|
||||
QTNFree(qsubs);
|
||||
if (qtsubs != (TSQuery) DatumGetPointer(sdata))
|
||||
pfree(qtsubs);
|
||||
|
||||
if (tree)
|
||||
{
|
||||
/* ready the tree for another pass */
|
||||
QTNClearFlags(tree, QTN_NOCHANGE);
|
||||
QTNSort(tree);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user