The name column is NULL now. You may expect that the value of the name column remains intact. However, the REPLACE statement does not behave this way. In this case, the REPLACE statement works as follows:
The REPLACE statement first inserts the new row into the cities table with the information provided by the column list. The insertion fails because the row with id 2 already exists in the cities table therefore MySQL raises a duplicate-key error.
The REPLACE statement then updates the row that has the key specified in the value of the id column. In the normal process, it would delete the old row with conflict id first and then inserts a new row.
We know that the REPLACE statement did not delete the old row and inserted the new row because the value of the id column is 2 instead of 4.