dpage/mysql_fdw — pull request #8 by jjthiessen (2013-10-05 06:50:19+00:00)
Title: Skip NULL "rows" values from EXPLAIN when performing query cost estimates.

This is required to avoid segmentation faults for UNION queries (as EXPLAIN ... UNION emits NULL "rows" values for 'UNION RESULT' selects). Please see the following example query:
```
mysql> explain (select host from user) union (select db from proc);
+----+--------------+------------+-------+---------------+---------+---------+------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+--------------+------------+-------+---------------+---------+---------+------+------+-------------+
| 1 | PRIMARY | user | index | NULL | PRIMARY | 228 | NULL | 7 | Using index |
| 2 | UNION | proc | index | NULL | PRIMARY | 385 | NULL | 6 | Using index |
| NULL | UNION RESULT | | ALL | NULL | NULL | NULL | NULL | NULL | |
+----+--------------+------------+-------+---------------+---------+---------+------+------+-------------+
3 rows in set (0.00 sec)
```
Prior to this commit, there were no NULL checks performed on "rows" before passing it into `atof()` (thus causing a segmentation fault).