tds-fdw / tds_fdw

A PostgreSQL foreign data wrapper to connect to TDS databases (Sybase and Microsoft SQL Server)
Other
377 stars 101 forks source link

1.0.8 build error against PostgreSQL 11 #181

Closed devrimgunduz closed 4 years ago

devrimgunduz commented 5 years ago

Hi,

Getting this while building 1.0.8 against PostgreSQL 11. Can you please take a look? Thanks!

`/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2 -I./include/ -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o src/options.bc src/options.c src/tds_fdw.c: In function 'tdsGetColumnMetadata': src/tds_fdw.c:1250:70: error: invalid type argument of '->' (have 'FormData_pg_attribute' {aka 'struct FormData_pg_attribute'}) char* local_name = festate->attinmeta->tupdesc->attrs[local_ncol]->attname.data; ^~ src/tds_fdw.c:1255:71: error: invalid type argument of '->' (have 'FormData_pg_attribute' {aka 'struct FormData_pg_attribute'}) column->attr_oid = festate->attinmeta->tupdesc->attrs[local_ncol]->atttypid; ^~ In file included from /usr/pgsql-11/include/server/postgres.h:47, from src/tds_fdw.c:28: src/tds_fdw.c:1288:47: error: invalid type argument of '->' (have 'FormData_pg_attribute' {aka 'struct FormData_pg_attribute'}) festate->attinmeta->tupdesc->attrs[ncol]->attname.data) ^~ /usr/pgsql-11/include/server/utils/elog.h:107:14: note: in definition of macro 'ereport_domain' errfinish rest; \ ^~~~ src/tds_fdw.c:1284:5: note: in expansion of macro 'ereport' ereport(WARNING, ^~~ make[1]: [: src/tds_fdw.o] Error 1 make[1]: Waiting for unfinished jobs.... src/tds_fdw.c:1250:70: error: member reference type 'FormData_pg_attribute' (aka 'struct FormData_pg_attribute') is not a pointer; did you mean to use '.'? char* local_name = festate->attinmeta->tupdesc->attrs[local_ncol]->attname.data;


                                                                                                 .
src/tds_fdw.c:1255:71: error: member reference type 'FormData_pg_attribute' (aka 'struct FormData_pg_attribute') is not a pointer; did you mean to use '.'?
                                        column->attr_oid = festate->attinmeta->tupdesc->attrs[local_ncol]->atttypid;
                                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
                                                                                                         .
src/tds_fdw.c:1288:47: error: member reference type 'FormData_pg_attribute' (aka 'struct FormData_pg_attribute') is not a pointer; did you mean to use '.'?
                                        festate->attinmeta->tupdesc->attrs[ncol]->attname.data)
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
                                                                                .
/usr/pgsql-11/include/server/utils/elog.h:123:37: note: expanded from macro 'ereport'
        ereport_domain(elevel, TEXTDOMAIN, rest)
                                           ^~~~
/usr/pgsql-11/include/server/utils/elog.h:107:14: note: expanded from macro 'ereport_domain'
                        errfinish rest; \
                                  ^~~~
3 errors generated.
make[1]: *** [/usr/pgsql-11/lib/pgxs/src/makefiles/../../src/Makefile.global:1010: src/tds_fdw.bc] Error 1
make[1]: Leaving directory '/home/devrim/Documents/Devrim/Projects/repo/pgrpms/rpm/redhat/master/tds_fdw/master/tds_fdw-1.0.8'
error: Bad exit status from /var/tmp/rpm-tmp.szyhiY (%build)
`
ghost commented 5 years ago

Can you describe your build context? OS disto and version, postgres version (I'll assume the 11.0 release unless stated otherwise), tds version, etc?

itscaro commented 5 years ago

In my case I have this error:

Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0": src/tds_fdw.c: In function ?tdsGetColumnMetadata?:
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0": src/tds_fdw.c:1250:70: error: invalid type argument of ?->? (have ?FormData_pg_attribute {aka struct FormData_pg_attribute}?)
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0":      char* local_name = festate->attinmeta->tupdesc->attrs[local_ncol]->attname.data;
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0":                                                                       ^~
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0": src/tds_fdw.c:1255:71: error: invalid type argument of ?->? (have ?FormData_pg_attribute {aka struct FormData_pg_attribute}?)
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0":       column->attr_oid = festate->attinmeta->tupdesc->attrs[local_ncol]->atttypid;
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0":                                                                        ^~
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0": In file included from /usr/include/postgresql/11/server/postgres.h:47:0,
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0":                  from src/tds_fdw.c:28:
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0": src/tds_fdw.c:1288:47: error: invalid type argument of ?->? (have ?FormData_pg_attribute {aka struct FormData_pg_attribute}?)
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0":        festate->attinmeta->tupdesc->attrs[ncol]->attname.data)
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0":                                                ^
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0": /usr/include/postgresql/11/server/utils/elog.h:107:14: note: in definition of macro ?ereport_domain?
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0":     errfinish rest; \
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0":               ^~~~
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0": src/tds_fdw.c:1284:5: note: in expansion of macro ?ereport?
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0":      ereport(WARNING,
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0":      ^~~~~~~
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0": <builtin>: recipe for target 'src/tds_fdw.o' failed
Step #3 - "eu.gcr.io/$PROJECT_ID/postgres:11.0": make: *** [src/tds_fdw.o] Error 1
juliogonzalez commented 5 years ago

@devrimgunduz , @itscaro, @RevenantStar, @GeoffMontee, the CI is able to reproduce this problem on both CentOS6 and Ubuntu 14.04 and tag v1.0.8: https://jenkins.juliogonzalez.es/job/tds_fdw-build-free/58/ (check logs for details about TDS version and build details).

jspeis commented 5 years ago

I was getting a similar error when I tried v1.0.7/v1.0.8 though building from master now seems to work.

juliogonzalez commented 4 years ago

Closing, I updated https://github.com/tds-fdw/tds_fdw/releases/tag/v1.0.8 to show that it's not compatible with PostgreSQL >= 11