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

Database sequences are not updated for tests using fixtures with auto_incremented columns

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.0.12-RC1
    • 3.0.11, 3.1.0-dev
    • Test Suite
    • None
    • Oracle XE 11g, PostreSQL 9.1

      If a test uses a fixture that provides a value for an auto_incremented column, certain databases will not update their internal sequence values. If a test then attempts to insert a new row without that key specified, there will be an error since the system will use a key that is already in the table. Oracle and Postgres seem to be the only ones affected. For Oracle this could be fixed by making the triggers always check for the maximum value, but for PostgreSQL I don't believe it would be possible to fix in phpBB itself. Since we don't insert rows into the database with a value specified on auto_incremented columns, I think working around it in the testing framework should be sufficient.

      You can see an example of the problem occurring here: https://travis-ci.org/phpbb/phpbb3/jobs/3225621

            Oleg Oleg [X] (Inactive)
            Noxwizard Patrick Webster
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: