Skip to content

Commit

Permalink
Merge pull request #16 from pgexperts/master
Browse files Browse the repository at this point in the history
Make compatible with PostgreSQL 9.5 API.
  • Loading branch information
guedes committed Apr 18, 2016
2 parents 54b3c4d + f510c58 commit b277b08
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
20 changes: 16 additions & 4 deletions src/ldap_fdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ ldapGetForeignPaths(PlannerInfo *root,
add_path(baserel, (Path *)
create_foreignscan_path(root, baserel,
baserel->rows, startup_cost, total_cost,
NIL, NULL, NIL));
NIL, NULL, NULL
#if PG_VERSION_NUM >= 90500
, NIL
#endif
));
}

static ForeignScan *
Expand All @@ -115,13 +119,21 @@ ldapGetForeignPlan(PlannerInfo *root,
Oid foreigntableid,
ForeignPath *best_path,
List *tlist,
List *scan_clauses)
List *scan_clauses
#if PG_VERSION_NUM >= 90500
, Plan *outer_plan
#endif
)
{
Index scan_relid = baserel->relid;

scan_clauses = extract_actual_clauses(scan_clauses, false);

return make_foreignscan(tlist, scan_clauses, scan_relid, NIL, NIL);
return make_foreignscan(tlist, scan_clauses, scan_relid, NIL, NIL
#if PG_VERSION_NUM >= 90500
, NIL, NIL, outer_plan
#endif
);
}

static void
Expand All @@ -132,7 +144,7 @@ ldapExplainForeignScan(ForeignScanState *node, ExplainState *es)

if (es->costs)
{
ExplainPropertyLong("Foreign Ldap cost", 10.5, es);
ExplainPropertyFloat("Foreign Ldap cost", 10.5, 1, es);
}
}

Expand Down
13 changes: 5 additions & 8 deletions src/ldap_fdw.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@
#define LDAP_FDW_OPTION_QUERY_DEFAULT (char *) "(objectClass=*)"
#define LDAP_FDW_OPTION_LDAP_VERSION_DEFAULT LDAP_VERSION3

extern LDAP *ldap_init(char *, int);
extern int ldap_simple_bind_s(LDAP *, const char *, const char *);
extern char **ldap_get_values(LDAP *, LDAPMessage *, char *);
extern int ldap_count_values(char **);
extern void ldap_value_free(char **);
extern int ldap_unbind(LDAP *);

/*
* Valid options that could be used by
* this wrapper
Expand Down Expand Up @@ -144,7 +137,11 @@ ldapGetForeignPlan(PlannerInfo *root,
Oid foreigntableid,
ForeignPath *best_path,
List *tlist,
List *scan_clauses);
List *scan_clauses
#if PG_VERSION_NUM >= 90500
, Plan *outer_plan
#endif
);

static void
ldapExplainForeignScan(ForeignScanState *node,
Expand Down

0 comments on commit b277b08

Please sign in to comment.