Ticket #20263: 20263.3.diff
| File 20263.3.diff, 1.5 KB (added by , 10 years ago) |
|---|
-
src/wp-admin/includes/upgrade.php
2201 2201 case 'unique': 2202 2202 case 'key': 2203 2203 $validfield = false; 2204 $indices[] = trim( trim($fld), ", \n");2204 $indices[] = trim( trim( str_replace( '`', '', $fld ) ), ", \n" ); 2205 2205 break; 2206 2206 } 2207 2207 $fld = trim( $fld ); 2208 2208 2209 2209 // If it's a valid field, add it to the field array. 2210 2210 if ( $validfield ) { 2211 $cfields[ $fieldname_lowercased ] = trim( $fld, ", \n" );2211 $cfields[ $fieldname_lowercased ] = trim( str_replace( '`', '', $fld ), ", \n" ); 2212 2212 } 2213 2213 } 2214 2214 -
tests/phpunit/tests/dbdelta.php
488 488 489 489 $this->assertEmpty( $updates ); 490 490 } 491 492 /** 493 * @ticket 20263 494 */ 495 function test_query_with_backticks_does_not_cause_a_query_to_alter_all_columns_and_indexes_to_run_even_if_none_have_changed() { 496 global $wpdb; 497 498 $schema = " 499 CREATE TABLE {$wpdb->prefix}dbdelta_test2 ( 500 `id` bigint(20) NOT NULL AUTO_INCREMENT, 501 PRIMARY KEY (`id`) 502 ) 503 "; 504 505 $wpdb->query( $schema ); 506 507 $updates = dbDelta( $schema, false ); 508 509 $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}dbdelta_test2" ); 510 511 $this->assertEmpty( $updates ); 512 } 491 513 }
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)