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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: \x output blowing up


  • From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
  • To: pgsql-hackers(at)postgresql(dot)org
  • Subject: Re: \x output blowing up
  • Date: Sun, 25 Sep 2005 00:13:40 +0200
  • Message-id: <20050924221334(dot)GE25542(at)svana(dot)org>

On Sat, Sep 24, 2005 at 11:45:08PM +0200, Martijn van Oosterhout wrote:
> Hi,
> 
> On CVS tip, whenever I do \x output, it dies with an internal error in
> glibc on free. If you run it under valgrind, it complains about these
> lines of code:

<snip>

Ok, I worked out the direct cause, pg_wcswidth only returns the length
upto the first newline and the line it breaks on is the multiline
definition in "_pg_expandarray".

The quick fix should be to only allocate memory if it's going to call
format_numeric_locale(), since then you know it's a number. It makes
the code slightly more convoluated but it should be slightly more
efficient.

I actually have a working psql that handles and displays newlines
properly, but it's too late for 8.1. It fixes all these issues
properly.

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog(at)svana(dot)org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment: pgpa0IMKBE1bC.pgp
Description: PGP signature



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group