Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Display the MySQL query as part of the additional EXPLAIN info.

  • Loading branch information...
commit ab9b1942ea07e026494fc533ba45d2ab25c9df17 1 parent 81dff10
@dpage dpage authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  mysql_fdw.c
View
3  mysql_fdw.c
@@ -466,6 +466,8 @@ mysqlExplainForeignScan(ForeignScanState *node, ExplainState *es)
char *svr_query = NULL;
char *svr_table = NULL;
+ MySQLFdwExecutionState *festate = (MySQLFdwExecutionState *) node->fdw_state;
+
/* Fetch options */
mysqlGetOptions(RelationGetRelid(node->ss.ss_currentRelation), &svr_address, &svr_port, &svr_username, &svr_password, &svr_database, &svr_query, &svr_table);
@@ -476,6 +478,7 @@ mysqlExplainForeignScan(ForeignScanState *node, ExplainState *es)
ExplainPropertyLong("Local server startup cost", 10, es);
else
ExplainPropertyLong("Remote server startup cost", 25, es);
+ ExplainPropertyText("MySQL query", festate->query, es);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.