Permalink
Browse files

Ignore un-initialized result on ReScan

If we run as the inner node of a nested loop mysqlReScanForeignScan
may be called first, prior to the result being initialized, causing a
segfault in the back end.  There's nothing to be done in that case
anyway, so just ignore it.
  • Loading branch information...
1 parent 3f1f460 commit 7bcf32c208bccfd8ad52b5430498dbee8ae5c786 @joshwilliams joshwilliams committed Apr 10, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 mysql_fdw.c
View
@@ -626,6 +626,9 @@ mysqlReScanForeignScan(ForeignScanState *node)
{
MySQLFdwExecutionState *festate = (MySQLFdwExecutionState *) node->fdw_state;
- mysql_data_seek(festate->result, 0);
+ if (festate->result)
+ {
+ mysql_data_seek(festate->result, 0);
+ }
}

0 comments on commit 7bcf32c

Please sign in to comment.