r71136 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71135‎ | r71136 | r71137 >
Date:18:13, 15 August 2010
Author:demon
Status:ok (Comments)
Tags:
Comment:
Some general update refactoring:
* Drop version keys. Don't really serve a purpose
* Don't use updatelog to determine if an update should be run, let the update check itself (this was the old behavior)
* Still record updates as a single timestamped array (could be useful)
Modified paths:
  • /trunk/phase3/includes/installer/DatabaseUpdater.php (modified) (history)
  • /trunk/phase3/includes/installer/MysqlUpdater.php (modified) (history)
  • /trunk/phase3/includes/installer/SqliteUpdater.php (modified) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/updaters.inc
@@ -936,14 +936,12 @@
937937
938938 wfRunHooks( 'LoadExtensionSchemaUpdates' );
939939
940 - $doUser = $shared ? $wgSharedDB && in_array( 'user', $wgSharedTables ) : !$wgSharedDB || !in_array( 'user', $wgSharedTables );
941 -
942940 if ( $wgDBtype === 'postgres' ) {
943941 do_postgres_updates();
944942 return;
945943 }
946944
947 - $up = DatabaseUpdater::newForDb( $wgDatabase );
 945+ $up = DatabaseUpdater::newForDb( $wgDatabase, $shared );
948946 $up->doUpdates();
949947
950948 wfOut( "Deleting old default messages (this may take a long time!)..." );
Index: trunk/phase3/includes/installer/DatabaseUpdater.php
@@ -18,73 +18,44 @@
1919
2020 protected $db;
2121
22 - protected function __construct( $db ) {
 22+ protected $shared = false;
 23+
 24+ protected function __construct( $db, $shared ) {
2325 $this->db = $db;
 26+ $this->shared = $shared;
2427 }
2528
26 - public static function newForDB( $db ) {
 29+ public static function newForDB( $db, $shared ) {
2730 switch( $db->getType() ) {
2831 case 'mysql':
29 - return new MysqlUpdater( $db );
 32+ return new MysqlUpdater( $db, $shared );
3033 case 'sqlite':
31 - return new SqliteUpdater( $db );
 34+ return new SqliteUpdater( $db, $shared );
3235 case 'oracle':
33 - return new OracleUpdater( $db );
 36+ return new OracleUpdater( $db, $shared );
3437 default:
3538 throw new MWException( __METHOD__ . ' called for unsupported $wgDBtype' );
3639 }
3740 }
3841
39 - public function doUpdates() {
40 - global $IP;
 42+ public function doUpdates( $doUser = false ) {
 43+ global $IP, $wgVersion;
4144 require_once( "$IP/maintenance/updaters.inc" );
42 - $this->loadUpdates();
43 - foreach ( $this->updates as $version => $updates ) {
44 - foreach( $updates as $params ) {
45 - $func = array_shift( $params );
46 - call_user_func_array( $func, $params );
47 - flush();
48 - }
49 - // some updates don't get recorded :(
50 - if( $version !== 'always' ) {
51 - $this->setAppliedUpdates( $version, $updates );
52 - }
 45+ $this->updates = array_merge( $this->getCoreUpdateList(),
 46+ $this->getOldGlobalUpdates( $doUser ) );
 47+ foreach ( $this->updates as $params ) {
 48+ $func = array_shift( $params );
 49+ call_user_func_array( $func, $params );
 50+ flush();
5351 }
 52+ $this->setAppliedUpdates( $wgVersion, $this->updates );
5453 }
5554
56 - protected function loadUpdates() {
57 - // If the updatelog table hasn't been upgraded, we can't use the new
58 - // style of recording our steps. Run all to be safe
59 - if( !$this->canUseNewUpdatelog() ) {
60 - $this->updates = $this->getCoreUpdateList();
61 - } else {
62 - foreach( $this->getCoreUpdateList() as $version => $updates ) {
63 - $appliedUpdates = $this->getAppliedUpdates( $version );
64 - if( !$appliedUpdates || $appliedUpdates != $updates ) {
65 - $this->updates[ $version ] = $updates;
66 - }
67 - }
68 - }
69 - $this->getOldGlobalUpdates();
70 - }
71 -
72 - protected function getAppliedUpdates( $version ) {
73 - $key = "updatelist-$version";
74 - $val = $this->db->selectField( 'updatelog', 'ul_value',
75 - array( 'ul_key' => $key ), __METHOD__ );
76 - if( !$val ) {
77 - return null;
78 - } else {
79 - return unserialize( $val );
80 - }
81 - }
82 -
8355 protected function setAppliedUpdates( $version, $updates = array() ) {
8456 if( !$this->canUseNewUpdatelog() ) {
8557 return;
8658 }
87 - $key = "updatelist-$version";
88 - $this->db->delete( 'updatelog', array( 'ul_key' => $key ), __METHOD__ );
 59+ $key = "updatelist-$version-" . time();
8960 $this->db->insert( 'updatelog',
9061 array( 'ul_key' => $key, 'ul_value' => serialize( $updates ) ),
9162 __METHOD__ );
@@ -111,25 +82,31 @@
11283 * version these like we do with our core updates, so they have to go
11384 * in 'always'
11485 */
115 - private function getOldGlobalUpdates() {
 86+ private function getOldGlobalUpdates( $douser ) {
11687 global $wgUpdates, $wgExtNewFields, $wgExtNewTables,
117 - $wgExtModifiedFields, $wgExtNewIndexes;
 88+ $wgExtModifiedFields, $wgExtNewIndexes, $wgSharedDB, $wgSharedTables;
11889
 90+ $doUser = $this->shared ?
 91+ $wgSharedDB && in_array( 'user', $wgSharedTables ) :
 92+ !$wgSharedDB || !in_array( 'user', $wgSharedTables );
 93+
 94+ $updates = array();
 95+
11996 if( isset( $wgUpdates[ $this->db->getType() ] ) ) {
12097 foreach( $wgUpdates[ $this->db->getType() ] as $upd ) {
121 - $this->updates['always'][] = $upd;
 98+ $updates[] = $upd;
12299 }
123100 }
124101
125102 foreach ( $wgExtNewTables as $tableRecord ) {
126 - $this->updates['always'][] = array(
 103+ $updates[] = array(
127104 'add_table', $tableRecord[0], $tableRecord[1], true
128105 );
129106 }
130107
131108 foreach ( $wgExtNewFields as $fieldRecord ) {
132109 if ( $fieldRecord[0] != 'user' || $doUser ) {
133 - $this->updates['always'][] = array(
 110+ $updates[] = array(
134111 'add_field', $fieldRecord[0], $fieldRecord[1],
135112 $fieldRecord[2], true
136113 );
@@ -137,18 +114,20 @@
138115 }
139116
140117 foreach ( $wgExtNewIndexes as $fieldRecord ) {
141 - $this->updates['always'][] = array(
 118+ $updates[] = array(
142119 'add_index', $fieldRecord[0], $fieldRecord[1],
143120 $fieldRecord[2], true
144121 );
145122 }
146123
147124 foreach ( $wgExtModifiedFields as $fieldRecord ) {
148 - $this->updates['always'][] = array(
 125+ $updates[] = array(
149126 'modify_field', $fieldRecord[0], $fieldRecord[1],
150127 $fieldRecord[2], true
151128 );
152129 }
 130+
 131+ return $updates;
153132 }
154133
155134 /**
Index: trunk/phase3/includes/installer/MysqlUpdater.php
@@ -10,157 +10,156 @@
1111
1212 protected function getCoreUpdateList() {
1313 return array(
14 - '1.2' => array(
15 - array( 'add_field', 'ipblocks', 'ipb_id', 'patch-ipblocks.sql' ),
16 - array( 'add_field', 'ipblocks', 'ipb_expiry', 'patch-ipb_expiry.sql' ),
17 - array( 'do_interwiki_update' ),
18 - array( 'do_index_update' ),
19 - array( 'add_table', 'hitcounter', 'patch-hitcounter.sql' ),
20 - array( 'add_field', 'recentchanges', 'rc_type', 'patch-rc_type.sql' ),
21 - ),
22 - '1.3' => array(
23 - array( 'add_field', 'user', 'user_real_name', 'patch-user-realname.sql' ),
24 - array( 'add_table', 'querycache', 'patch-querycache.sql' ),
25 - array( 'add_table', 'objectcache', 'patch-objectcache.sql' ),
26 - array( 'add_table', 'categorylinks', 'patch-categorylinks.sql' ),
27 - array( 'do_old_links_update' ),
28 - array( 'fix_ancient_imagelinks' ),
29 - array( 'add_field', 'recentchanges', 'rc_ip', 'patch-rc_ip.sql' ),
30 - ),
31 - '1.4' => array(
32 - array( 'do_image_name_unique_update' ),
33 - array( 'add_field', 'recentchanges', 'rc_id', 'patch-rc_id.sql' ),
34 - array( 'add_field', 'recentchanges', 'rc_patrolled', 'patch-rc-patrol.sql' ),
35 - array( 'add_table', 'logging', 'patch-logging.sql' ),
36 - array( 'add_field', 'user', 'user_token', 'patch-user_token.sql' ),
37 - array( 'do_watchlist_update' ),
38 - array( 'do_user_update' ),
39 - ),
40 - '1.5' => array(
41 - array( 'do_schema_restructuring' ),
42 - array( 'add_field', 'logging', 'log_params', 'patch-log_params.sql' ),
43 - array( 'check_bin', 'logging', 'log_title', 'patch-logging-title.sql', ),
44 - array( 'add_field', 'archive', 'ar_rev_id', 'patch-archive-rev_id.sql' ),
45 - array( 'add_field', 'page', 'page_len', 'patch-page_len.sql' ),
46 - array( 'do_inverse_timestamp' ),
47 - array( 'do_text_id' ),
48 - array( 'add_field', 'revision', 'rev_deleted', 'patch-rev_deleted.sql' ),
49 - array( 'add_field', 'image', 'img_width', 'patch-img_width.sql' ),
50 - array( 'add_field', 'image', 'img_metadata', 'patch-img_metadata.sql' ),
51 - array( 'add_field', 'user', 'user_email_token', 'patch-user_email_token.sql' ),
52 - array( 'add_field', 'archive', 'ar_text_id', 'patch-archive-text_id.sql' ),
53 - array( 'do_namespace_size' ),
54 - array( 'add_field', 'image', 'img_media_type', 'patch-img_media_type.sql' ),
55 - array( 'do_pagelinks_update' ),
56 - array( 'do_drop_img_type' ),
57 - array( 'do_user_unique_update' ),
58 - array( 'do_user_groups_update' ),
59 - array( 'add_field', 'site_stats', 'ss_total_pages', 'patch-ss_total_articles.sql' ),
60 - array( 'add_table', 'user_newtalk', 'patch-usernewtalk2.sql' ),
61 - array( 'add_table', 'transcache', 'patch-transcache.sql' ),
62 - array( 'add_field', 'interwiki', 'iw_trans', 'patch-interwiki-trans.sql' ),
63 - array( 'add_table', 'trackbacks', 'patch-trackbacks.sql' ),
64 - ),
65 - '1.6' => array(
66 - array( 'do_watchlist_null' ),
67 - array( 'do_logging_timestamp_index' ),
68 - array( 'add_field', 'ipblocks', 'ipb_range_start', 'patch-ipb_range_start.sql' ),
69 - array( 'do_page_random_update' ),
70 - array( 'add_field', 'user', 'user_registration', 'patch-user_registration.sql' ),
71 - array( 'do_templatelinks_update' ),
72 - array( 'add_table', 'externallinks', 'patch-externallinks.sql' ),
73 - array( 'add_table', 'job', 'patch-job.sql' ),
74 - array( 'add_field', 'site_stats', 'ss_images', 'patch-ss_images.sql' ),
75 - array( 'add_table', 'langlinks', 'patch-langlinks.sql' ),
76 - array( 'add_table', 'querycache_info', 'patch-querycacheinfo.sql' ),
77 - array( 'add_table', 'filearchive', 'patch-filearchive.sql' ),
78 - array( 'add_field', 'ipblocks', 'ipb_anon_only', 'patch-ipb_anon_only.sql' ),
79 - array( 'do_rc_indices_update' ),
80 - ),
81 - '1.9' => array(
82 - array( 'add_field', 'user', 'user_newpass_time', 'patch-user_newpass_time.sql' ),
83 - array( 'add_table', 'redirect', 'patch-redirect.sql' ),
84 - array( 'add_table', 'querycachetwo', 'patch-querycachetwo.sql' ),
85 - array( 'add_field', 'ipblocks', 'ipb_enable_autoblock', 'patch-ipb_optional_autoblock.sql' ),
86 - array( 'do_backlinking_indices_update' ),
87 - array( 'add_field', 'recentchanges', 'rc_old_len', 'patch-rc_len.sql' ),
88 - array( 'add_field', 'user', 'user_editcount', 'patch-user_editcount.sql' ),
89 - ),
90 - '1.10' => array(
91 - array( 'do_restrictions_update' ),
92 - array( 'add_field', 'logging', 'log_id', 'patch-log_id.sql' ),
93 - array( 'add_field', 'revision', 'rev_parent_id', 'patch-rev_parent_id.sql' ),
94 - array( 'add_field', 'page_restrictions', 'pr_id', 'patch-page_restrictions_sortkey.sql' ),
95 - array( 'add_field', 'revision', 'rev_len', 'patch-rev_len.sql' ),
96 - array( 'add_field', 'recentchanges', 'rc_deleted', 'patch-rc_deleted.sql' ),
97 - array( 'add_field', 'logging', 'log_deleted', 'patch-log_deleted.sql' ),
98 - array( 'add_field', 'archive', 'ar_deleted', 'patch-ar_deleted.sql' ),
99 - array( 'add_field', 'ipblocks', 'ipb_deleted', 'patch-ipb_deleted.sql' ),
100 - array( 'add_field', 'filearchive', 'fa_deleted', 'patch-fa_deleted.sql' ),
101 - array( 'add_field', 'archive', 'ar_len', 'patch-ar_len.sql' ),
102 - ),
103 - '1.11' => array(
104 - array( 'add_field', 'ipblocks', 'ipb_block_email', 'patch-ipb_emailban.sql' ),
105 - array( 'do_categorylinks_indices_update' ),
106 - array( 'add_field', 'oldimage', 'oi_metadata', 'patch-oi_metadata.sql' ),
107 - array( 'do_archive_user_index' ),
108 - array( 'do_image_user_index' ),
109 - array( 'do_oldimage_user_index' ),
110 - array( 'add_field', 'archive', 'ar_page_id', 'patch-archive-page_id.sql' ),
111 - array( 'add_field', 'image', 'img_sha1', 'patch-img_sha1.sql' ),
112 - ),
113 - '1.12' => array(
114 - array( 'add_table', 'protected_titles', 'patch-protected_titles.sql' ),
115 - ),
116 - '1.13' => array(
117 - array( 'add_field', 'ipblocks', 'ipb_by_text', 'patch-ipb_by_text.sql' ),
118 - array( 'add_table', 'page_props', 'patch-page_props.sql' ),
119 - array( 'add_table', 'updatelog', 'patch-updatelog.sql' ),
120 - array( 'add_table', 'category', 'patch-category.sql' ),
121 - array( 'do_category_population' ),
122 - array( 'add_field', 'archive', 'ar_parent_id', 'patch-ar_parent_id.sql' ),
123 - array( 'add_field', 'user_newtalk', 'user_last_timestamp', 'patch-user_last_timestamp.sql' ),
124 - array( 'do_populate_parent_id' ),
125 - array( 'check_bin', 'protected_titles', 'pt_title', 'patch-pt_title-encoding.sql', ),
126 - array( 'maybe_do_profiling_memory_update' ),
127 - array( 'do_filearchive_indices_update' ),
128 - ),
129 - '1.14' => array(
130 - array( 'add_field', 'site_stats', 'ss_active_users', 'patch-ss_active_users.sql' ),
131 - array( 'do_active_users_init' ),
132 - array( 'add_field', 'ipblocks', 'ipb_allow_usertalk', 'patch-ipb_allow_usertalk.sql' ),
133 - ),
134 - '1.15' => array(
135 - array( 'do_unique_pl_tl_il' ),
136 - array( 'add_table', 'change_tag', 'patch-change_tag.sql' ),
137 - array( 'add_table', 'tag_summary', 'patch-change_tag.sql' ),
138 - array( 'add_table', 'valid_tag', 'patch-change_tag.sql' ),
139 - ),
140 - '1.16' => array(
141 - array( 'add_table', 'user_properties', 'patch-user_properties.sql' ),
142 - array( 'add_table', 'log_search', 'patch-log_search.sql' ),
143 - array( 'do_log_search_population' ),
144 - array( 'add_field', 'logging', 'log_user_text', 'patch-log_user_text.sql' ),
145 - array( 'add_table', 'l10n_cache', 'patch-l10n_cache.sql' ),
146 - array( 'add_table', 'external_user', 'patch-external_user.sql' ),
147 - array( 'add_index', 'log_search', 'ls_field_val', 'patch-log_search-rename-index.sql' ),
148 - array( 'add_index', 'change_tag', 'change_tag_rc_tag', 'patch-change_tag-indexes.sql' ),
149 - array( 'add_field', 'redirect', 'rd_interwiki', 'patch-rd_interwiki.sql' ),
150 - array( 'do_update_transcache_field' ),
151 - array( 'rename_eu_wiki_id' ),
152 - array( 'do_update_mime_minor_field' ),
153 - array( 'do_populate_rev_len' ),
154 - ),
155 - '1.17' => array(
156 - array( 'add_table', 'iwlinks', 'patch-iwlinks.sql' ),
157 - array( 'add_index', 'iwlinks', 'iwl_prefix_title_from', 'patch-rename-iwl_prefix.sql' ),
158 - array( 'add_field', 'updatelog', 'ul_value', 'patch-ul_value.sql' ),
159 - array( 'add_field', 'interwiki', 'iw_api', 'patch-iw_api_and_wikiid.sql' ),
160 - array( 'drop_index_if_exists', 'iwlinks', 'iwl_prefix', 'patch-kill-iwl_prefix.sql' ),
161 - array( 'drop_index_if_exists', 'iwlinks', 'iwl_prefix_from_title', 'patch-kill-iwl_pft.sql' ),
162 - array( 'add_field', 'categorylinks', 'cl_collation', 'patch-categorylinks-better-collation.sql' ),
163 - array( 'do_collation_update' ),
164 - ),
 14+ // 1.2
 15+ array( 'add_field', 'ipblocks', 'ipb_id', 'patch-ipblocks.sql' ),
 16+ array( 'add_field', 'ipblocks', 'ipb_expiry', 'patch-ipb_expiry.sql' ),
 17+ array( 'do_interwiki_update' ),
 18+ array( 'do_index_update' ),
 19+ array( 'add_table', 'hitcounter', 'patch-hitcounter.sql' ),
 20+ array( 'add_field', 'recentchanges', 'rc_type', 'patch-rc_type.sql' ),
 21+
 22+ // 1.3
 23+ array( 'add_field', 'user', 'user_real_name', 'patch-user-realname.sql' ),
 24+ array( 'add_table', 'querycache', 'patch-querycache.sql' ),
 25+ array( 'add_table', 'objectcache', 'patch-objectcache.sql' ),
 26+ array( 'add_table', 'categorylinks', 'patch-categorylinks.sql' ),
 27+ array( 'do_old_links_update' ),
 28+ array( 'fix_ancient_imagelinks' ),
 29+ array( 'add_field', 'recentchanges', 'rc_ip', 'patch-rc_ip.sql' ),
 30+
 31+ // 1.4
 32+ array( 'do_image_name_unique_update' ),
 33+ array( 'add_field', 'recentchanges', 'rc_id', 'patch-rc_id.sql' ),
 34+ array( 'add_field', 'recentchanges', 'rc_patrolled', 'patch-rc-patrol.sql' ),
 35+ array( 'add_table', 'logging', 'patch-logging.sql' ),
 36+ array( 'add_field', 'user', 'user_token', 'patch-user_token.sql' ),
 37+ array( 'do_watchlist_update' ),
 38+ array( 'do_user_update' ),
 39+
 40+ // 1.5
 41+ array( 'do_schema_restructuring' ),
 42+ array( 'add_field', 'logging', 'log_params', 'patch-log_params.sql' ),
 43+ array( 'check_bin', 'logging', 'log_title', 'patch-logging-title.sql', ),
 44+ array( 'add_field', 'archive', 'ar_rev_id', 'patch-archive-rev_id.sql' ),
 45+ array( 'add_field', 'page', 'page_len', 'patch-page_len.sql' ),
 46+ array( 'do_inverse_timestamp' ),
 47+ array( 'do_text_id' ),
 48+ array( 'add_field', 'revision', 'rev_deleted', 'patch-rev_deleted.sql' ),
 49+ array( 'add_field', 'image', 'img_width', 'patch-img_width.sql' ),
 50+ array( 'add_field', 'image', 'img_metadata', 'patch-img_metadata.sql' ),
 51+ array( 'add_field', 'user', 'user_email_token', 'patch-user_email_token.sql' ),
 52+ array( 'add_field', 'archive', 'ar_text_id', 'patch-archive-text_id.sql' ),
 53+ array( 'do_namespace_size' ),
 54+ array( 'add_field', 'image', 'img_media_type', 'patch-img_media_type.sql' ),
 55+ array( 'do_pagelinks_update' ),
 56+ array( 'do_drop_img_type' ),
 57+ array( 'do_user_unique_update' ),
 58+ array( 'do_user_groups_update' ),
 59+ array( 'add_field', 'site_stats', 'ss_total_pages', 'patch-ss_total_articles.sql' ),
 60+ array( 'add_table', 'user_newtalk', 'patch-usernewtalk2.sql' ),
 61+ array( 'add_table', 'transcache', 'patch-transcache.sql' ),
 62+ array( 'add_field', 'interwiki', 'iw_trans', 'patch-interwiki-trans.sql' ),
 63+ array( 'add_table', 'trackbacks', 'patch-trackbacks.sql' ),
 64+
 65+ // 1.6
 66+ array( 'do_watchlist_null' ),
 67+ array( 'do_logging_timestamp_index' ),
 68+ array( 'add_field', 'ipblocks', 'ipb_range_start', 'patch-ipb_range_start.sql' ),
 69+ array( 'do_page_random_update' ),
 70+ array( 'add_field', 'user', 'user_registration', 'patch-user_registration.sql' ),
 71+ array( 'do_templatelinks_update' ),
 72+ array( 'add_table', 'externallinks', 'patch-externallinks.sql' ),
 73+ array( 'add_table', 'job', 'patch-job.sql' ),
 74+ array( 'add_field', 'site_stats', 'ss_images', 'patch-ss_images.sql' ),
 75+ array( 'add_table', 'langlinks', 'patch-langlinks.sql' ),
 76+ array( 'add_table', 'querycache_info', 'patch-querycacheinfo.sql' ),
 77+ array( 'add_table', 'filearchive', 'patch-filearchive.sql' ),
 78+ array( 'add_field', 'ipblocks', 'ipb_anon_only', 'patch-ipb_anon_only.sql' ),
 79+ array( 'do_rc_indices_update' ),
 80+
 81+ // 1.9
 82+ array( 'add_field', 'user', 'user_newpass_time', 'patch-user_newpass_time.sql' ),
 83+ array( 'add_table', 'redirect', 'patch-redirect.sql' ),
 84+ array( 'add_table', 'querycachetwo', 'patch-querycachetwo.sql' ),
 85+ array( 'add_field', 'ipblocks', 'ipb_enable_autoblock', 'patch-ipb_optional_autoblock.sql' ),
 86+ array( 'do_backlinking_indices_update' ),
 87+ array( 'add_field', 'recentchanges', 'rc_old_len', 'patch-rc_len.sql' ),
 88+ array( 'add_field', 'user', 'user_editcount', 'patch-user_editcount.sql' ),
 89+
 90+ // 1.10
 91+ array( 'do_restrictions_update' ),
 92+ array( 'add_field', 'logging', 'log_id', 'patch-log_id.sql' ),
 93+ array( 'add_field', 'revision', 'rev_parent_id', 'patch-rev_parent_id.sql' ),
 94+ array( 'add_field', 'page_restrictions', 'pr_id', 'patch-page_restrictions_sortkey.sql' ),
 95+ array( 'add_field', 'revision', 'rev_len', 'patch-rev_len.sql' ),
 96+ array( 'add_field', 'recentchanges', 'rc_deleted', 'patch-rc_deleted.sql' ),
 97+ array( 'add_field', 'logging', 'log_deleted', 'patch-log_deleted.sql' ),
 98+ array( 'add_field', 'archive', 'ar_deleted', 'patch-ar_deleted.sql' ),
 99+ array( 'add_field', 'ipblocks', 'ipb_deleted', 'patch-ipb_deleted.sql' ),
 100+ array( 'add_field', 'filearchive', 'fa_deleted', 'patch-fa_deleted.sql' ),
 101+ array( 'add_field', 'archive', 'ar_len', 'patch-ar_len.sql' ),
 102+
 103+ // 1.11
 104+ array( 'add_field', 'ipblocks', 'ipb_block_email', 'patch-ipb_emailban.sql' ),
 105+ array( 'do_categorylinks_indices_update' ),
 106+ array( 'add_field', 'oldimage', 'oi_metadata', 'patch-oi_metadata.sql' ),
 107+ array( 'do_archive_user_index' ),
 108+ array( 'do_image_user_index' ),
 109+ array( 'do_oldimage_user_index' ),
 110+ array( 'add_field', 'archive', 'ar_page_id', 'patch-archive-page_id.sql' ),
 111+ array( 'add_field', 'image', 'img_sha1', 'patch-img_sha1.sql' ),
 112+
 113+ // 1.12
 114+ array( 'add_table', 'protected_titles', 'patch-protected_titles.sql' ),
 115+
 116+ // 1.13
 117+ array( 'add_field', 'ipblocks', 'ipb_by_text', 'patch-ipb_by_text.sql' ),
 118+ array( 'add_table', 'page_props', 'patch-page_props.sql' ),
 119+ array( 'add_table', 'updatelog', 'patch-updatelog.sql' ),
 120+ array( 'add_table', 'category', 'patch-category.sql' ),
 121+ array( 'do_category_population' ),
 122+ array( 'add_field', 'archive', 'ar_parent_id', 'patch-ar_parent_id.sql' ),
 123+ array( 'add_field', 'user_newtalk', 'user_last_timestamp', 'patch-user_last_timestamp.sql' ),
 124+ array( 'do_populate_parent_id' ),
 125+ array( 'check_bin', 'protected_titles', 'pt_title', 'patch-pt_title-encoding.sql', ),
 126+ array( 'maybe_do_profiling_memory_update' ),
 127+ array( 'do_filearchive_indices_update' ),
 128+
 129+ // 1.14
 130+ array( 'add_field', 'site_stats', 'ss_active_users', 'patch-ss_active_users.sql' ),
 131+ array( 'do_active_users_init' ),
 132+ array( 'add_field', 'ipblocks', 'ipb_allow_usertalk', 'patch-ipb_allow_usertalk.sql' ),
 133+
 134+ // 1.15
 135+ array( 'do_unique_pl_tl_il' ),
 136+ array( 'add_table', 'change_tag', 'patch-change_tag.sql' ),
 137+ array( 'add_table', 'tag_summary', 'patch-change_tag.sql' ),
 138+ array( 'add_table', 'valid_tag', 'patch-change_tag.sql' ),
 139+
 140+ // 1.16
 141+ array( 'add_table', 'user_properties', 'patch-user_properties.sql' ),
 142+ array( 'add_table', 'log_search', 'patch-log_search.sql' ),
 143+ array( 'do_log_search_population' ),
 144+ array( 'add_field', 'logging', 'log_user_text', 'patch-log_user_text.sql' ),
 145+ array( 'add_table', 'l10n_cache', 'patch-l10n_cache.sql' ),
 146+ array( 'add_table', 'external_user', 'patch-external_user.sql' ),
 147+ array( 'add_index', 'log_search', 'ls_field_val', 'patch-log_search-rename-index.sql' ),
 148+ array( 'add_index', 'change_tag', 'change_tag_rc_tag', 'patch-change_tag-indexes.sql' ),
 149+ array( 'add_field', 'redirect', 'rd_interwiki', 'patch-rd_interwiki.sql' ),
 150+ array( 'do_update_transcache_field' ),
 151+ array( 'rename_eu_wiki_id' ),
 152+ array( 'do_update_mime_minor_field' ),
 153+ array( 'do_populate_rev_len' ),
 154+
 155+ // 1.17
 156+ array( 'add_table', 'iwlinks', 'patch-iwlinks.sql' ),
 157+ array( 'add_index', 'iwlinks', 'iwl_prefix_title_from', 'patch-rename-iwl_prefix.sql' ),
 158+ array( 'add_field', 'updatelog', 'ul_value', 'patch-ul_value.sql' ),
 159+ array( 'add_field', 'interwiki', 'iw_api', 'patch-iw_api_and_wikiid.sql' ),
 160+ array( 'drop_index_if_exists', 'iwlinks', 'iwl_prefix', 'patch-kill-iwl_prefix.sql' ),
 161+ array( 'drop_index_if_exists', 'iwlinks', 'iwl_prefix_from_title', 'patch-kill-iwl_pft.sql' ),
 162+ array( 'add_field', 'categorylinks', 'cl_collation', 'patch-categorylinks-better-collation.sql' ),
 163+ array( 'do_collation_update' ),
165164 );
166165 }
167166 }
Index: trunk/phase3/includes/installer/SqliteUpdater.php
@@ -10,38 +10,37 @@
1111
1212 protected function getCoreUpdateList() {
1313 return array(
14 - '1.14' => array(
15 - array( 'add_field', 'site_stats', 'ss_active_users', 'patch-ss_active_users.sql' ),
16 - array( 'do_active_users_init' ),
17 - array( 'add_field', 'ipblocks', 'ipb_allow_usertalk', 'patch-ipb_allow_usertalk.sql' ),
18 - array( 'sqlite_initial_indexes' ),
19 - ),
20 - '1.15' => array(
21 - array( 'add_table', 'change_tag', 'patch-change_tag.sql' ),
22 - array( 'add_table', 'tag_summary', 'patch-change_tag.sql' ),
23 - array( 'add_table', 'valid_tag', 'patch-change_tag.sql' ),
24 - ),
25 - '1.16' => array(
26 - array( 'add_table', 'user_properties', 'patch-user_properties.sql' ),
27 - array( 'add_table', 'log_search', 'patch-log_search.sql' ),
28 - array( 'do_log_search_population' ),
29 - array( 'add_field', 'logging', 'log_user_text', 'patch-log_user_text.sql' ),
30 - array( 'add_table', 'l10n_cache', 'patch-l10n_cache.sql' ),
31 - array( 'add_table', 'external_user', 'patch-external_user.sql' ),
32 - array( 'add_index', 'log_search', 'ls_field_val', 'patch-log_search-rename-index.sql' ),
33 - array( 'add_index', 'change_tag', 'change_tag_rc_tag', 'patch-change_tag-indexes.sql' ),
34 - array( 'add_field', 'redirect', 'rd_interwiki', 'patch-rd_interwiki.sql' ),
35 - array( 'do_update_transcache_field' ),
36 - array( 'sqlite_setup_searchindex' ),
37 - ),
38 - '1.17' => array(
39 - array( 'add_table', 'iwlinks', 'patch-iwlinks.sql' ),
40 - array( 'add_index', 'iwlinks', 'iwl_prefix_title_from', 'patch-rename-iwl_prefix.sql' ),
41 - array( 'add_field', 'updatelog', 'ul_value', 'patch-ul_value.sql' ),
42 - array( 'add_field', 'interwiki', 'iw_api', 'patch-iw_api_and_wikiid.sql' ),
43 - array( 'drop_index_if_exists', 'iwlinks', 'iwl_prefix', 'patch-kill-iwl_prefix.sql' ),
44 - array( 'drop_index_if_exists', 'iwlinks', 'iwl_prefix_from_title', 'patch-kill-iwl_pft.sql' ),
45 - ),
 14+ // 1.14
 15+ array( 'add_field', 'site_stats', 'ss_active_users', 'patch-ss_active_users.sql' ),
 16+ array( 'do_active_users_init' ),
 17+ array( 'add_field', 'ipblocks', 'ipb_allow_usertalk', 'patch-ipb_allow_usertalk.sql' ),
 18+ array( 'sqlite_initial_indexes' ),
 19+
 20+ // 1.15
 21+ array( 'add_table', 'change_tag', 'patch-change_tag.sql' ),
 22+ array( 'add_table', 'tag_summary', 'patch-change_tag.sql' ),
 23+ array( 'add_table', 'valid_tag', 'patch-change_tag.sql' ),
 24+
 25+ // 1.16
 26+ array( 'add_table', 'user_properties', 'patch-user_properties.sql' ),
 27+ array( 'add_table', 'log_search', 'patch-log_search.sql' ),
 28+ array( 'do_log_search_population' ),
 29+ array( 'add_field', 'logging', 'log_user_text', 'patch-log_user_text.sql' ),
 30+ array( 'add_table', 'l10n_cache', 'patch-l10n_cache.sql' ),
 31+ array( 'add_table', 'external_user', 'patch-external_user.sql' ),
 32+ array( 'add_index', 'log_search', 'ls_field_val', 'patch-log_search-rename-index.sql' ),
 33+ array( 'add_index', 'change_tag', 'change_tag_rc_tag', 'patch-change_tag-indexes.sql' ),
 34+ array( 'add_field', 'redirect', 'rd_interwiki', 'patch-rd_interwiki.sql' ),
 35+ array( 'do_update_transcache_field' ),
 36+ array( 'sqlite_setup_searchindex' ),
 37+
 38+ // 1.17
 39+ array( 'add_table', 'iwlinks', 'patch-iwlinks.sql' ),
 40+ array( 'add_index', 'iwlinks', 'iwl_prefix_title_from', 'patch-rename-iwl_prefix.sql' ),
 41+ array( 'add_field', 'updatelog', 'ul_value', 'patch-ul_value.sql' ),
 42+ array( 'add_field', 'interwiki', 'iw_api', 'patch-iw_api_and_wikiid.sql' ),
 43+ array( 'drop_index_if_exists', 'iwlinks', 'iwl_prefix', 'patch-kill-iwl_prefix.sql' ),
 44+ array( 'drop_index_if_exists', 'iwlinks', 'iwl_prefix_from_title', 'patch-kill-iwl_pft.sql' ),
4645 );
4746 }
4847 }

Comments

#Comment by Catrope (talk | contribs)   14:31, 12 December 2010
+	private function getOldGlobalUpdates( $douser ) {
[...]
+		$doUser = $this->shared ?
+			$wgSharedDB && in_array( 'user', $wgSharedTables ) :
+			!$wgSharedDB || !in_array( 'user', $wgSharedTables );
+

So $douser is ignored because of a typo, and even if the typo was fixed it'd still be overwritten. WTF?

#Comment by Catrope (talk | contribs)   14:32, 12 December 2010

Spoke too soon, was fixed in r71138.

Status & tagging log