Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-10483

Test suite does not run with MySQL strict mode

    Details

    • Type: Task
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.10-RC1
    • Fix Version/s: 3.0.10-RC2
    • Component/s: Test Suite
    • Labels:
      None

      Description

      When running the tests in MySQL strict mode, the test suite fails with 62 errors among these lines:

      [code]
      1) phpbb_dbal_select_test::test_return_on_error_select with data set #0 ('phpbb_users', 'username_clean = \'bertie\'', array(array('bertie')))
      PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[INSERT] operation failed on query:
      INSERT INTO `phpbb_users`
      (`user_id`, `username_clean`)
      VALUES
      (?, ?)
      using args: Array
      (
      [0] => 1
      [1] => barfoo
      )
      [SQLSTATE[HY000]: General error: 1364 Field 'user_permissions' doesn't have a default value]
      [code]

      The solution to this problem appears to be defining the missing fields in the dbunit fixtures.

        Activity

        Hide
        igorw Igor Wiedler [X] (Inactive) added a comment -

        This is most likely being caused by innodb_strict_mode, as we do set STRICT_ALL_TABLES in dbal.

        Show
        igorw Igor Wiedler [X] (Inactive) added a comment - This is most likely being caused by innodb_strict_mode, as we do set STRICT_ALL_TABLES in dbal.
        Hide
        Oleg Oleg [X] (Inactive) added a comment -

        Looking at schema files, I would say the bug is those columns not having default values.

        Show
        Oleg Oleg [X] (Inactive) added a comment - Looking at schema files, I would say the bug is those columns not having default values.
        Hide
        igorw Igor Wiedler [X] (Inactive) added a comment -

        That is because *text types in mysql cannot have default values.

        Show
        igorw Igor Wiedler [X] (Inactive) added a comment - That is because *text types in mysql cannot have default values.
        Hide
        Oleg Oleg [X] (Inactive) added a comment -

        Right, I suppose we have to do this then. So in strict mode in mysql you have to explicitly specify values for all text and blob columns in each insert statement? Nice.

        Show
        Oleg Oleg [X] (Inactive) added a comment - Right, I suppose we have to do this then. So in strict mode in mysql you have to explicitly specify values for all text and blob columns in each insert statement? Nice.
        Hide
        igorw Igor Wiedler [X] (Inactive) added a comment -

        From what I can tell you have to do that, yea.

        Show
        igorw Igor Wiedler [X] (Inactive) added a comment - From what I can tell you have to do that, yea.

          People

          • Assignee:
            igorw Igor Wiedler [X] (Inactive)
            Reporter:
            igorw Igor Wiedler [X] (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development