File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 77 *
88 *
99 * IDENTIFICATION
10- * $PostgreSQL: pgsql/contrib/tsearch2/tsearch2.c,v 1.8 2009/01/01 17:23 :32 momjian Exp $
10+ * $PostgreSQL: pgsql/contrib/tsearch2/tsearch2.c,v 1.9 2009/01/28 18:31 :32 teodor Exp $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -367,8 +367,10 @@ tsa_tsearch2(PG_FUNCTION_ARGS)
367367{
368368 TriggerData * trigdata ;
369369 Trigger * trigger ;
370- char * * tgargs ;
370+ char * * tgargs ,
371+ * * tgargs_old ;
371372 int i ;
373+ Datum res ;
372374
373375 /* Check call context */
374376 if (!CALLED_AS_TRIGGER (fcinfo )) /* internal error */
@@ -388,10 +390,20 @@ tsa_tsearch2(PG_FUNCTION_ARGS)
388390
389391 tgargs [1 ] = pstrdup (GetConfigOptionByName ("default_text_search_config" ,
390392 NULL ));
393+ tgargs_old = trigger -> tgargs ;
391394 trigger -> tgargs = tgargs ;
392395 trigger -> tgnargs ++ ;
393396
394- return tsvector_update_trigger_byid (fcinfo );
397+ res = tsvector_update_trigger_byid (fcinfo );
398+
399+ /* restore old trigger data */
400+ trigger -> tgargs = tgargs_old ;
401+ trigger -> tgnargs -- ;
402+
403+ pfree (tgargs [1 ]);
404+ pfree (tgargs );
405+
406+ return res ;
395407}
396408
397409
You can’t perform that action at this time.
0 commit comments