BUG: fix checking of table name in read_sql (GH7826)
Merge pull request #7961 from jorisvandenbossche/sql-7826

BUG: fix checking of table name in read_sql (GH7826)