Last active
September 5, 2015 04:11
-
-
Save mc-soi/6b4a504bc1393c4ba9f4 to your computer and use it in GitHub Desktop.
informix_fdw patch for PostgreSQL 9.5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ifx_fdw.c b/ifx_fdw.c | |
index fab4df8..4d83ee4 100644 | |
--- a/ifx_fdw.c | |
+++ b/ifx_fdw.c | |
@@ -1829,13 +1829,15 @@ static void ifxPrepareParamsForModify(IfxFdwExecutionState *state, | |
* Shamelessly stolen from src/contrib/postgres_fdw. | |
*/ | |
RangeTblEntry *rte = planner_rt_fetch(resultRelation, planInfo); | |
- Bitmapset *tmpset = bms_copy(rte->modifiedCols); | |
- AttrNumber col; | |
+ int col; | |
- while ((col = bms_first_member(tmpset)) >= 0) | |
+ col = -1; | |
+ while ((col = bms_next_member(rte->updatedCols, col)) >= 0) | |
{ | |
- col += FirstLowInvalidHeapAttributeNumber; | |
- if (col <= InvalidAttrNumber) /* shouldn't happen */ | |
+ /* bit numbers are offset by FirstLowInvalidHeapAttributeNumber */ | |
+ AttrNumber attno = col + FirstLowInvalidHeapAttributeNumber; | |
+ | |
+ if (attno <= InvalidAttrNumber) /* shouldn't happen */ | |
elog(ERROR, "system-column update is not supported"); | |
state->affectedAttrNums = lappend_int(state->affectedAttrNums, | |
col); | |
@@ -3200,7 +3202,8 @@ static ForeignScan *ifxGetForeignPlan(PlannerInfo *root, | |
scan_clauses, | |
scan_relid, | |
NIL, | |
- plan_values); | |
+ plan_values, | |
+ NIL); | |
} | |
#else |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment