diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php
index e206152e84..6e79e45477 100644
|
a
|
b
|
function dbDelta( $queries = '', $execute = true ) { // phpcs:ignore WordPress.N |
| 3201 | 3201 | $fieldtype_base = strtok( $fieldtype_without_parentheses, ' ' ); |
| 3202 | 3202 | |
| 3203 | 3203 | // Is actual field type different from the field type in query? |
| 3204 | | if ( $tablefield->Type !== $fieldtype ) { |
| | 3204 | if ( $tablefield->Type !== $fieldtype_lowercased ) { |
| 3205 | 3205 | $do_change = true; |
| 3206 | 3206 | if ( in_array( $fieldtype_lowercased, $text_fields, true ) && in_array( $tablefield_type_lowercased, $text_fields, true ) ) { |
| 3207 | 3207 | if ( array_search( $fieldtype_lowercased, $text_fields, true ) < array_search( $tablefield_type_lowercased, $text_fields, true ) ) { |
diff --git a/tests/phpunit/tests/db/dbDelta.php b/tests/phpunit/tests/db/dbDelta.php
index 8b028e030e..5436d9fe1a 100644
|
a
|
b
|
class Tests_DB_dbDelta extends WP_UnitTestCase { |
| 1090 | 1090 | $updates |
| 1091 | 1091 | ); |
| 1092 | 1092 | } |
| | 1093 | |
| | 1094 | /** |
| | 1095 | * @ticket 59481 |
| | 1096 | */ |
| | 1097 | public function test_column_types_are_not_case_sensitive() { |
| | 1098 | global $wpdb; |
| | 1099 | |
| | 1100 | $updates = dbDelta( |
| | 1101 | " |
| | 1102 | CREATE TABLE {$wpdb->prefix}dbdelta_test ( |
| | 1103 | id bigint(20) NOT NULL AUTO_INCREMENT, |
| | 1104 | column_1 varCHAr(255) NOT NULL, |
| | 1105 | column_2 TEXT, |
| | 1106 | column_3 blOB, |
| | 1107 | PRIMARY KEY (id), |
| | 1108 | KEY key_1 (column_1($this->max_index_length)), |
| | 1109 | KEY compound_key (id,column_1($this->max_index_length)), |
| | 1110 | FULLTEXT KEY fulltext_key (column_1) |
| | 1111 | ) {$this->db_engine} |
| | 1112 | ", |
| | 1113 | false |
| | 1114 | ); |
| | 1115 | |
| | 1116 | $this->assertEmpty( $updates ); |
| | 1117 | } |
| 1093 | 1118 | } |