Pavel, All,

* Stephen Frost (sfr...@snowman.net) wrote:
> * Stephen Frost (sfr...@snowman.net) wrote:
> > That said, it looks like it worked in 9.3.
> 
> Hmm, actually, no, it didn't.
[...]

Alright, attached is a patch which fixes it.  Barring objections, I'll
go ahead and back-patch this also, since it's clearly wrong and there
was a definite attempt to have this case work (a few places explicitly
reset opt_border to 2 if it's higher, but that wasn't being passed down
to print_aligned_vertical_line, and it wasn't doing it).

        Thanks,

                Stephen
diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c
index 34365fd..d6e0487 100644
--- a/src/bin/psql/print.c
+++ b/src/bin/psql/print.c
@@ -1147,16 +1147,15 @@ cleanup:
 
 
 static void
-print_aligned_vertical_line(const printTableContent *cont,
+print_aligned_vertical_line(const printTextFormat *format,
+							const unsigned short opt_border,
 							unsigned long record,
 							unsigned int hwidth,
 							unsigned int dwidth,
 							printTextRule pos,
 							FILE *fout)
 {
-	const printTextFormat *format = get_line_style(cont->opt);
 	const printTextLineFormat *lformat = &format->lrule[pos];
-	unsigned short opt_border = cont->opt->border;
 	unsigned int i;
 	int			reclen = 0;
 
@@ -1435,11 +1434,11 @@ print_aligned_vertical(const printTableContent *cont, FILE *fout)
 				lhwidth++; /* for newline indicators */
 
 			if (!opt_tuples_only)
-				print_aligned_vertical_line(cont, record++, lhwidth,
-											dwidth, pos, fout);
+				print_aligned_vertical_line(format, opt_border, record++,
+											lhwidth, dwidth, pos, fout);
 			else if (i != 0 || !cont->opt->start_table || opt_border == 2)
-				print_aligned_vertical_line(cont, 0, lhwidth, dwidth,
-											pos, fout);
+				print_aligned_vertical_line(format, opt_border, 0, lhwidth,
+											dwidth, pos, fout);
 		}
 
 		/* Format the header */
@@ -1624,7 +1623,7 @@ print_aligned_vertical(const printTableContent *cont, FILE *fout)
 	if (cont->opt->stop_table)
 	{
 		if (opt_border == 2 && !cancel_pressed)
-			print_aligned_vertical_line(cont, 0, hwidth, dwidth,
+			print_aligned_vertical_line(format, opt_border, 0, hwidth, dwidth,
 										PRINT_RULE_BOTTOM, fout);
 
 		/* print footers */

Attachment: signature.asc
Description: Digital signature

Reply via email to