/* * Here is a more concise example of the problem */ CREATE TABLE linkedTable ( testTableId INT ) ENGINE = INNODB; CREATE TABLE testTable ( id INT, data CHAR(50), timestamp TIMESTAMP(14) ) ENGINE = INNODB; INSERT INTO linkedTable (testTableId) VALUES (1); INSERT INTO testTable (id,data) VALUES (1,'original data'); SELECT * FROM linkedTable LEFT JOIN testTable ON testTableId=id; # Do an update to testTable directly which does not change anything UPDATE testTable SET data='original data' WHERE id=1; SELECT * FROM linkedTable LEFT JOIN testTable ON testTableId=id; # Protect the update with an additional condition in the WHERE clause UPDATE linkedTable LEFT JOIN testTable ON testTableId=id SET data='original data' WHERE id=1 AND data<>'original data'; SELECT * FROM linkedTable LEFT JOIN testTable ON testTableId=id; # Do an update to testTable linked to linkedTable which should not change anything UPDATE linkedTable LEFT JOIN testTable ON testTableId=id SET data='original data' WHERE id=1; SELECT * FROM linkedTable LEFT JOIN testTable ON testTableId=id; /********************************************************************** * Wait at least one second before doing the following statements **********************************************************************/ # Do an update to testTable directly which does not change anything UPDATE testTable SET data='original data' WHERE id=1; SELECT * FROM linkedTable LEFT JOIN testTable ON testTableId=id; # Protect the update with an additional condition in the WHERE clause UPDATE linkedTable LEFT JOIN testTable ON testTableId=id SET data='original data' WHERE id=1 AND data<>'original data'; SELECT * FROM linkedTable LEFT JOIN testTable ON testTableId=id; # Do an update to testTable linked to linkedTable which should not change anything UPDATE linkedTable LEFT JOIN testTable ON testTableId=id SET data='original data' WHERE id=1; SELECT * FROM linkedTable LEFT JOIN testTable ON testTableId=id;