pgsql-server: Fix obviously-utterly-untested noTocComments code.

Started by Tom Lanealmost 22 years ago3 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Log Message:
-----------
Fix obviously-utterly-untested noTocComments code.

Modified Files:
--------------
pgsql-server/src/bin/pg_dump:
pg_backup_archiver.c (r1.95 -> r1.96)
(http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/pg_dump/pg_backup_archiver.c.diff?r1=1.95&r2=1.96)

#2Philip Warner
pjw@rhyme.com.au
In reply to: Tom Lane (#1)
Re: pgsql-server: Fix obviously-utterly-untested

At 05:44 AM 31/08/2004, Tom Lane wrote:

Fix obviously-utterly-untested noTocComments code.

It was extensively tested with a variety of DBs.

I *think* the problem was that the patch may have been against a too-old
source (8.0b1), which still had _printTocHeader and _printTocData. eg. the
code:

- if (AH->noTocComments)
- return;
-

should have been in _printTocHeader, whereas it ended up in _printTocEntry.

Can this be easily avoided in the future? More context and/or just use
latest CVS?

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 03 5330 3172 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp.mit.edu:11371 |/

#3Bruce Momjian
bruce@momjian.us
In reply to: Philip Warner (#2)
Re: pgsql-server: Fix obviously-utterly-untested

Philip Warner wrote:

At 05:44 AM 31/08/2004, Tom Lane wrote:

Fix obviously-utterly-untested noTocComments code.

It was extensively tested with a variety of DBs.

I *think* the problem was that the patch may have been against a too-old
source (8.0b1), which still had _printTocHeader and _printTocData. eg. the
code:

- if (AH->noTocComments)
- return;
-

should have been in _printTocHeader, whereas it ended up in _printTocEntry.

Can this be easily avoided in the future? More context and/or just use
latest CVS?

Ah, I remember having trouble applying the patch so I had to do it
manually. I looked at the context around the patch, saw a matching
comment, and put it there. It did seem quite high to me in the function
but I figured the author knew the ramifications.

-- 
  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