Fix fdw analyze bug.
1. For mysql_fdw, remove useless warning info when analyze. 2. For oracle_fdw, fix analyze failed problem.
This commit is contained in:
@ -551,6 +551,8 @@ static void analyze_rel_internal(Relation onerel, VacuumStmt* vacstmt, BufferAcc
|
|||||||
retValue = fdwroutine->AnalyzeForeignTable(onerel, &acquirefunc, &relpages, 0, false);
|
retValue = fdwroutine->AnalyzeForeignTable(onerel, &acquirefunc, &relpages, 0, false);
|
||||||
}
|
}
|
||||||
if (!retValue) {
|
if (!retValue) {
|
||||||
|
/* Supress warning info for mysql_fdw */
|
||||||
|
messageLevel = isMysqlFDWFromTblOid(RelationGetRelid(onerel)) ? LOG : messageLevel;
|
||||||
ereport(messageLevel,
|
ereport(messageLevel,
|
||||||
(errmsg(
|
(errmsg(
|
||||||
"Skipping \"%s\" --- cannot analyze this foreign table.", RelationGetRelationName(onerel))));
|
"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<estimate_table_rownum>(
|
*numrows = acquirePartitionedSampleRows<estimate_table_rownum>(
|
||||||
onerel, vacstmt, elevel, rows, target_rows, totalrows, totaldeadrows, vacattrstats, attr_cnt);
|
onerel, vacstmt, elevel, rows, target_rows, totalrows, totaldeadrows, vacattrstats, attr_cnt);
|
||||||
} else if (isForeignTable ||
|
} 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
|
* @hdfs processing foreign table sampling operation
|
||||||
* get foreign table FDW routine
|
* get foreign table FDW routine
|
||||||
|
@ -20,7 +20,7 @@ index 5f8b100..7fdd24f 100644
|
|||||||
+override CPPFLAGS := $(filter-out $(exclude_option),$(CPPFLAGS))
|
+override CPPFLAGS := $(filter-out $(exclude_option),$(CPPFLAGS))
|
||||||
\ No newline at end of file
|
\ No newline at end of file
|
||||||
diff --git oracle_fdw.cpp oracle_fdw.cpp
|
diff --git oracle_fdw.cpp oracle_fdw.cpp
|
||||||
index e75b6ab..7e83a4f 100644
|
index e75b6ab..c7eec41 100644
|
||||||
--- oracle_fdw.cpp
|
--- oracle_fdw.cpp
|
||||||
+++ oracle_fdw.cpp
|
+++ oracle_fdw.cpp
|
||||||
@@ -92,13 +92,13 @@
|
@@ -92,13 +92,13 @@
|
||||||
@ -121,6 +121,15 @@ index e75b6ab..7e83a4f 100644
|
|||||||
#ifdef IMPORT_API
|
#ifdef IMPORT_API
|
||||||
static char *fold_case(char *name, fold_t foldcase, int collation);
|
static char *fold_case(char *name, fold_t foldcase, int collation);
|
||||||
#endif /* IMPORT_API */
|
#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)
|
@@ -457,7 +458,7 @@ oracle_fdw_validator(PG_FUNCTION_ARGS)
|
||||||
Oid catalog = PG_GETARG_OID(1);
|
Oid catalog = PG_GETARG_OID(1);
|
||||||
ListCell *cell;
|
ListCell *cell;
|
||||||
|
Reference in New Issue
Block a user