query_reviewer
query_reviewer copied to clipboard
Guard against @subqueries being empty
For queries without subqueries (ie: UPDATE), calling SqlQuery#table raises a NoMethodError, since @subqueries is an empty array and [].first returns nil. This happens if such a query triggers a warning (see SqlQuery#warn).
(We wanted to include a unit test, but they don't seem to be in working order.)