Ticket #20263: 20263.2.diff
| File 20263.2.diff, 1.6 KB (added by , 10 years ago) |
|---|
-
src/wp-admin/includes/upgrade.php
2218 2218 if (array_key_exists(strtolower($tablefield->Field), $cfields)) { 2219 2219 2220 2220 // Get the field type from the query. 2221 preg_match("|".$tablefield->Field." ([^ ]*( unsigned)?)|i", $cfields[strtolower($tablefield->Field)], $matches); 2221 $parts = explode( $tablefield->Field, $cfields[ $tablefield->Field ], 2 ); 2222 $remainder = ltrim( $parts[1], ' `' ); 2223 2224 preg_match( '/([^ ]+( unsigned)?)/i', $remainder, $matches ); 2225 2222 2226 $fieldtype = $matches[1]; 2223 2227 2224 2228 // Is actual field type different from the field type in query? -
tests/phpunit/tests/dbdelta.php
362 362 363 363 $this->assertSame( array(), $actual ); 364 364 } 365 366 /** 367 * @ticket 20263 368 */ 369 function test_query_with_backticks_does_not_throw_an_undefined_index_warning() { 370 global $wpdb; 371 372 $schema = " 373 CREATE TABLE {$wpdb->prefix}dbdelta_test2 ( 374 `id` bigint(20) NOT NULL AUTO_INCREMENT, 375 `column_1` varchar(255) NOT NULL, 376 PRIMARY KEY (id), 377 KEY compound_key (id,column_1) 378 ) 379 "; 380 381 $wpdb->query( $schema ); 382 383 $updates = dbDelta( $schema, false ); 384 385 $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}dbdelta_test2" ); 386 387 $this->assertEmpty( $updates ); 388 } 365 389 }
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)