guedes / ldap_fdw

A LDAP Foreign Data Wrapper for PostgreSQL
31 stars 11 forks source link

Unable to compile for PostgreSQL 11 #18

Open juliano777 opened 5 years ago

juliano777 commented 5 years ago

src/ldap_fdw.c:108:36: error: incompatible type for argument 3 of ‘create_foreignscan_path’ baserel->rows, startup_cost, total_cost, ^~~

. . .

pg_list.h:69:18: error: incompatible type for argument 6 of ‘create_foreignscan_path’

define NIL ((List *) NULL)

              ^

. . .

src/ldap_fdw.c:107:12: error: too few arguments to function ‘create_foreignscan_path’ create_foreignscan_path(root, baserel, ^~~~~~~

guedes commented 5 years ago

Thanks! I'm working on 11 support.

landryb commented 5 years ago

Fwiw, same error with 10.

landryb commented 5 years ago

That's probably just a small adaptation to make like it was done for 9.5 in f510c583

landryb commented 5 years ago
--- a/src/ldap_fdw.c
+++ b/src/ldap_fdw.c
@@ -105,6 +105,9 @@ ldapGetForeignPaths(PlannerInfo *root,

   add_path(baserel, (Path *)
            create_foreignscan_path(root, baserel,
+#if PG_VERSION_NUM >= 90600
+                                   NULL, /* PathTarget */
+#endif
                                    baserel->rows, startup_cost, total_cost,
                                    NIL, NULL, NULL
 #if PG_VERSION_NUM >= 90500

is a gross hack shoplifted from https://github.com/pramsey/pgsql-ogr-fdw/commit/9ae43f099ebeff6bc44bd4f8126aa202d44ea9a1 which allows it to build but there are still lots of ugly warnings. Maybe https://github.com/pramsey/pgsql-ogr-fdw/commit/1fca0be83c32c9954b2596ae784858f1cd3908c9 should also be taken. testing.

landryb commented 5 years ago

make CFLAGS=-DLDAP_DEPRECATED fixes some warnings as it uses deprecated ldap.h methods, but there are still 3 warnings related to psql apis:

gcc -DLDAP_DEPRECATED -fPIC -I. -I./ -I/usr/include/postgresql/10/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o src/ldap_fdw.o src/ldap_fdw.c
In file included from /usr/include/postgresql/10/server/access/tupdesc.h:19:0,
                 from /usr/include/postgresql/10/server/funcapi.h:21,
                 from src/ldap_fdw.h:20,
                 from src/ldap_fdw.c:15:
src/ldap_fdw.c: In function ‘ldapBeginForeignScan’:
src/ldap_fdw.c:206:18: warning: passing argument 1 of ‘list_head’ from incompatible pointer type [-Wincompatible-pointer-types]
     foreach (lc, node->ss.ps.qual)
                  ^
/usr/include/postgresql/10/server/nodes/pg_list.h:162:26: note: in definition of macro ‘foreach’
  for ((cell) = list_head(l); (cell) != NULL; (cell) = lnext(cell))
                          ^
/usr/include/postgresql/10/server/nodes/pg_list.h:77:1: note: expected ‘const List * {aka const struct List *}’ but argument is of type ‘ExprState * {aka struct ExprState *}’
 list_head(const List *l)
 ^~~~~~~~~
src/ldap_fdw.c:215:40: warning: passing argument 1 of ‘list_delete’ from incompatible pointer type [-Wincompatible-pointer-types]
         node->ss.ps.qual = list_delete(node->ss.ps.qual, (void *) state);
                                        ^~~~
In file included from /usr/include/postgresql/10/server/access/tupdesc.h:19:0,
                 from /usr/include/postgresql/10/server/funcapi.h:21,
                 from src/ldap_fdw.h:20,
                 from src/ldap_fdw.c:15:
/usr/include/postgresql/10/server/nodes/pg_list.h:234:14: note: expected ‘List * {aka struct List *}’ but argument is of type ‘ExprState * {aka struct ExprState *}’
 extern List *list_delete(List *list, void *datum);
              ^~~~~~~~~~~
src/ldap_fdw.c:215:26: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
         node->ss.ps.qual = list_delete(node->ss.ps.qual, (void *) state);
containerwriter commented 5 years ago

Bump for status?

achix commented 4 years ago

So we got like year 2020 AD approaching, PostgreSQL 12 due to be released this month, and still no LDAP FDW extension.

landryb commented 4 years ago

So we got like year 2020 AD approaching, PostgreSQL 12 due to be released this month, and still no LDAP FDW extension.

Well, this is free software, if you feel things dont move fast enough, you can still send a pull request..

achix commented 4 years ago

I know, I have been using it (pgsql) since 2000. Anyways, I recall when I had installed it (ldap_fdw) it worked nice. Its a pity it doesn't compile for >=11.

On Mon, 16 Sep 2019 at 16:30, Landry Breuil notifications@github.com wrote:

So we got like year 2020 AD approaching, PostgreSQL 12 due to be released this month, and still no LDAP FDW extension.

Well, this is free software, if you feel things dont move fast enough, you can still send a pull request..

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/guedes/ldap_fdw/issues/18?email_source=notifications&email_token=ADYNPCTM3VKPIL72TM64ZF3QJ6C65A5CNFSM4GASOTY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6ZEM7Y#issuecomment-531777151, or mute the thread https://github.com/notifications/unsubscribe-auth/ADYNPCUABJUDNOOUVIIFKGDQJ6C65ANCNFSM4GASOTYQ .