Hi,

I just noticed a bug in adddepend:

The below commands will upgrade the foreign key style.  Shall I execute
them?

        DROP TRIGGER "RI_ConstraintTrigger_1105102" ON news_authors;
        DROP TRIGGER "RI_ConstraintTrigger_1105103" ON news_authors;
        DROP TRIGGER "RI_ConstraintTrigger_1105118" ON news_articles;

        ALTER TABLE news_articles ADD CONSTRAINT "&lt;unnamed&gt;" FOREIGN
KEY (author)
                 REFERENCES news_authors(id) MATCH SIMPLE ON UPDATE NO
ACTION ON DELETE NO ACTION;


See how it's HTMLised the foreign key name?  I cannot find how $keyname in
the code is being html escaped.  Perhaps it's some weird taint mode thing?

Rod - you got any ideas?

Chris



Fri, 21 Feb 2003 11:08:59 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
bug in contrib/adddepend
On Thu, 2003-02-20 at 22:08, Christopher Kings-Lynne wrote:
> Hi,
> 
> I just noticed a bug in adddepend:
> 
> The below commands will upgrade the foreign key style.  Shall I execute
> them?
> 
>         DROP TRIGGER "RI_ConstraintTrigger_1105102" ON news_authors;
>         DROP TRIGGER "RI_ConstraintTrigger_1105103" ON news_authors;
>         DROP TRIGGER "RI_ConstraintTrigger_1105118" ON news_articles;
> 
>         ALTER TABLE news_articles ADD CONSTRAINT "&lt;unnamed&gt;" FOREIGN
> KEY (author)
>                  REFERENCES news_authors(id) MATCH SIMPLE ON UPDATE NO
> ACTION ON DELETE NO ACTION;
> 
> 
> See how it's HTMLised the foreign key name?  I cannot find how $keyname in
> the code is being html escaped.  Perhaps it's some weird taint mode thing?

Not to mention when it's <unnamed>, the code is setup to ignore the
constraint name entirely (line 267).

There isn't anything that changes the value of $keyname after it's
pulled from the DBI drivers.  What version of DBI::Pg are you using?

Last time I used it was with DBI::Pg v1.13.

-- 
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc
22 Feb 2003 21:12:22 -0500
Rod Taylor <rbt@rbt.ca>
Re: bug in contrib/adddepend
> > See how it's HTMLised the foreign key name?  I cannot find how $keyname in
> > the code is being html escaped.  Perhaps it's some weird taint mode thing?
>
> Not to mention when it's <unnamed>, the code is setup to ignore the
> constraint name entirely (line 267).

I worked around it by checking to see if it equalled '&lt;unnamed&gt;' as
well as '<unnamed>'.  I also have heaps of RI triggers left over after the
addepend run, so I'll investigate why adddepend doesn't pick them up...

> There isn't anything that changes the value of $keyname after it's
> pulled from the DBI drivers.  What version of DBI::Pg are you using?
>
> Last time I used it was with DBI::Pg v1.13.

I'm using:

p5-DBD-Pg-1.21      Provides access to PostgreSQL databases through the
p5-DBI-1.28         The perl5 Database Interface.  Required for DBD::*

Chris



Sun, 23 Feb 2003 19:16:57 +0800 (WST)
Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Re: bug in contrib/adddepend
> I worked around it by checking to see if it equalled '&lt;unnamed&gt;' as
> well as '<unnamed>'.  I also have heaps of RI triggers left over after the
> addepend run, so I'll investigate why adddepend doesn't pick them up...

Took a quick look, and I don't see anything in DBD-Pg that would do this
type of conversion.



-- 
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc
23 Feb 2003 13:36:34 -0500
Rod Taylor <rbt@rbt.ca>
Re: bug in contrib/adddepend

Was this resolved.  Christopher, do you have a reproducible case?

---------------------------------------------------------------------------

Rod Taylor wrote:
-- Start of PGP signed section.
> > I worked around it by checking to see if it equalled '&lt;unnamed&gt;' as
> > well as '<unnamed>'.  I also have heaps of RI triggers left over after the
> > addepend run, so I'll investigate why adddepend doesn't pick them up...
> 
> Took a quick look, and I don't see anything in DBD-Pg that would do this
> type of conversion.
> 
> 
> 
> -- 
> Rod Taylor <rbt@rbt.ca>
> 
> PGP Key: http://www.rbt.ca/rbtpub.asc
-- End of PGP section, PGP failed!

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Thu, 6 Mar 2003 09:58:20 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: bug in contrib/adddepend
On Thu, 2003-03-06 at 09:58, Bruce Momjian wrote:
> Was this resolved.  Christopher, do you have a reproducible case?

I've not been able to reproduce it, nor have I had a similar complaint.

I think it's a system configuration issue or somekind.  Otherwise there
would have been many many more complaints, as <unknown> is a rather
common name for constraints :).

-- 
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc
06 Mar 2003 10:10:50 -0500
Rod Taylor <rbt@rbt.ca>
Re: bug in contrib/adddepend
> Was this resolved.  Christopher, do you have a reproducible case?

It wasn't resolved, in fact I'd forgotten about it :)

I do have a reproducible case (our live server), however it seems like it's
basically a case of an invalid set of triggers.  I really need to manually
remove some of the triggers.  eg. They're supporting one side of the foreign
key, but not the other, etc...

Chris




Fri, 7 Mar 2003 10:01:24 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: bug in contrib/adddepend
> Was this resolved.  Christopher, do you have a reproducible case?

Oh sorry, I answered the wrong question!

Yes, I resolved it by reinstalling my DBD perl stuff.

I still have the problem of left over constraint triggers, but they do look
like they're broken, so it's not an adddepend problem...

Chris


Fri, 7 Mar 2003 10:02:34 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: bug in contrib/adddepend