-----BEGIN PGP SIGNED MESSAGE-----
On 31/03/2008, Tom Lane wrote:
> "Brendan Jurd" writes:
> > 1. describe malloc's the cells to zero, but print just does a local
> > calloc without any initialisation.
> There isn't any functional difference there. I am not sure, but I think
> the reason print.c has its own malloc wrappers instead of depending on
> common.c's is that we use print.c in some bin/scripts/ programs that
> do not want common.c too.
Yeah, it looks like createlang and droplang use print.c to emit a list
of installed languages.
> > 2. describe only does an mbvalidate for WIN32, but print does it in all cases.
> I don't know why describe only does that for WIN32; it looks
> inconsistent to me too. Possibly some trolling in the CVS history would
> give a clue about this.
Well, mbvalidate was originally added to print.c in 2001, as part of a
big patch to add multibyte support to psql . However, it was only
added to describe much later (2003) in response to a bug report about
8-bit characters not displaying correctly on the Windows console .
I think that because the bug was only observed in Windows, the patch
was added #ifdef WIN32, even though print.c was already using
mbvalidate for all content.
This nicely illustrates the nuisance inherent to duplication of code!
Based on this, I'm going to go ahead with using mbvalidate in all cases.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
-----END PGP SIGNATURE-----
In response to
pgsql-hackers by date
|Next:||From: Pavan Deolasee||Date: 2008-04-03 16:12:48|
|Subject: Re: [GENERAL] ANALYZE getting dead tuple count hopelessly wrong|
|Previous:||From: Bruce Momjian||Date: 2008-04-03 16:07:54|
|Subject: Re: psql \G command -- send query and output using
pgsql-patches by date
|Next:||From: Alvaro Herrera||Date: 2008-04-03 16:44:04|
|Subject: Re: psql \G command -- send query and output usingextended format|
|Previous:||From: Gregory Stark||Date: 2008-04-03 16:09:49|
|Subject: Re: psql command aliases support|