From 98f3c64e04cc93a44b178de0d176db873520f9e4 Mon Sep 17 00:00:00 2001 From: zhang_xubo <2578876417@qq.com> Date: Fri, 17 Mar 2023 16:06:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E5=86=85=E6=A0=B8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=93=E6=9E=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dependency/mysql_fdw/build.sh | 1 + .../mysql_fdw/opengauss-reltargetlist.patch | 35 +++++++++++++++++++ dependency/oracle_fdw/build.sh | 1 + .../oracle_fdw/opengauss-reltargetlist.patch | 17 +++++++++ 4 files changed, 54 insertions(+) create mode 100644 dependency/mysql_fdw/opengauss-reltargetlist.patch create mode 100644 dependency/oracle_fdw/opengauss-reltargetlist.patch diff --git a/dependency/mysql_fdw/build.sh b/dependency/mysql_fdw/build.sh index 3b34b75db..d4ec34e37 100644 --- a/dependency/mysql_fdw/build.sh +++ b/dependency/mysql_fdw/build.sh @@ -43,6 +43,7 @@ cd .. # patch for adapting join push down interface cd ${SOURCE_DIR} patch -p1 < ../opengauss_mysql_fdw-2.5.5_patch_20221230.patch +patch -p1 < ../opengauss-reltargetlist.patch cd .. ## move to target path diff --git a/dependency/mysql_fdw/opengauss-reltargetlist.patch b/dependency/mysql_fdw/opengauss-reltargetlist.patch new file mode 100644 index 000000000..3b15b1f8f --- /dev/null +++ b/dependency/mysql_fdw/opengauss-reltargetlist.patch @@ -0,0 +1,35 @@ +diff -crN '--exclude=.git' '--exclude=.gitee' mysql_fdw-REL-2_5_5/mysql_fdw.cpp mysql_fdw-REL-2_5_5_edit/mysql_fdw.cpp +*** mysql_fdw-REL-2_5_5/mysql_fdw.cpp 2023-03-17 16:12:56.762701313 +0800 +--- mysql_fdw-REL-2_5_5_edit/mysql_fdw.cpp 2023-03-17 16:13:36.792033884 +0800 +*************** +*** 777,789 **** + + mysql_query(conn, "SET sql_mode='ANSI_QUOTES'"); + +- #if PG_VERSION_NUM >= 90600 + pull_varattnos((Node *) baserel->reltarget->exprs, baserel->relid, + &attrs_used); +- #else +- pull_varattnos((Node *) baserel->reltargetlist, baserel->relid, +- &attrs_used); +- #endif + + foreach(lc, baserel->baserestrictinfo) + { +--- 777,784 ---- +*************** +*** 795,807 **** + fpinfo->local_conds = lappend(fpinfo->local_conds, ri); + } + +- #if PG_VERSION_NUM >= 90600 + pull_varattnos((Node *) baserel->reltarget->exprs, baserel->relid, + &fpinfo->attrs_used); +- #else +- pull_varattnos((Node *) baserel->reltargetlist, baserel->relid, +- &fpinfo->attrs_used); +- #endif + + foreach(lc, fpinfo->local_conds) + { +--- 790,797 ---- diff --git a/dependency/oracle_fdw/build.sh b/dependency/oracle_fdw/build.sh index 988e49320..ae211ee15 100644 --- a/dependency/oracle_fdw/build.sh +++ b/dependency/oracle_fdw/build.sh @@ -43,6 +43,7 @@ cd .. # patch for adapting join push down interface cd ${SOURCE_DIR} patch -p1 < ../opengauss_oracle_fdw-2.2.0_patch_20221230.patch +patch -p1 < ../opengauss-reltargetlist.patch cd .. ## move to target path diff --git a/dependency/oracle_fdw/opengauss-reltargetlist.patch b/dependency/oracle_fdw/opengauss-reltargetlist.patch new file mode 100644 index 000000000..6d4db7830 --- /dev/null +++ b/dependency/oracle_fdw/opengauss-reltargetlist.patch @@ -0,0 +1,17 @@ +diff -crN '--exclude=.git' '--exclude=.gitee' oracle_fdw-ORACLE_FDW_2_2_0/oracle_fdw.cpp oracle_fdw-ORACLE_FDW_2_2_0_edit/oracle_fdw.cpp +*** oracle_fdw-ORACLE_FDW_2_2_0/oracle_fdw.cpp 2023-03-17 16:19:09.627917711 +0800 +--- oracle_fdw-ORACLE_FDW_2_2_0_edit/oracle_fdw.cpp 2023-03-17 16:19:35.572144145 +0800 +*************** +*** 2707,2717 **** + List *columnlist, + *conditions = foreignrel->baserestrictinfo; + +- #if PG_VERSION_NUM < 90600 +- columnlist = foreignrel->reltargetlist; +- #else + columnlist = foreignrel->reltarget->exprs; +- #endif + + #ifdef JOIN_API + if (IS_SIMPLE_REL(foreignrel)) +--- 2707,2713 ---- -- Gitee