Make WordPress Core


Ignore:
Timestamp:
09/12/2016 05:08:17 AM (8 years ago)
Author:
pento
Message:

Database: Normalise index names in dbDelta().

When comparing index definitions, normalise the index names to lower case, as they are not case sensitive within MySQL.

Fixes #34874.

File:
1 edited

Legend:

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

    r38044 r38591  
    804804
    805805    /**
     806     * @ticket 34874
     807     */
     808    function test_key_names_are_not_case_sensitive_and_do_not_recreate_indices() {
     809        global $wpdb;
     810
     811        $updates = dbDelta(
     812            "
     813            CREATE TABLE {$wpdb->prefix}dbdelta_test (
     814                id bigint(20) NOT NULL AUTO_INCREMENT,
     815                column_1 varchar(255) NOT NULL,
     816                column_2 text,
     817                column_3 blob,
     818                PRIMARY KEY  (id),
     819                KEY KEY_1 (column_1),
     820                KEY compOUND_key (id,column_1),
     821                FULLTEXT KEY FULLtext_kEY (column_1)
     822            ) ENGINE=MyISAM
     823            ", false );
     824
     825        $this->assertEmpty( $updates );
     826    }
     827
     828    /**
    806829     * @ticket 31679
    807830     */
Note: See TracChangeset for help on using the changeset viewer.