Compilation broken when OPTIMIZER_DEBUG is set

Started by salvador fandinoalmost 10 years ago3 messages
#1salvador fandino
sfandino@gmail.com

gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard
-g -O0 -DOPTIMIZER_DEBUG -I../../../../src/include -D_GNU_SOURCE -c -o
allpaths.o allpaths.c
allpaths.c: In function ‘debug_print_rel’:
allpaths.c:2943:50: error: ‘RelOptInfo {aka struct RelOptInfo}’ has no
member named ‘width’
printf("): rows=%.0f width=%d\n", rel->rows, rel->width);
^

git bisect points to commit 19a541143a09c067ec8cac77ec6a64eb5b1b662b "Add
an explicit representation of the output targetlist to Paths."

#2Michael Paquier
michael.paquier@gmail.com
In reply to: salvador fandino (#1)
1 attachment(s)
Re: Compilation broken when OPTIMIZER_DEBUG is set

On Mon, Feb 29, 2016 at 8:44 PM, salvador fandino <sfandino@gmail.com> wrote:

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
-Wendif-labels -Wmissing-format-attribute -Wformat-security
-fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -O0
-DOPTIMIZER_DEBUG -I../../../../src/include -D_GNU_SOURCE -c -o allpaths.o
allpaths.c
allpaths.c: In function ‘debug_print_rel’:
allpaths.c:2943:50: error: ‘RelOptInfo {aka struct RelOptInfo}’ has no
member named ‘width’
printf("): rows=%.0f width=%d\n", rel->rows, rel->width);
^

git bisect points to commit 19a541143a09c067ec8cac77ec6a64eb5b1b662b "Add an
explicit representation of the output targetlist to Paths."

Indeed. The width is now part of rel->reltarget.width. See for example
the attached while I bumped on this email..
--
Michael

Attachments:

optimizer-debug-fix.patchbinary/octet-stream; name=optimizer-debug-fix.patchDownload
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index 870a46c..6233be3 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -2957,7 +2957,7 @@ debug_print_rel(PlannerInfo *root, RelOptInfo *rel)
 
 	printf("RELOPTINFO (");
 	print_relids(rel->relids);
-	printf("): rows=%.0f width=%d\n", rel->rows, rel->width);
+	printf("): rows=%.0f width=%d\n", rel->rows, rel->reltarget.width);
 
 	if (rel->baserestrictinfo)
 	{
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michael Paquier (#2)
Re: Compilation broken when OPTIMIZER_DEBUG is set

Michael Paquier <michael.paquier@gmail.com> writes:

On Mon, Feb 29, 2016 at 8:44 PM, salvador fandino <sfandino@gmail.com> wrote:

allpaths.c: In function ‘debug_print_rel’:
allpaths.c:2943:50: error: ‘RelOptInfo {aka struct RelOptInfo}’ has no
member named ‘width’

Indeed. The width is now part of rel->reltarget.width. See for example
the attached while I bumped on this email..

Pushed, thanks.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers