summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/executor/nodeSeqscan.c12
-rw-r--r--src/interfaces/libpq/fe-connect.c10
2 files changed, 18 insertions, 4 deletions
diff --git a/src/backend/executor/nodeSeqscan.c b/src/backend/executor/nodeSeqscan.c
index ed35c58c2c3..94047d29430 100644
--- a/src/backend/executor/nodeSeqscan.c
+++ b/src/backend/executor/nodeSeqscan.c
@@ -131,8 +131,12 @@ ExecSeqScanWithQual(PlanState *pstate)
{
SeqScanState *node = castNode(SeqScanState, pstate);
+ /*
+ * Use pg_assume() for != NULL tests to make the compiler realize no
+ * runtime check for the field is needed in ExecScanExtended().
+ */
Assert(pstate->state->es_epq_active == NULL);
- Assert(pstate->qual != NULL);
+ pg_assume(pstate->qual != NULL);
Assert(pstate->ps_ProjInfo == NULL);
return ExecScanExtended(&node->ss,
@@ -153,7 +157,7 @@ ExecSeqScanWithProject(PlanState *pstate)
Assert(pstate->state->es_epq_active == NULL);
Assert(pstate->qual == NULL);
- Assert(pstate->ps_ProjInfo != NULL);
+ pg_assume(pstate->ps_ProjInfo != NULL);
return ExecScanExtended(&node->ss,
(ExecScanAccessMtd) SeqNext,
@@ -173,8 +177,8 @@ ExecSeqScanWithQualProject(PlanState *pstate)
SeqScanState *node = castNode(SeqScanState, pstate);
Assert(pstate->state->es_epq_active == NULL);
- Assert(pstate->qual != NULL);
- Assert(pstate->ps_ProjInfo != NULL);
+ pg_assume(pstate->qual != NULL);
+ pg_assume(pstate->ps_ProjInfo != NULL);
return ExecScanExtended(&node->ss,
(ExecScanAccessMtd) SeqNext,
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index afa85d9fca9..a3d12931fff 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -5494,6 +5494,7 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
*entry;
struct berval **values;
LDAP_TIMEVAL time = {PGLDAP_TIMEOUT, 0};
+ int ldapversion = LDAP_VERSION3;
if ((url = strdup(purl)) == NULL)
{
@@ -5625,6 +5626,15 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
return 3;
}
+ if ((rc = ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &ldapversion)) != LDAP_SUCCESS)
+ {
+ libpq_append_error(errorMessage, "could not set LDAP protocol version: %s",
+ ldap_err2string(rc));
+ free(url);
+ ldap_unbind(ld);
+ return 3;
+ }
+
/*
* Perform an explicit anonymous bind.
*