-
Bug
-
Resolution: Invalid
-
Major
-
None
-
3.1.6
-
None
Support topic: https://www.phpbb.com/community/viewtopic.php?f=466&t=2343156
The problem is in the code structure of the set_array() function here https://github.com/phpbb/phpbb/blob/3.1.x/phpBB/phpbb/config/db_text.php#L100-L105.
set_array() tries to update the table, then checks for sql_affectedrows and tries to insert new record if it's 0.
MySQL docs says: If you set a column to the value it currently has, MySQL notices this and does not update it. (https://dev.mysql.com/doc/refman/5.0/en/update.html)
This,sql_affectedrows can be 0 if there're no existing records were updated just because of the fact the value is being set to the same as current value.
MySQL just doesn't update it.
Then we try to insert a duplication row and get SQL error.