Make WordPress Core

Changeset 47183


Ignore:
Timestamp:
02/05/2020 03:28:33 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Tests: Allow wpdb::set_sql_mode() tests to run on MySQL 8.0.11+.

MySQL 8.0.11 removed support for the NO_AUTO_CREATE_USER SQL mode, which was used in as an example of a mode compatible with WordPress.

NO_AUTO_VALUE_ON_ZERO is now used in the affected tests instead, which is supported on both MySQL 5.7.x and 8.0.x.

Props kaggdesign, jeremyfelt, afragen.
Fixes #44586. See #49344.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/db.php

    r47122 r47183  
    296296        $current_modes = $wpdb->get_var( 'SELECT @@SESSION.sql_mode;' );
    297297
    298         $new_modes = array( 'IGNORE_SPACE', 'NO_AUTO_CREATE_USER' );
     298        $new_modes = array( 'IGNORE_SPACE', 'NO_AUTO_VALUE_ON_ZERO' );
    299299
    300300        $wpdb->set_sql_mode( $new_modes );
     
    316316        $current_modes = $wpdb->get_var( 'SELECT @@SESSION.sql_mode;' );
    317317
    318         $new_modes = array( 'IGNORE_SPACE', 'NO_ZERO_DATE', 'NO_AUTO_CREATE_USER' );
     318        $new_modes = array( 'IGNORE_SPACE', 'NO_ZERO_DATE', 'NO_AUTO_VALUE_ON_ZERO' );
    319319        $wpdb->set_sql_mode( $new_modes );
    320320        $check_new_modes = $wpdb->get_var( 'SELECT @@SESSION.sql_mode;' );
     
    334334        $current_modes = $wpdb->get_var( 'SELECT @@SESSION.sql_mode;' );
    335335
    336         $new_modes = array( 'IGNORE_SPACE', 'ONLY_FULL_GROUP_BY', 'NO_AUTO_CREATE_USER' );
     336        $new_modes = array( 'IGNORE_SPACE', 'ONLY_FULL_GROUP_BY', 'NO_AUTO_VALUE_ON_ZERO' );
    337337
    338338        add_filter( 'incompatible_sql_modes', array( $this, 'filter_allowed_incompatible_sql_mode' ), 1, 1 );
Note: See TracChangeset for help on using the changeset viewer.