If it UPDATEdoes not change any data in a row, MySQLdoes not consider this row:
mysql> SELECT val FROM t_source2 WHERE id = 1;
+-----+
| val |
+-----+
| 10 |
+-----+
1 row in set (0.00 sec)
mysql> UPDATE t_source2 SET val = 1 WHERE id = 1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> UPDATE t_source2 SET val = 1 WHERE id = 1;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
The second statement UPDATEexecuted, but did not touch the lines from the point MySQL, since it did not change anything.
source
share