diff --git a/src/gausskernel/optimizer/commands/analyze.cpp b/src/gausskernel/optimizer/commands/analyze.cpp index 68e64b978a70a91c2de0c4ef5ce39fb03f61c3cc..4b6943187745af62afe38fb4d0ab892c5923496d 100755 --- a/src/gausskernel/optimizer/commands/analyze.cpp +++ b/src/gausskernel/optimizer/commands/analyze.cpp @@ -551,6 +551,8 @@ static void analyze_rel_internal(Relation onerel, VacuumStmt* vacstmt, BufferAcc retValue = fdwroutine->AnalyzeForeignTable(onerel, &acquirefunc, &relpages, 0, false); } if (!retValue) { + /* Supress warning info for mysql_fdw */ + messageLevel = isMysqlFDWFromTblOid(RelationGetRelid(onerel)) ? LOG : messageLevel; ereport(messageLevel, (errmsg( "Skipping \"%s\" --- cannot analyze this foreign table.", RelationGetRelationName(onerel)))); @@ -886,7 +888,8 @@ HeapTuple* get_total_rows(Relation onerel, VacuumStmt* vacstmt, BlockNumber relp *numrows = acquirePartitionedSampleRows( onerel, vacstmt, elevel, rows, target_rows, totalrows, totaldeadrows, vacattrstats, attr_cnt); } else if (isForeignTable || - (onerel->rd_rel->relkind == RELKIND_FOREIGN_TABLE && isMOTFromTblOid(RelationGetRelid(onerel)))) { + (onerel->rd_rel->relkind == RELKIND_FOREIGN_TABLE && + (isMOTFromTblOid(RelationGetRelid(onerel)) || isOracleFDWFromTblOid(RelationGetRelid(onerel))))) { /* * @hdfs processing foreign table sampling operation * get foreign table FDW routine diff --git a/third_party/dependency/oracle_fdw/huawei_oracle_fdw-2.2.0_patch.patch b/third_party/dependency/oracle_fdw/huawei_oracle_fdw-2.2.0_patch.patch index 4140529a65c89747184df27060458b5ec5c7547c..55d07effef0da0ad9e24ccf5f34ad8c27fb0fd6e 100644 --- a/third_party/dependency/oracle_fdw/huawei_oracle_fdw-2.2.0_patch.patch +++ b/third_party/dependency/oracle_fdw/huawei_oracle_fdw-2.2.0_patch.patch @@ -20,7 +20,7 @@ index 5f8b100..7fdd24f 100644 +override CPPFLAGS := $(filter-out $(exclude_option),$(CPPFLAGS)) \ No newline at end of file diff --git oracle_fdw.cpp oracle_fdw.cpp -index e75b6ab..7e83a4f 100644 +index e75b6ab..c7eec41 100644 --- oracle_fdw.cpp +++ oracle_fdw.cpp @@ -92,13 +92,13 @@ @@ -121,6 +121,15 @@ index e75b6ab..7e83a4f 100644 #ifdef IMPORT_API static char *fold_case(char *name, fold_t foldcase, int collation); #endif /* IMPORT_API */ +@@ -403,7 +404,7 @@ PGDLLEXPORT Datum + oracle_fdw_handler(PG_FUNCTION_ARGS) + { + FdwRoutine *fdwroutine = makeNode(FdwRoutine); +- ++ fdwroutine->AcquireSampleRows = acquireSampleRowsFunc; + #ifdef OLD_FDW_API + fdwroutine->PlanForeignScan = oraclePlanForeignScan; + #else @@ -457,7 +458,7 @@ oracle_fdw_validator(PG_FUNCTION_ARGS) Oid catalog = PG_GETARG_OID(1); ListCell *cell;