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.



git-svn-id: https://develop.svn.wordpress.org/trunk@38591 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast
2016-09-12 05:08:17 +00:00
parent f54b5428c4
commit 7511fe88cc
2 changed files with 27 additions and 4 deletions

View File

@@ -802,6 +802,29 @@ class Tests_dbDelta extends WP_UnitTestCase {
$this->assertEmpty( $updates );
}
/**
* @ticket 34874
*/
function test_key_names_are_not_case_sensitive_and_do_not_recreate_indices() {
global $wpdb;
$updates = dbDelta(
"
CREATE TABLE {$wpdb->prefix}dbdelta_test (
id bigint(20) NOT NULL AUTO_INCREMENT,
column_1 varchar(255) NOT NULL,
column_2 text,
column_3 blob,
PRIMARY KEY (id),
KEY KEY_1 (column_1),
KEY compOUND_key (id,column_1),
FULLTEXT KEY FULLtext_kEY (column_1)
) ENGINE=MyISAM
", false );
$this->assertEmpty( $updates );
}
/**
* @ticket 31679
*/