Index: trunk/phase3/maintenance/archives/patch-up_property.sql |
— | — | @@ -0,0 +1,4 @@ |
| 2 | +-- Increase the length of up_property from 32 -> 255 bytes. Bug 19408 |
| 3 | + |
| 4 | +ALTER TABLE /*_*/user_properties |
| 5 | + MODIFY up_property varbinary(255); |
Property changes on: trunk/phase3/maintenance/archives/patch-up_property.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 6 | + native |
Index: trunk/phase3/maintenance/tables.sql |
— | — | @@ -199,7 +199,7 @@ |
200 | 200 | up_user int NOT NULL, |
201 | 201 | |
202 | 202 | -- Name of the option being saved. This is indexed for bulk lookup. |
203 | | - up_property varbinary(32) NOT NULL, |
| 203 | + up_property varbinary(255) NOT NULL, |
204 | 204 | |
205 | 205 | -- Property value as a string. |
206 | 206 | up_value blob |
Index: trunk/phase3/includes/installer/DatabaseUpdater.php |
— | — | @@ -247,6 +247,7 @@ |
248 | 248 | * Helper function: check if the given key is present in the updatelog table. |
249 | 249 | * Obviously, only use this for updates that occur after the updatelog table was |
250 | 250 | * created! |
| 251 | + * @param $key String Name of the key to check for |
251 | 252 | */ |
252 | 253 | public function updateRowExists( $key ) { |
253 | 254 | $row = $this->db->selectRow( |
— | — | @@ -259,6 +260,21 @@ |
260 | 261 | } |
261 | 262 | |
262 | 263 | /** |
| 264 | + * Helper function: Add a key to the updatelog table |
| 265 | + * Obviously, only use this for updates that occur after the updatelog table was |
| 266 | + * created! |
| 267 | + * @param $key String Name of key to insert |
| 268 | + * @param $val String [optional] value to insert along with the key |
| 269 | + */ |
| 270 | + public function insertUpdateRow( $key, $val = null ) { |
| 271 | + $values = array( 'ul_key' => $key ); |
| 272 | + if( $val && $this->canUseNewUpdatelog() ) { |
| 273 | + $values['ul_value'] = $val; |
| 274 | + } |
| 275 | + $this->db->insert( 'updatelog', $values, __METHOD__, 'IGNORE' ); |
| 276 | + } |
| 277 | + |
| 278 | + /** |
263 | 279 | * Updatelog was changed in 1.17 to have a ul_value column so we can record |
264 | 280 | * more information about what kind of updates we've done (that's what this |
265 | 281 | * class does). Pre-1.17 wikis won't have this column, and really old wikis |
— | — | @@ -439,13 +455,17 @@ |
440 | 456 | * @param $fullpath Boolean: whether to treat $patch path as a relative or not |
441 | 457 | */ |
442 | 458 | public function modifyField( $table, $field, $patch, $fullpath = false ) { |
| 459 | + $updateKey = "$table-$field-$patch"; |
443 | 460 | if ( !$this->db->tableExists( $table ) ) { |
444 | 461 | $this->output( "...$table table does not exist, skipping modify field patch\n" ); |
445 | 462 | } elseif ( !$this->db->fieldExists( $table, $field ) ) { |
446 | 463 | $this->output( "...$field field does not exist in $table table, skipping modify field patch\n" ); |
| 464 | + } elseif( $this->updateRowExists( $updateKey ) ) { |
| 465 | + $this->output( "...$field in table $table already modified by patch $patch\n" ); |
447 | 466 | } else { |
448 | 467 | $this->output( "Modifying $field field of table $table..." ); |
449 | 468 | $this->applyPatch( $patch, $fullpath ); |
| 469 | + $this->insertUpdateRow( $updateKey ); |
450 | 470 | $this->output( "ok\n" ); |
451 | 471 | } |
452 | 472 | } |
Index: trunk/phase3/includes/installer/MysqlUpdater.php |
— | — | @@ -179,6 +179,7 @@ |
180 | 180 | // 1.18 |
181 | 181 | array( 'doUserNewTalkTimestampNotNull' ), |
182 | 182 | array( 'addIndex', 'user', 'user_email', 'patch-user_email_index.sql' ), |
| 183 | + array( 'modifyField', 'user_properties', 'up_property', 'patch-up_property.sql' ), |
183 | 184 | ); |
184 | 185 | } |
185 | 186 | |
Index: trunk/phase3/includes/installer/SqliteUpdater.php |
— | — | @@ -52,6 +52,9 @@ |
53 | 53 | array( 'doCollationUpdate' ), |
54 | 54 | array( 'addTable', 'msg_resource', 'patch-msg_resource.sql' ), |
55 | 55 | array( 'addTable', 'module_deps', 'patch-module_deps.sql' ), |
| 56 | + |
| 57 | + // 1.18 |
| 58 | + array( 'modifyField', 'user_properties', 'up_property', 'patch-up_property.sql' ), |
56 | 59 | ); |
57 | 60 | } |
58 | 61 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -255,6 +255,7 @@ |
256 | 256 | * (bug 28752) XCache doesn't work in CLI mode. |
257 | 257 | * (bug 28076) Thumbnail height limited to 360 pixels on Special:Listfiles |
258 | 258 | * (bug 22227) Special:Listfiles no longer throws an error on bogus file entries |
| 259 | +* (bug 19408) user_properties.up_property: 32 bytes is not enough. |
259 | 260 | |
260 | 261 | === API changes in 1.18 === |
261 | 262 | * (bug 26339) Throw warning when truncating an overlarge API result. |