Fix registering "SELECT *" queries as tables and caching them.  As some tests for this and self-joins.