Really skip CDB_TableMetadata lookup for sql affected by no tables

Closes #169