psql \x bug

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: psql \x bug
Date: 2005-09-16 14:24:10
Message-ID: b269154cb63027bd44a43d0b07cb3113@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message

Fix two instances of using raw "puts" inside of specifying fout.
The second one caused a bug that can be seen by using the pager
in expanded output mode:

$ psql pgtest

pgtest> \x
Expanded display is on.
pgtest> SELECT * FROM pg_class LIMIT 2;

(messy output)

--
Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200509161020
https://www.biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

Index: print.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/bin/psql/print.c,v
retrieving revision 1.72
diff -c -r1.72 print.c
*** print.c 18 Jul 2005 20:57:53 -0000 1.72
--- print.c 16 Sep 2005 14:18:04 -0000
***************
*** 570,576 ****

if (cells[0] == NULL)
{
! puts(_("(No rows)\n"));
return;
}

--- 570,576 ----

if (cells[0] == NULL)
{
! fprintf(fout, _("(No rows)\n"));
return;
}

***************
*** 704,710 ****
if (opt_align[i % col_count] == 'r' && opt_numeric_locale)
format_numeric_locale(my_cell);
if (opt_border < 2)
! puts(my_cell);
else
fprintf(fout, "%-s%*s |\n", my_cell, dwidth - cell_w[i], "");
free(my_cell);
--- 704,710 ----
if (opt_align[i % col_count] == 'r' && opt_numeric_locale)
format_numeric_locale(my_cell);
if (opt_border < 2)
! fprintf(fout, "%s\n", my_cell);
else
fprintf(fout, "%-s%*s |\n", my_cell, dwidth - cell_w[i], "");
free(my_cell);
-----BEGIN PGP SIGNATURE-----

iEYEARECAAYFAkMq1REACgkQvJuQZxSWSsjIGgCeIE1CONuRu31KZuJLAcNZT1VI
sysAoK6Pi5NXYPBC/0oNhmQKqZqca5jw
=W9GE
-----END PGP SIGNATURE-----

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-09-16 15:15:30 Re: statement logging / extended query protocol issues
Previous Message Oliver Jowett 2005-09-16 11:55:56 Re: statement logging / extended query protocol issues