You cannot refer to a table when updating it.
/* my sql does not support this */
UPDATE tableName WHERE 1 = (SELECT 1 FROM tableName)
From MySQL Docs:
A trigger can access both old and new data in its own table. A trigger can also affect other tables, but it is not permitted to modify a table that is already being used (for reading or writing) by the statement that invoked the function or trigger. (Before MySQL 5.0.10, a trigger cannot modify other tables.)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…