Changeset 37538
- Timestamp:
- 05/23/2016 06:11:32 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/upgrade.php
r37533 r37538 2222 2222 2223 2223 // Get the field type from the query. 2224 preg_match( "|".$tablefield->Field." ([^ ]*( unsigned)?)|i", $cfields[ $tablefield_field_lowercased ], $matches);2224 preg_match( '|`?' . $tablefield->Field . '`? ([^ ]*( unsigned)?)|i', $cfields[ $tablefield_field_lowercased ], $matches ); 2225 2225 $fieldtype = $matches[1]; 2226 2226 $fieldtype_lowercased = strtolower( $fieldtype ); -
trunk/tests/phpunit/tests/dbdelta.php
r37525 r37538 465 465 ), $result ); 466 466 } 467 468 /** 469 * @ticket 20263 470 */ 471 function test_query_with_backticks_does_not_throw_an_undefined_index_warning() { 472 global $wpdb; 473 474 $schema = " 475 CREATE TABLE {$wpdb->prefix}dbdelta_test2 ( 476 `id` bigint(20) NOT NULL AUTO_INCREMENT, 477 `column_1` varchar(255) NOT NULL, 478 PRIMARY KEY (id), 479 KEY compound_key (id,column_1) 480 ) 481 "; 482 483 $wpdb->query( $schema ); 484 485 $updates = dbDelta( $schema, false ); 486 487 $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}dbdelta_test2" ); 488 489 $this->assertEmpty( $updates ); 490 } 467 491 }
Note: See TracChangeset
for help on using the changeset viewer.