Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Greenplum, compiling the AGE plugin fails with the error: 'void value not ignored as it ought to be #1975

Closed
legendzyb opened this issue Jul 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@legendzyb
Copy link

legendzyb commented Jul 11, 2024

Describe the bug
Hi! I am trying to integrate the AGE plugin into Greenplum. Since Greenplum 7 is based on PostgreSQL 12, I think it should be compilable and usable. I used the version package of age-PG12-v1.5.0-rc0, but I encountered an error when compiling AGE separately. What is the problem? Or does AGE not support the Greenplum 7 database?

How are you accessing AGE (Command line, driver, etc.)?
none

What data setup do we need to do?
compile

What is the necessary configuration info needed?
pg_config
make install

What is the command that caused the error?

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-but-set-variable -Werror=implicit-fallthrough=3 -Wno-format-truncation -Wno-stringop-truncation -O3 -std=gnu99   -Werror=uninitialized -Werror=implicit-function-declaration -fPIC -I.//src/include -I.//src/include/parser -I. -I./ -I/root/greenplum-db-7.0.0/include/postgresql/server -I/root/greenplum-db-7.0.0/include/postgresql/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/backend/parser/ag_scanner.o src/backend/parser/ag_scanner.c
src/backend/parser/ag_scanner.l: In function ‘_scan_errmsg’:
src/backend/parser/ag_scanner.l:1171:16: error: void value not ignored as it ought to be
     else
                ^                                
src/backend/parser/ag_scanner.l:1173:16: error: void value not ignored as it ought to be
 }
                ^                                     
src/backend/parser/ag_scanner.l: In function ‘_scan_errposition’:
src/backend/parser/ag_scanner.l:1187:12: error: void value not ignored as it ought to be
 }
            ^               
src/backend/parser/ag_scanner.l: In function ‘_scan_errmsg’:
src/backend/parser/ag_scanner.l:1174:1: warning: control reaches end of non-void function [-Wreturn-type]
 
 ^
src/backend/parser/ag_scanner.l: In function ‘_scan_errposition’:
src/backend/parser/ag_scanner.l:1188:1: warning: control reaches end of non-void function [-Wreturn-type]
 
 ^
make: *** [src/backend/parser/ag_scanner.o] Error 1

Expected behavior
Compilation successful

Environment (please complete the following information):
Linux version 3.10.0-1160.119.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Tue Jun 4 14:43:51 UTC 2024
gcc version 8.5.0 (GCC)
flex 2.6.1
bison (GNU Bison) 3.0.4

Additional context
Add any other context about the problem here.

@legendzyb legendzyb added the bug Something isn't working label Jul 11, 2024
@MironAtHome
Copy link

I noted your mentioning underlying PG version is 12, it would be nice if you could confirm running pg_config tool from the bin subdirectory ( if it is present, I found GreenPlum hard to install following Broadcom site, so, more info regarding environment would help to build confidence in troubleshooting steps ).
So, to underline, it would be very nice to confirm version of Postgres underlying Greenplum and branch used to build age.
Second, I have traced functions reported as "error" and both seem to be internal to age. However, the definition of the function, let's take them one at a time, function _scan_errmsg, performs call into errmsg, returning int, as it stands for Postgres.
Again, if you could trace this function declaration for Greenplum it would be very helpful.
In the end, here is a brief comment from definition of errmsg function:
return 0; /* return value does not matter */
which makes me think that it would be ok to modify ( some would say hack ) the code a little bit to fix these two error messages ( if those are the only ones causing trouble ).
Please let me know if you would like specific steps regarding code change.

@legendzyb
Copy link
Author

thanks for taking a look. @MironAtHome
The compilation issues have all been resolved, but many codes of the age plugin are not adapted for the distributed Greenplum. I am still researching how to modify them.

Below are the results of pg_config execution:
[gpadmin@host33 ~]$ pg_config
BINDIR = /home/gpadmin/greenplum-db-7.0.0/bin
DOCDIR = /home/gpadmin/greenplum-db-7.0.0/share/doc/postgresql
HTMLDIR = /home/gpadmin/greenplum-db-7.0.0/share/doc/postgresql
INCLUDEDIR = /home/gpadmin/greenplum-db-7.0.0/include
PKGINCLUDEDIR = /home/gpadmin/greenplum-db-7.0.0/include/postgresql
INCLUDEDIR-SERVER = /home/gpadmin/greenplum-db-7.0.0/include/postgresql/server
LIBDIR = /home/gpadmin/greenplum-db-7.0.0/lib
PKGLIBDIR = /home/gpadmin/greenplum-db-7.0.0/lib/postgresql
LOCALEDIR = /home/gpadmin/greenplum-db-7.0.0/share/locale
MANDIR = /home/gpadmin/greenplum-db-7.0.0/share/man
SHAREDIR = /home/gpadmin/greenplum-db-7.0.0/share/postgresql
SYSCONFDIR = /home/gpadmin/greenplum-db-7.0.0/etc/postgresql
PGXS = /home/gpadmin/greenplum-db-7.0.0/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--prefix=/root/greenplum-db-7.0.0' '--enable-gpperfmon' '--with-python' '--with-perl' '--with-libxml' '--with-openssl' '--enable-orca' '--with-blocksize=32' '--without-licensecheck' '--enable-orafce' '--enable-debug-extensions' 'CFLAGS=-O0 -g3 -ggdb3' 'PKG_CONFIG_PATH=:/usr/local/lib/pkgconfig:/usr/local/lib/pkgconfig' 'PYTHON=/usr/local/python3/bin/python3'
CC = gcc
CPPFLAGS = -I../../deps/root/include -D_GNU_SOURCE -I/usr/include/libxml2
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-but-set-variable -Werror=implicit-fallthrough=3 -Wno-format-truncation -Wno-stringop-truncation -O0 -g3 -ggdb3 -std=gnu99 -Werror=uninitialized -Werror=implicit-function-declaration
CFLAGS_SL = -fPIC
LDFLAGS = -L../../deps/root/lib -Wl,--as-needed -lxerces-c -Wl,-rpath,'/root/greenplum-db-7.0.0/lib',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lpthread -lbz2 -lxml2 -lrt -lssl -lcrypto -lzstd -lz -lreadline -lrt -lcrypt -ldl -lm -lcurl
VERSION = PostgreSQL 12

I changed the statement return errmsg("%s at end of input", msg); to return 0;. Now the compilation issue is resolved, and I made similar modifications in a few other places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants