Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-14267

SQL error on phpbb\config\db_text value(s) update

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Major Major
    • None
    • 3.1.6
    • Other
    • 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.

            Marc Marc
            rxu rxu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: