Last active
September 5, 2015 04:12
-
-
Save mc-soi/7201e5627573646b4f60 to your computer and use it in GitHub Desktop.
jdbc2_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/jdbc2_fdw.c b/jdbc2_fdw.c | |
index a4a89d9..a194808 100644 | |
--- a/jdbc2_fdw.c | |
+++ b/jdbc2_fdw.c | |
@@ -716,7 +716,8 @@ jdbcGetForeignPlan(PlannerInfo *root, | |
local_exprs, | |
scan_relid, | |
params_list, | |
- fdw_private); | |
+ fdw_private, | |
+ NIL); | |
} | |
/* | |
@@ -1027,16 +1028,18 @@ postgresPlanForeignModify(PlannerInfo *root, | |
} | |
else if (operation == CMD_UPDATE) | |
{ | |
- Bitmapset *tmpset = bms_copy(rte->modifiedCols); | |
- AttrNumber col; | |
+ int col; | |
- while ((col = bms_first_member(tmpset)) >= 0) | |
- { | |
- col += FirstLowInvalidHeapAttributeNumber; | |
- if (col <= InvalidAttrNumber) /* shouldn't happen */ | |
- elog(ERROR, "system-column update is not supported"); | |
- targetAttrs = lappend_int(targetAttrs, col); | |
- } | |
+ col = -1; | |
+ while ((col = bms_next_member(rte->updatedCols, col)) >= 0) | |
+ { | |
+ /* bit numbers are offset by FirstLowInvalidHeapAttributeNumber */ | |
+ AttrNumber attno = col + FirstLowInvalidHeapAttributeNumber; | |
+ | |
+ if (attno <= InvalidAttrNumber) /* shouldn't happen */ | |
+ elog(ERROR, "system-column update is not supported"); | |
+ targetAttrs = lappend_int(targetAttrs, attno); | |
+ } | |
} | |
/* | |
@@ -1938,15 +1941,15 @@ set_transmission_modes(void) | |
if (DateStyle != USE_ISO_DATES) | |
(void) set_config_option("datestyle", "ISO", | |
PGC_USERSET, PGC_S_SESSION, | |
- GUC_ACTION_SAVE, true, 0); | |
+ GUC_ACTION_SAVE, true, 0, false); | |
if (IntervalStyle != INTSTYLE_POSTGRES) | |
(void) set_config_option("intervalstyle", "postgres", | |
PGC_USERSET, PGC_S_SESSION, | |
- GUC_ACTION_SAVE, true, 0); | |
+ GUC_ACTION_SAVE, true, 0, false); | |
if (extra_float_digits < 3) | |
(void) set_config_option("extra_float_digits", "3", | |
PGC_USERSET, PGC_S_SESSION, | |
- GUC_ACTION_SAVE, true, 0); | |
+ GUC_ACTION_SAVE, true, 0, false); | |
return nestlevel; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment