I am creating the following test trigger to update the value of a field whenever an UPDATE operation occurs:
CREATE TRIGGER `test_index`
AFTER UPDATE ON `main_itemmaster`
FOR EACH ROW
UPDATE `main_itemmaster` SET `guid` = "hello" WHERE `id` = NEW.id;
However, whenever I do an update to this table I get the following error:
Can't update table 'main_itemmaster' in stored function/trigger
because it is already used by statement which invoked this stored function/trigger.
Why is this occurring and how would I fix this?