Index: trunk/phase3/includes/Image.php |
— | — | @@ -321,7 +321,6 @@ |
322 | 322 | wfProfileIn( __METHOD__ ); |
323 | 323 | |
324 | 324 | $dbr = wfGetDB( DB_SLAVE ); |
325 | | - $this->checkDBSchema($dbr); |
326 | 325 | |
327 | 326 | $row = $dbr->selectRow( 'image', |
328 | 327 | array( 'img_size', 'img_width', 'img_height', 'img_bits', |
— | — | @@ -455,8 +454,6 @@ |
456 | 455 | $dbw = wfGetDB( DB_MASTER ); |
457 | 456 | } |
458 | 457 | |
459 | | - $this->checkDBSchema($dbw); |
460 | | - |
461 | 458 | list( $major, $minor ) = self::splitMime( $this->mime ); |
462 | 459 | |
463 | 460 | wfDebug(__METHOD__.': upgrading '.$this->name." to the current schema\n"); |
— | — | @@ -1122,38 +1119,6 @@ |
1123 | 1120 | } |
1124 | 1121 | |
1125 | 1122 | /** |
1126 | | - * Check the image table schema on the given connection for subtle problems |
1127 | | - */ |
1128 | | - function checkDBSchema(&$db) { |
1129 | | - static $checkDone = false; |
1130 | | - global $wgCheckDBSchema; |
1131 | | - if (!$wgCheckDBSchema || $checkDone) { |
1132 | | - return; |
1133 | | - } |
1134 | | - # img_name must be unique |
1135 | | - if ( !$db->indexUnique( 'image', 'img_name' ) && !$db->indexExists('image','PRIMARY') ) { |
1136 | | - throw new MWException( 'Database schema not up to date, please run maintenance/archives/patch-image_name_unique.sql' ); |
1137 | | - } |
1138 | | - $checkDone = true; |
1139 | | - |
1140 | | - # new fields must exist |
1141 | | - # |
1142 | | - # Not really, there's hundreds of checks like this that we could do and they're all pointless, because |
1143 | | - # if the fields are missing, the database will loudly report a query error, the first time you try to do |
1144 | | - # something. The only reason I put the above schema check in was because the absence of that particular |
1145 | | - # index would lead to an annoying subtle bug. No error message, just some very odd behaviour on duplicate |
1146 | | - # uploads. -- TS |
1147 | | - /* |
1148 | | - if ( !$db->fieldExists( 'image', 'img_media_type' ) |
1149 | | - || !$db->fieldExists( 'image', 'img_metadata' ) |
1150 | | - || !$db->fieldExists( 'image', 'img_width' ) ) { |
1151 | | - |
1152 | | - throw new MWException( 'Database schema not up to date, please run maintenance/update.php' ); |
1153 | | - } |
1154 | | - */ |
1155 | | - } |
1156 | | - |
1157 | | - /** |
1158 | 1123 | * Return the image history of this image, line by line. |
1159 | 1124 | * starts with current version, then old versions. |
1160 | 1125 | * uses $this->historyLine to check which line to return: |
— | — | @@ -1166,8 +1131,6 @@ |
1167 | 1132 | function nextHistoryLine() { |
1168 | 1133 | $dbr = wfGetDB( DB_SLAVE ); |
1169 | 1134 | |
1170 | | - $this->checkDBSchema($dbr); |
1171 | | - |
1172 | 1135 | if ( $this->historyLine == 0 ) {// called for the first time, return line from cur |
1173 | 1136 | $this->historyRes = $dbr->select( 'image', |
1174 | 1137 | array( |
— | — | @@ -1262,8 +1225,6 @@ |
1263 | 1226 | |
1264 | 1227 | $dbw = wfGetDB( DB_MASTER ); |
1265 | 1228 | |
1266 | | - $this->checkDBSchema($dbw); |
1267 | | - |
1268 | 1229 | // Delete thumbnails and refresh the metadata cache |
1269 | 1230 | $this->purgeCache(); |
1270 | 1231 | |