Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] Bug in contrib/spi/refint.c

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: anand(at)bytekinc(dot)com (Anand Surelia)
Cc: pgsql-general(at)postgreSQL(dot)org, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Bug in contrib/spi/refint.c
Date: 1998-10-02 22:36:07
Message-ID: 199810022236.SAA22627@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
> There is a bug in check_foreign_key of refint.c which is bundled with
> the standard distribution. It occurs when a trigger calling this
> function recursively fires another trigger which calls the same
> function. The calling check_foreign_key loses its plan informantion and
> when it tries to use it the backend closes its channel. You can check it
> with the sql script I am attaching below.
> The solution to this is to do a find_plan again before executing it at
> line 483 of refint.c.
> Therefore two more lines should be added before line 483:
> 
> sprintf(ident, "%s$%u", trigger->tgname, rel->rd_id);
> plan = find_plan(ident, &FPlans, &nFPlans);
> 
> before line 483 which is:
>   ret = SPI_execp(plan->splan[r], kvals, NULL, tcount);

Please send a context diff to the patches list.


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist(at)candle(dot)pha(dot)pa(dot)us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026


In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 1998-10-03 03:01:07
Subject: Re: [HACKERS] RE: [GENERAL] Long update query ? (also Re: [GENERAL] CNF vs. DNF)
Previous:From: TaralDate: 1998-10-02 22:04:24
Subject: RE: [HACKERS] RE: [GENERAL] Long update query ? (also Re: [GENERAL] CNF vs. DNF)

pgsql-general by date

Next:From: Bruce MomjianDate: 1998-10-03 03:01:07
Subject: Re: [HACKERS] RE: [GENERAL] Long update query ? (also Re: [GENERAL] CNF vs. DNF)
Previous:From: TaralDate: 1998-10-02 22:04:24
Subject: RE: [HACKERS] RE: [GENERAL] Long update query ? (also Re: [GENERAL] CNF vs. DNF)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group