Index: trunk/phase3/maintenance/tests/DatabaseSqliteTest.php |
— | — | @@ -36,9 +36,9 @@ |
37 | 37 | $this->assertEquals( 'foo', $this->replaceVars( 'foo' ), "Don't break anything accidentally" ); |
38 | 38 | |
39 | 39 | $this->assertEquals( "CREATE TABLE /**/foo (foo_key INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, " |
40 | | - . "foo_name TEXT NOT NULL DEFAULT '', foo_int INTEGER, foo_int2 INTEGER );", |
| 40 | + . "foo_bar TEXT, foo_name TEXT NOT NULL DEFAULT '', foo_int INTEGER, foo_int2 INTEGER );", |
41 | 41 | $this->replaceVars( "CREATE TABLE /**/foo (foo_key int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, |
42 | | - foo_name varchar(255) binary NOT NULL DEFAULT '', foo_int tinyint( 8 ), foo_int2 int(16) ) ENGINE=MyISAM;" ) |
| 42 | + foo_bar char(13), foo_name varchar(255) binary NOT NULL DEFAULT '', foo_int tinyint ( 8 ), foo_int2 int(16) ) ENGINE=MyISAM;" ) |
43 | 43 | ); |
44 | 44 | |
45 | 45 | $this->assertEquals( "CREATE TABLE foo ( foo_binary1 BLOB, foo_binary2 BLOB );", |
Index: trunk/phase3/includes/db/DatabaseSqlite.php |
— | — | @@ -572,9 +572,9 @@ |
573 | 573 | // no such thing as unsigned |
574 | 574 | $s = preg_replace( '/\b(un)?signed\b/i', '', $s ); |
575 | 575 | // INT -> INTEGER |
576 | | - $s = preg_replace( '/\b(tiny|small|medium|big|)int(\([\s\d]*\)|\b)/i', 'INTEGER', $s ); |
| 576 | + $s = preg_replace( '/\b(tiny|small|medium|big|)int(\s*\([\s\d]*\)|\b)/i', 'INTEGER', $s ); |
577 | 577 | // varchar -> TEXT |
578 | | - $s = preg_replace( '/\bvarchar\(\d+\)/i', 'TEXT', $s ); |
| 578 | + $s = preg_replace( '/\b(var)?char\s*\(.*?\)/i', 'TEXT', $s ); |
579 | 579 | // TEXT normalization |
580 | 580 | $s = preg_replace( '/\b(tiny|medium|long)text\b/i', 'TEXT', $s ); |
581 | 581 | // BLOB normalization |