<div dir="ltr"><div>The problem here is that xargs will strip single and double quotes from its inputs, meaning table names with spaces are not correctly dealt with.</div><div><br></div><div>I can confirm a preferred fix - use backticks:</div><div><br></div><div>I have changed the SELECT line to:</div><div>SELECT CONCAT("select count(*) into @discard from `", TABLE_SCHEMA, "`.`", TABLE_NAME, "`")</div><div><br></div><div>And can confirm that works.</div><div>xargs does not apparently strip backticks.</div><div><br></div><div>There is another potential fix mentioned in the answer below, which is specify the delimiter to xargs using `-d '\n'` which will also apparently work.</div><div><br></div><br><div>RE: related answer given here:</div><div><a href="https://stackoverflow.com/questions/79812697">https://stackoverflow.com/questions/79812697</a></div></div>