I wondered about using backticks instead, which worked. Change the SELECT statement to:
SELECT CONCAT("select count(*) into @discard from `", TABLE_SCHEMA, "`.`", TABLE_NAME, "`")