Index: trunk/phase3/config/Installer.php |
— | — | @@ -1256,7 +1256,6 @@ |
1257 | 1257 | break; |
1258 | 1258 | } |
1259 | 1259 | } |
1260 | | - $wgDatabase->freeResult( $res ); |
1261 | 1260 | if ( !$found && $conf->DBengine != 'MyISAM' ) { |
1262 | 1261 | echo "<li><strong>Warning:</strong> " . htmlspecialchars( $conf->DBengine ) . |
1263 | 1262 | " storage engine not available, " . |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -2804,7 +2804,6 @@ |
2805 | 2805 | } |
2806 | 2806 | } |
2807 | 2807 | } |
2808 | | - $db->freeResult( $res ); |
2809 | 2808 | return $retVal; |
2810 | 2809 | } |
2811 | 2810 | |
— | — | @@ -3553,7 +3552,6 @@ |
3554 | 3553 | foreach ( $res as $row ) |
3555 | 3554 | // $data[] = Title::newFromText($wgContLang->getNSText ( NS_CATEGORY ).':'.$row->cl_to); |
3556 | 3555 | $data[$wgContLang->getNSText( NS_CATEGORY ) . ':' . $row->cl_to] = $this->getFullText(); |
3557 | | - $dbr->freeResult( $res ); |
3558 | 3556 | } else { |
3559 | 3557 | $data = array(); |
3560 | 3558 | } |
Index: trunk/phase3/includes/specials/SpecialWatchlist.php |
— | — | @@ -386,7 +386,6 @@ |
387 | 387 | } |
388 | 388 | $s .= $list->endRecentChangesList(); |
389 | 389 | |
390 | | - $dbr->freeResult( $res ); |
391 | 390 | $wgOut->addHTML( $s ); |
392 | 391 | } |
393 | 392 | |
— | — | @@ -478,7 +477,6 @@ |
479 | 478 | array( 'wl_user' => $user->mId ), 'wlCountItems' ); |
480 | 479 | $row = $dbr->fetchObject( $res ); |
481 | 480 | $count = $row->count; |
482 | | - $dbr->freeResult( $res ); |
483 | 481 | |
484 | 482 | # Halve to remove talk pages if needed |
485 | 483 | if( !$talk ) |
Index: trunk/phase3/includes/specials/SpecialDoubleRedirects.php |
— | — | @@ -85,7 +85,6 @@ |
86 | 86 | $res = $dbr->query( $sql, $fname ); |
87 | 87 | if ( $res ) { |
88 | 88 | $result = $dbr->fetchObject( $res ); |
89 | | - $dbr->freeResult( $res ); |
90 | 89 | } |
91 | 90 | } |
92 | 91 | if ( !$result ) { |
Index: trunk/phase3/includes/specials/SpecialNewimages.php |
— | — | @@ -67,7 +67,6 @@ |
68 | 68 | } else { |
69 | 69 | $ts = false; |
70 | 70 | } |
71 | | - $dbr->freeResult( $res ); |
72 | 71 | $sql = ''; |
73 | 72 | |
74 | 73 | # If we were clever, we'd use this to cache. |
— | — | @@ -125,7 +124,6 @@ |
126 | 125 | array_push( $images, $s ); |
127 | 126 | } |
128 | 127 | } |
129 | | - $dbr->freeResult( $res ); |
130 | 128 | |
131 | 129 | $gallery = new ImageGallery(); |
132 | 130 | $firstTimestamp = null; |
Index: trunk/phase3/includes/specials/SpecialAllmessages.php |
— | — | @@ -241,7 +241,6 @@ |
242 | 242 | $talkFlags[$s->page_title] = true; |
243 | 243 | } |
244 | 244 | } |
245 | | - $dbr->freeResult( $res ); |
246 | 245 | |
247 | 246 | wfProfileOut( __METHOD__ . '-db' ); |
248 | 247 | |
Index: trunk/phase3/includes/specials/SpecialDisambiguations.php |
— | — | @@ -67,8 +67,6 @@ |
68 | 68 | while ( $row = $dbr->fetchObject( $res ) ) { |
69 | 69 | $linkBatch->addObj( Title::makeTitle( NS_TEMPLATE, $row->pl_title )); |
70 | 70 | } |
71 | | - |
72 | | - $dbr->freeResult( $res ); |
73 | 71 | } |
74 | 72 | |
75 | 73 | $set = $linkBatch->constructSet( 'lb.tl', $dbr ); |
Index: trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php |
— | — | @@ -100,7 +100,6 @@ |
101 | 101 | if( $row !== false ) { |
102 | 102 | $hash = $row[0]; |
103 | 103 | } |
104 | | - $dbr->freeResult( $res ); |
105 | 104 | } |
106 | 105 | |
107 | 106 | # Create the input form |
Index: trunk/phase3/includes/specials/SpecialWhatlinkshere.php |
— | — | @@ -189,8 +189,6 @@ |
190 | 190 | $row->is_image = 0; |
191 | 191 | $rows[$row->page_id] = $row; |
192 | 192 | } |
193 | | - $dbr->freeResult( $plRes ); |
194 | | - |
195 | 193 | } |
196 | 194 | if( !$hidetrans ) { |
197 | 195 | while ( $row = $dbr->fetchObject( $tlRes ) ) { |
— | — | @@ -198,7 +196,6 @@ |
199 | 197 | $row->is_image = 0; |
200 | 198 | $rows[$row->page_id] = $row; |
201 | 199 | } |
202 | | - $dbr->freeResult( $tlRes ); |
203 | 200 | } |
204 | 201 | if( !$hideimages ) { |
205 | 202 | while ( $row = $dbr->fetchObject( $ilRes ) ) { |
— | — | @@ -206,7 +203,6 @@ |
207 | 204 | $row->is_image = 1; |
208 | 205 | $rows[$row->page_id] = $row; |
209 | 206 | } |
210 | | - $dbr->freeResult( $ilRes ); |
211 | 207 | } |
212 | 208 | |
213 | 209 | // Sort by key and then change the keys to 0-based indices |
Index: trunk/phase3/includes/specials/SpecialExport.php |
— | — | @@ -319,9 +319,6 @@ |
320 | 320 | |
321 | 321 | $pages[] = $n; |
322 | 322 | } |
323 | | - |
324 | | - $dbr->freeResult($res); |
325 | | - |
326 | 323 | return $pages; |
327 | 324 | } |
328 | 325 | |
— | — | @@ -349,9 +346,6 @@ |
350 | 347 | |
351 | 348 | $pages[] = $n; |
352 | 349 | } |
353 | | - |
354 | | - $dbr->freeResult( $res ); |
355 | | - |
356 | 350 | return $pages; |
357 | 351 | } |
358 | 352 | |
Index: trunk/phase3/includes/SquidUpdate.php |
— | — | @@ -46,7 +46,6 @@ |
47 | 47 | $blurlArr[] = $tobj->getInternalURL(); |
48 | 48 | } |
49 | 49 | } |
50 | | - $dbr->freeResult ( $res ) ; |
51 | 50 | |
52 | 51 | wfProfileOut( __METHOD__ ); |
53 | 52 | return new SquidUpdate( $blurlArr ); |
Index: trunk/phase3/includes/QueryPage.php |
— | — | @@ -264,13 +264,9 @@ |
265 | 265 | if ( count( $vals ) ) { |
266 | 266 | if ( !$dbw->insert( 'querycache', $vals, __METHOD__ ) ) { |
267 | 267 | // Set result to false to indicate error |
268 | | - $dbr->freeResult( $res ); |
269 | 268 | $res = false; |
270 | 269 | } |
271 | 270 | } |
272 | | - if ( $res ) { |
273 | | - $dbr->freeResult( $res ); |
274 | | - } |
275 | 271 | if ( $ignoreErrors ) { |
276 | 272 | $dbw->ignoreErrors( $ignoreW ); |
277 | 273 | $dbr->ignoreErrors( $ignoreR ); |
— | — | @@ -492,7 +488,6 @@ |
493 | 489 | $item = $this->feedResult( $obj ); |
494 | 490 | if( $item ) $feed->outItem( $item ); |
495 | 491 | } |
496 | | - $dbr->freeResult( $res ); |
497 | 492 | |
498 | 493 | $feed->outFooter(); |
499 | 494 | return true; |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -2788,8 +2788,6 @@ |
2789 | 2789 | $onlyAuthor = false; |
2790 | 2790 | } |
2791 | 2791 | |
2792 | | - $dbw->freeResult( $res ); |
2793 | | - |
2794 | 2792 | // Generate the summary with a '$1' placeholder |
2795 | 2793 | if ( $blank ) { |
2796 | 2794 | // The current revision is blank and the one before is also |
— | — | @@ -4311,8 +4309,6 @@ |
4312 | 4310 | } |
4313 | 4311 | } |
4314 | 4312 | |
4315 | | - $dbr->freeResult( $res ); |
4316 | | - |
4317 | 4313 | return $result; |
4318 | 4314 | } |
4319 | 4315 | |
— | — | @@ -4343,8 +4339,6 @@ |
4344 | 4340 | } |
4345 | 4341 | } |
4346 | 4342 | |
4347 | | - $dbr->freeResult( $res ); |
4348 | | - |
4349 | 4343 | return $result; |
4350 | 4344 | } |
4351 | 4345 | |
Index: trunk/phase3/includes/RecentChange.php |
— | — | @@ -73,7 +73,6 @@ |
74 | 74 | $res = $dbr->select( 'recentchanges', '*', array( 'rc_id' => $rcid ), __METHOD__ ); |
75 | 75 | if( $res && $dbr->numRows( $res ) > 0 ) { |
76 | 76 | $row = $dbr->fetchObject( $res ); |
77 | | - $dbr->freeResult( $res ); |
78 | 77 | return self::newFromRow( $row ); |
79 | 78 | } else { |
80 | 79 | return null; |
Index: trunk/phase3/includes/WatchedItem.php |
— | — | @@ -150,7 +150,6 @@ |
151 | 151 | 'wl_title' => $newtitle |
152 | 152 | ); |
153 | 153 | } |
154 | | - $dbw->freeResult( $res ); |
155 | 154 | |
156 | 155 | if( empty( $values ) ) { |
157 | 156 | // Nothing to do |
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php |
— | — | @@ -1005,7 +1005,6 @@ |
1006 | 1006 | $res = $this->query( "VALUES NEXTVAL FOR $safeseq" ); |
1007 | 1007 | $row = $this->fetchRow( $res ); |
1008 | 1008 | $this->mInsertId = $row[0]; |
1009 | | - $this->freeResult( $res ); |
1010 | 1009 | return $this->mInsertId; |
1011 | 1010 | */ |
1012 | 1011 | return null; |
— | — | @@ -1604,7 +1603,6 @@ |
1605 | 1604 | $res = $this->query($sql); |
1606 | 1605 | $row = $this->fetchObject($res); |
1607 | 1606 | $size = $row->size; |
1608 | | - $this->freeResult( $res ); |
1609 | 1607 | return $size; |
1610 | 1608 | } |
1611 | 1609 | |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -786,7 +786,6 @@ |
787 | 787 | } |
788 | 788 | $row = $this->fetchRow( $res ); |
789 | 789 | if ( $row !== false ) { |
790 | | - $this->freeResult( $res ); |
791 | 790 | return reset( $row ); |
792 | 791 | } else { |
793 | 792 | return false; |
— | — | @@ -947,13 +946,10 @@ |
948 | 947 | if ( $res === false ) |
949 | 948 | return false; |
950 | 949 | if ( !$this->numRows($res) ) { |
951 | | - $this->freeResult($res); |
952 | 950 | return false; |
953 | 951 | } |
954 | 952 | $obj = $this->fetchObject( $res ); |
955 | | - $this->freeResult( $res ); |
956 | 953 | return $obj; |
957 | | - |
958 | 954 | } |
959 | 955 | |
960 | 956 | /** |
— | — | @@ -976,7 +972,6 @@ |
977 | 973 | $row = $this->fetchRow( $res ); |
978 | 974 | $rows = ( isset( $row['rowcount'] ) ) ? $row['rowcount'] : 0; |
979 | 975 | } |
980 | | - $this->freeResult( $res ); |
981 | 976 | return $rows; |
982 | 977 | } |
983 | 978 | |
— | — | @@ -1056,7 +1051,6 @@ |
1057 | 1052 | $result[] = $row; |
1058 | 1053 | } |
1059 | 1054 | } |
1060 | | - $this->freeResult($res); |
1061 | 1055 | |
1062 | 1056 | return empty($result) ? false : $result; |
1063 | 1057 | } |
— | — | @@ -1069,12 +1063,7 @@ |
1070 | 1064 | $old = $this->ignoreErrors( true ); |
1071 | 1065 | $res = $this->query( "SELECT 1 FROM $table LIMIT 1" ); |
1072 | 1066 | $this->ignoreErrors( $old ); |
1073 | | - if( $res ) { |
1074 | | - $this->freeResult( $res ); |
1075 | | - return true; |
1076 | | - } else { |
1077 | | - return false; |
1078 | | - } |
| 1067 | + return (bool)$res; |
1079 | 1068 | } |
1080 | 1069 | |
1081 | 1070 | /** |
— | — | @@ -1658,7 +1647,6 @@ |
1659 | 1648 | $sql = "SHOW COLUMNS FROM $table LIKE \"$field\";"; |
1660 | 1649 | $res = $this->query( $sql, 'Database::textFieldSize' ); |
1661 | 1650 | $row = $this->fetchObject( $res ); |
1662 | | - $this->freeResult( $res ); |
1663 | 1651 | |
1664 | 1652 | $m = array(); |
1665 | 1653 | if ( preg_match( '/\((.*)\)/', $row->Type, $m ) ) { |
— | — | @@ -1926,7 +1914,6 @@ |
1927 | 1915 | $sql = "SELECT MASTER_POS_WAIT($encFile, $encPos, $timeout)"; |
1928 | 1916 | $res = $this->doQuery( $sql ); |
1929 | 1917 | if ( $res && $row = $this->fetchRow( $res ) ) { |
1930 | | - $this->freeResult( $res ); |
1931 | 1918 | wfProfileOut( $fname ); |
1932 | 1919 | return $row[0]; |
1933 | 1920 | } else { |
Index: trunk/phase3/includes/db/DatabaseMssql.php |
— | — | @@ -327,7 +327,6 @@ |
328 | 328 | if ( $res ) { |
329 | 329 | $row = $this->fetchRow( $res ); |
330 | 330 | if ( isset( $row['EstimateRows'] ) ) $rows = $row['EstimateRows']; |
331 | | - $this->freeResult( $res ); |
332 | 331 | } |
333 | 332 | return $rows; |
334 | 333 | } |
— | — | @@ -666,7 +665,6 @@ |
667 | 666 | $row = $this->fetchRow( $res ); |
668 | 667 | $size = -1; |
669 | 668 | if ( strtolower( $row['DATA_TYPE'] ) != 'text' ) $size = $row['CHARACTER_MAXIMUM_LENGTH']; |
670 | | - $this->freeResult( $res ); |
671 | 669 | return $size; |
672 | 670 | } |
673 | 671 | |
Index: trunk/phase3/includes/db/DatabaseMysql.php |
— | — | @@ -256,7 +256,6 @@ |
257 | 257 | if ( $res === false ) |
258 | 258 | return false; |
259 | 259 | if ( !$this->numRows( $res ) ) { |
260 | | - $this->freeResult($res); |
261 | 260 | return 0; |
262 | 261 | } |
263 | 262 | |
— | — | @@ -264,8 +263,6 @@ |
265 | 264 | while( $plan = $this->fetchObject( $res ) ) { |
266 | 265 | $rows *= $plan->rows > 0 ? $plan->rows : 1; // avoid resetting to zero |
267 | 266 | } |
268 | | - |
269 | | - $this->freeResult($res); |
270 | 267 | return $rows; |
271 | 268 | } |
272 | 269 | |
— | — | @@ -382,7 +379,6 @@ |
383 | 380 | $lockName = $this->addQuotes( $lockName ); |
384 | 381 | $result = $this->query( "SELECT GET_LOCK($lockName, $timeout) AS lockstatus", $method ); |
385 | 382 | $row = $this->fetchObject( $result ); |
386 | | - $this->freeResult( $result ); |
387 | 383 | |
388 | 384 | if( $row->lockstatus == 1 ) { |
389 | 385 | return true; |
Index: trunk/phase3/includes/db/DatabaseOracle.php |
— | — | @@ -654,7 +654,6 @@ |
655 | 655 | $res = $this->query( "SELECT $seqName.nextval FROM dual" ); |
656 | 656 | $row = $this->fetchRow( $res ); |
657 | 657 | $this->mInsertId = $row[0]; |
658 | | - $this->freeResult( $res ); |
659 | 658 | return $this->mInsertId; |
660 | 659 | } |
661 | 660 | |
Index: trunk/phase3/includes/db/DatabasePostgres.php |
— | — | @@ -726,7 +726,6 @@ |
727 | 727 | if( preg_match( '/rows=(\d+)/', $row[0], $count ) ) { |
728 | 728 | $rows = $count[1]; |
729 | 729 | } |
730 | | - $this->freeResult($res); |
731 | 730 | } |
732 | 731 | return $rows; |
733 | 732 | } |
— | — | @@ -993,7 +992,6 @@ |
994 | 993 | $res = $this->query( "SELECT nextval('$safeseq')" ); |
995 | 994 | $row = $this->fetchRow( $res ); |
996 | 995 | $this->mInsertId = $row[0]; |
997 | | - $this->freeResult( $res ); |
998 | 996 | return $this->mInsertId; |
999 | 997 | } |
1000 | 998 | |
— | — | @@ -1005,7 +1003,6 @@ |
1006 | 1004 | $res = $this->query( "SELECT currval('$safeseq')" ); |
1007 | 1005 | $row = $this->fetchRow( $res ); |
1008 | 1006 | $currval = $row[0]; |
1009 | | - $this->freeResult( $res ); |
1010 | 1007 | return $currval; |
1011 | 1008 | } |
1012 | 1009 | |
— | — | @@ -1098,7 +1095,6 @@ |
1099 | 1096 | } else { |
1100 | 1097 | $size=$row->size; |
1101 | 1098 | } |
1102 | | - $this->freeResult( $res ); |
1103 | 1099 | return $size; |
1104 | 1100 | } |
1105 | 1101 | |
— | — | @@ -1188,8 +1184,6 @@ |
1189 | 1185 | . "AND c.relkind IN ('" . implode("','", $types) . "')"; |
1190 | 1186 | $res = $this->query( $SQL ); |
1191 | 1187 | $count = $res ? $res->numRows() : 0; |
1192 | | - if ($res) |
1193 | | - $this->freeResult( $res ); |
1194 | 1188 | return $count ? true : false; |
1195 | 1189 | } |
1196 | 1190 | |
— | — | @@ -1221,7 +1215,6 @@ |
1222 | 1216 | if (!$res) |
1223 | 1217 | return null; |
1224 | 1218 | $rows = $res->numRows(); |
1225 | | - $this->freeResult( $res ); |
1226 | 1219 | return $rows; |
1227 | 1220 | } |
1228 | 1221 | |
— | — | @@ -1245,7 +1238,6 @@ |
1246 | 1239 | if (!$res) |
1247 | 1240 | return null; |
1248 | 1241 | $rows = $res->numRows(); |
1249 | | - $this->freeResult($res); |
1250 | 1242 | return $rows; |
1251 | 1243 | } |
1252 | 1244 | |
— | — | @@ -1263,8 +1255,6 @@ |
1264 | 1256 | } else { |
1265 | 1257 | $owner = false; |
1266 | 1258 | } |
1267 | | - if ($res) |
1268 | | - $this->freeResult($res); |
1269 | 1259 | return $owner; |
1270 | 1260 | } |
1271 | 1261 | |
Index: trunk/phase3/includes/filerepo/File.php |
— | — | @@ -893,7 +893,6 @@ |
894 | 894 | } |
895 | 895 | } |
896 | 896 | } |
897 | | - $db->freeResult( $res ); |
898 | 897 | wfProfileOut( __METHOD__ ); |
899 | 898 | return $retVal; |
900 | 899 | } |
Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -697,12 +697,10 @@ |
698 | 698 | $fname |
699 | 699 | ); |
700 | 700 | if ( 0 == $dbr->numRows( $this->historyRes ) ) { |
701 | | - $dbr->freeResult( $this->historyRes ); |
702 | 701 | $this->historyRes = null; |
703 | 702 | return false; |
704 | 703 | } |
705 | 704 | } elseif ( $this->historyLine == 1 ) { |
706 | | - $dbr->freeResult( $this->historyRes ); |
707 | 705 | $this->historyRes = $dbr->select( 'oldimage', '*', |
708 | 706 | array( 'oi_name' => $this->title->getDBkey() ), |
709 | 707 | $fname, |
— | — | @@ -720,7 +718,6 @@ |
721 | 719 | public function resetHistory() { |
722 | 720 | $this->historyLine = 0; |
723 | 721 | if ( !is_null( $this->historyRes ) ) { |
724 | | - $this->repo->getSlaveDB()->freeResult( $this->historyRes ); |
725 | 722 | $this->historyRes = null; |
726 | 723 | } |
727 | 724 | } |
— | — | @@ -1827,7 +1824,6 @@ |
1828 | 1825 | "{$archiveBase}/{$this->newHash}{$timestamp}!{$this->newName}" |
1829 | 1826 | ); |
1830 | 1827 | } |
1831 | | - $this->db->freeResult( $result ); |
1832 | 1828 | } |
1833 | 1829 | |
1834 | 1830 | /** |
Index: trunk/phase3/includes/LinksUpdate.php |
— | — | @@ -640,7 +640,6 @@ |
641 | 641 | } |
642 | 642 | $arr[$row->pl_namespace][$row->pl_title] = 1; |
643 | 643 | } |
644 | | - $this->mDb->freeResult( $res ); |
645 | 644 | return $arr; |
646 | 645 | } |
647 | 646 | |
— | — | @@ -658,7 +657,6 @@ |
659 | 658 | } |
660 | 659 | $arr[$row->tl_namespace][$row->tl_title] = 1; |
661 | 660 | } |
662 | | - $this->mDb->freeResult( $res ); |
663 | 661 | return $arr; |
664 | 662 | } |
665 | 663 | |
— | — | @@ -673,7 +671,6 @@ |
674 | 672 | while ( $row = $this->mDb->fetchObject( $res ) ) { |
675 | 673 | $arr[$row->il_to] = 1; |
676 | 674 | } |
677 | | - $this->mDb->freeResult( $res ); |
678 | 675 | return $arr; |
679 | 676 | } |
680 | 677 | |
— | — | @@ -688,7 +685,6 @@ |
689 | 686 | while ( $row = $this->mDb->fetchObject( $res ) ) { |
690 | 687 | $arr[$row->el_to] = 1; |
691 | 688 | } |
692 | | - $this->mDb->freeResult( $res ); |
693 | 689 | return $arr; |
694 | 690 | } |
695 | 691 | |
— | — | @@ -703,7 +699,6 @@ |
704 | 700 | while ( $row = $this->mDb->fetchObject( $res ) ) { |
705 | 701 | $arr[$row->cl_to] = $row->cl_sortkey; |
706 | 702 | } |
707 | | - $this->mDb->freeResult( $res ); |
708 | 703 | return $arr; |
709 | 704 | } |
710 | 705 | |
— | — | @@ -736,7 +731,6 @@ |
737 | 732 | } |
738 | 733 | $arr[$row->iwl_prefix][$row->iwl_title] = 1; |
739 | 734 | } |
740 | | - $this->mDb->freeResult( $res ); |
741 | 735 | return $arr; |
742 | 736 | } |
743 | 737 | |
— | — | @@ -751,7 +745,6 @@ |
752 | 746 | while ( $row = $this->mDb->fetchObject( $res ) ) { |
753 | 747 | $arr[$row->pp_propname] = $row->pp_value; |
754 | 748 | } |
755 | | - $this->mDb->freeResult( $res ); |
756 | 749 | return $arr; |
757 | 750 | } |
758 | 751 | |
Index: trunk/phase3/maintenance/updaters.inc |
— | — | @@ -327,7 +327,6 @@ |
328 | 328 | $tableName = $wgDatabase->tableName( $table ); |
329 | 329 | $res = $wgDatabase->query( "SELECT $field FROM $tableName LIMIT 0" ); |
330 | 330 | $flags = explode( ' ', mysql_field_flags( $res->result, 0 ) ); |
331 | | - $wgDatabase->freeResult( $res ); |
332 | 331 | |
333 | 332 | if ( in_array( 'binary', $flags ) ) { |
334 | 333 | wfOut( "...$table table has correct $field encoding.\n" ); |
— | — | @@ -550,7 +549,6 @@ |
551 | 550 | $tablename = $wgDatabase->tableName( $table ); |
552 | 551 | $result = $wgDatabase->query( "SHOW COLUMNS FROM $tablename LIKE '$field'" ); |
553 | 552 | $info = $wgDatabase->fetchObject( $result ); |
554 | | - $wgDatabase->freeResult( $result ); |
555 | 553 | |
556 | 554 | if ( substr( $info->Type, 0, 3 ) == 'int' ) { |
557 | 555 | wfOut( "...$field is already a full int ($info->Type).\n" ); |
— | — | @@ -698,7 +696,6 @@ |
699 | 697 | $fname ); |
700 | 698 | } |
701 | 699 | } |
702 | | - $wgDatabase->freeResult( $result ); |
703 | 700 | wfOut( "ok\n" ); |
704 | 701 | } |
705 | 702 | |
— | — | @@ -793,7 +790,6 @@ |
794 | 791 | ); |
795 | 792 | |
796 | 793 | } |
797 | | - $wgDatabase->freeResult( $res ); |
798 | 794 | } else { |
799 | 795 | // Fast update |
800 | 796 | $wgDatabase->insertSelect( 'templatelinks', 'pagelinks', |
— | — | @@ -1241,14 +1237,12 @@ |
1242 | 1238 | return null; |
1243 | 1239 | } |
1244 | 1240 | if ( !( $r = $wgDatabase->fetchRow( $res ) ) ) { |
1245 | | - $wgDatabase->freeResult( $res ); |
1246 | 1241 | return null; |
1247 | 1242 | } |
1248 | 1243 | |
1249 | 1244 | $indkey = $r[0]; |
1250 | 1245 | $relid = intval( $r[1] ); |
1251 | 1246 | $indkeys = explode( " ", $indkey ); |
1252 | | - $wgDatabase->freeResult( $res ); |
1253 | 1247 | |
1254 | 1248 | $colnames = array(); |
1255 | 1249 | foreach ( $indkeys as $rid ) { |
— | — | @@ -1263,11 +1257,9 @@ |
1264 | 1258 | return null; |
1265 | 1259 | } |
1266 | 1260 | if ( !( $row2 = $wgDatabase->fetchRow( $r2 ) ) ) { |
1267 | | - $wgDatabase->freeResult( $r2 ); |
1268 | 1261 | return null; |
1269 | 1262 | } |
1270 | 1263 | $colnames[] = $row2[0]; |
1271 | | - $wgDatabase->freeResult( $r2 ); |
1272 | 1264 | } |
1273 | 1265 | |
1274 | 1266 | return $colnames; |
— | — | @@ -1316,7 +1308,6 @@ |
1317 | 1309 | return null; |
1318 | 1310 | } |
1319 | 1311 | $d = $row[0]; |
1320 | | - $wgDatabase->freeResult( $r ); |
1321 | 1312 | return $d; |
1322 | 1313 | } |
1323 | 1314 | |
Index: trunk/phase3/maintenance/deleteOrphanedRevisions.php |
— | — | @@ -51,7 +51,6 @@ |
52 | 52 | $revisions = array(); |
53 | 53 | foreach ( $res as $row ) |
54 | 54 | $revisions[] = $row->rev_id; |
55 | | - $dbw->freeResult( $res ); |
56 | 55 | $count = count( $revisions ); |
57 | 56 | $this->output( "found {$count}.\n" ); |
58 | 57 | |
Index: trunk/phase3/maintenance/fixTimestamps.php |
— | — | @@ -89,7 +89,6 @@ |
90 | 90 | $badRevs[] = $row->rev_id; |
91 | 91 | } |
92 | 92 | } |
93 | | - $dbw->freeResult( $res ); |
94 | 93 | |
95 | 94 | $numBadRevs = count( $badRevs ); |
96 | 95 | if ( $numBadRevs > $numGoodRevs ) { |
Index: trunk/phase3/maintenance/rebuildImages.php |
— | — | @@ -112,7 +112,6 @@ |
113 | 113 | } |
114 | 114 | } |
115 | 115 | $this->log( "Finished $table... $this->updated of $this->processed rows updated" ); |
116 | | - $this->dbr->freeResult( $result ); |
117 | 116 | } |
118 | 117 | |
119 | 118 | function buildImage() { |
Index: trunk/phase3/maintenance/rebuildrecentchanges.php |
— | — | @@ -129,7 +129,6 @@ |
130 | 130 | $lastSize = 'NULL'; |
131 | 131 | $new = 1; // probably true |
132 | 132 | } |
133 | | - $dbw->freeResult( $res2 ); |
134 | 133 | } |
135 | 134 | if ( $lastCurId == 0 ) { |
136 | 135 | $this->output( "Uhhh, something wrong? No curid\n" ); |
— | — | @@ -147,7 +146,6 @@ |
148 | 147 | $lastSize = $size; |
149 | 148 | } |
150 | 149 | } |
151 | | - $dbw->freeResult( $res ); |
152 | 150 | } |
153 | 151 | |
154 | 152 | /** |
— | — | @@ -272,8 +270,6 @@ |
273 | 271 | $dbw->query( $sql2 ); |
274 | 272 | } |
275 | 273 | } |
276 | | - |
277 | | - $dbw->freeResult( $res ); |
278 | 274 | } |
279 | 275 | |
280 | 276 | /** |
Index: trunk/phase3/maintenance/attachLatest.php |
— | — | @@ -69,7 +69,6 @@ |
70 | 70 | } |
71 | 71 | $n++; |
72 | 72 | } |
73 | | - $dbw->freeResult( $result ); |
74 | 73 | $this->output( "Done! Processed $n pages.\n" ); |
75 | 74 | if ( !$this->hasOption( 'fix' ) ) { |
76 | 75 | $this->output( "This was a dry run; rerun with --fix to update page_latest.\n" ); |
Index: trunk/phase3/maintenance/initEditCount.php |
— | — | @@ -80,7 +80,6 @@ |
81 | 81 | __METHOD__ ); |
82 | 82 | ++$migrated; |
83 | 83 | } |
84 | | - $dbr->freeResult( $result ); |
85 | 84 | |
86 | 85 | $delta = microtime( true ) - $start; |
87 | 86 | $rate = ( $delta == 0.0 ) ? 0.0 : $migrated / $delta; |
Index: trunk/phase3/maintenance/FiveUpgrade.inc |
— | — | @@ -336,7 +336,6 @@ |
337 | 337 | $this->addChunk( $add ); |
338 | 338 | } |
339 | 339 | $this->lastChunk( $add ); |
340 | | - $this->dbr->freeResult( $result ); |
341 | 340 | |
342 | 341 | $this->log( "Done converting $name." ); |
343 | 342 | $this->cleanupSwaps[] = $name; |
— | — | @@ -444,7 +443,6 @@ |
445 | 444 | $this->addChunk( $add, $row->cur_id ); |
446 | 445 | } |
447 | 446 | $this->lastChunk( $add ); |
448 | | - $this->dbr->freeResult( $result ); |
449 | 447 | |
450 | 448 | /** |
451 | 449 | * Copy revision metadata from old into revision. |
— | — | @@ -477,7 +475,6 @@ |
478 | 476 | $this->addChunk( $add ); |
479 | 477 | } |
480 | 478 | $this->lastChunk( $add ); |
481 | | - $this->dbr->freeResult( $result ); |
482 | 479 | |
483 | 480 | |
484 | 481 | /** |
— | — | @@ -510,7 +507,6 @@ |
511 | 508 | $this->addChunk( $add ); |
512 | 509 | } |
513 | 510 | $this->lastChunk( $add ); |
514 | | - $this->dbr->freeResult( $result ); |
515 | 511 | |
516 | 512 | $this->log( "...done with cur/old -> page/revision." ); |
517 | 513 | } |
— | — | @@ -902,7 +898,6 @@ |
903 | 899 | $this->addChunk( $add ); |
904 | 900 | } |
905 | 901 | $this->lastChunk( $add ); |
906 | | - $this->dbr->freeResult( $result ); |
907 | 902 | |
908 | 903 | $this->log( 'Done converting watchlist.' ); |
909 | 904 | $this->cleanupSwaps[] = 'watchlist'; |
Index: trunk/phase3/maintenance/rebuildtextindex.php |
— | — | @@ -87,7 +87,6 @@ |
88 | 88 | $u = new SearchUpdate( $s->page_id, $s->page_title, $revtext ); |
89 | 89 | $u->doUpdate(); |
90 | 90 | } |
91 | | - $this->db->freeResult( $res ); |
92 | 91 | $n += self::RTI_CHUNK_SIZE; |
93 | 92 | } |
94 | 93 | } |
Index: trunk/phase3/maintenance/updateArticleCount.php |
— | — | @@ -92,7 +92,6 @@ |
93 | 93 | $dbr = wfGetDB( DB_SLAVE ); |
94 | 94 | $res = $dbr->query( $this->makeSql( $dbr ), __METHOD__ ); |
95 | 95 | $row = $dbr->fetchObject( $res ); |
96 | | - $dbr->freeResult( $res ); |
97 | 96 | return $row ? $row->pagecount : false; |
98 | 97 | } |
99 | 98 | } |
Index: trunk/phase3/maintenance/userDupes.inc |
— | — | @@ -193,8 +193,6 @@ |
194 | 194 | while ( $row = $this->db->fetchObject( $result ) ) { |
195 | 195 | $list[] = $row->user_name; |
196 | 196 | } |
197 | | - $this->db->freeResult( $result ); |
198 | | - |
199 | 197 | return $list; |
200 | 198 | } |
201 | 199 | |
— | — | @@ -246,7 +244,6 @@ |
247 | 245 | } |
248 | 246 | wfOut( "\n" ); |
249 | 247 | } |
250 | | - $this->db->freeResult( $result ); |
251 | 248 | } |
252 | 249 | |
253 | 250 | /** |
Index: trunk/phase3/maintenance/dumpSisterSites.php |
— | — | @@ -48,7 +48,6 @@ |
49 | 49 | $text = $title->getPrefixedText(); |
50 | 50 | $this->output( "$url $text\n" ); |
51 | 51 | } |
52 | | - $dbr->freeResult( $result ); |
53 | 52 | } |
54 | 53 | } |
55 | 54 | |
Index: trunk/phase3/maintenance/dumpUploads.php |
— | — | @@ -82,7 +82,6 @@ |
83 | 83 | foreach ( $result as $row ) { |
84 | 84 | $this->outputItem( $row->il_to, $shared ); |
85 | 85 | } |
86 | | - $dbr->freeResult( $result ); |
87 | 86 | } |
88 | 87 | |
89 | 88 | /** |
— | — | @@ -100,7 +99,6 @@ |
101 | 100 | foreach ( $result as $row ) { |
102 | 101 | $this->outputItem( $row->img_name, $shared ); |
103 | 102 | } |
104 | | - $dbr->freeResult( $result ); |
105 | 103 | } |
106 | 104 | |
107 | 105 | function outputItem( $name, $shared ) { |
Index: trunk/phase3/maintenance/namespaceDupes.php |
— | — | @@ -142,7 +142,6 @@ |
143 | 143 | foreach ( $result as $row ) { |
144 | 144 | $prefixes[] = $row->iw_prefix; |
145 | 145 | } |
146 | | - $this->db->freeResult( $result ); |
147 | 146 | return $prefixes; |
148 | 147 | } |
149 | 148 | |
— | — | @@ -214,8 +213,6 @@ |
215 | 214 | foreach ( $result as $row ) { |
216 | 215 | $set[] = $row; |
217 | 216 | } |
218 | | - $this->db->freeResult( $result ); |
219 | | - |
220 | 217 | return $set; |
221 | 218 | } |
222 | 219 | |
Index: trunk/phase3/maintenance/storage/compressOld.inc |
— | — | @@ -23,7 +23,6 @@ |
24 | 24 | compressPage( $row, $extdb ); |
25 | 25 | $last = $row->old_id; |
26 | 26 | } |
27 | | - $dbw->freeResult( $res ); |
28 | 27 | $start = $last + 1; # Deletion may leave long empty stretches |
29 | 28 | print "$start...\n"; |
30 | 29 | } while( true ); |
Index: trunk/phase3/maintenance/storage/moveToExternal.php |
— | — | @@ -111,7 +111,6 @@ |
112 | 112 | array( 'old_id' => $id ), $fname ); |
113 | 113 | $numMoved++; |
114 | 114 | } |
115 | | - $dbr->freeResult( $res ); |
116 | 115 | } |
117 | 116 | } |
118 | 117 | |
Index: trunk/phase3/maintenance/storage/resolveStubs.php |
— | — | @@ -40,10 +40,7 @@ |
41 | 41 | $fname ); |
42 | 42 | while ( $row = $dbr->fetchObject( $res ) ) { |
43 | 43 | resolveStub( $row->old_id, $row->old_text, $row->old_flags ); |
44 | | - } |
45 | | - $dbr->freeResult( $res ); |
46 | | - |
47 | | - |
| 44 | + } |
48 | 45 | } |
49 | 46 | print "100%\n"; |
50 | 47 | } |
Index: trunk/phase3/maintenance/fixSlaveDesync.php |
— | — | @@ -66,7 +66,6 @@ |
67 | 67 | } |
68 | 68 | } |
69 | 69 | $this->output( "\n" ); |
70 | | - $dbw->freeResult( $res ); |
71 | 70 | |
72 | 71 | global $slaveIndexes; |
73 | 72 | foreach ( $slaveIndexes as $i ) { |
— | — | @@ -78,7 +77,6 @@ |
79 | 78 | $this->output( $row->page_id . "\t" ); |
80 | 79 | } |
81 | 80 | } |
82 | | - $db->freeResult( $res ); |
83 | 81 | } |
84 | 82 | $this->output( "\n" ); |
85 | 83 | return $desync; |
— | — | @@ -128,14 +126,12 @@ |
129 | 127 | foreach ( $res as $row ) { |
130 | 128 | $masterIDs[] = $row->rev_id; |
131 | 129 | } |
132 | | - $dbw->freeResult( $res ); |
133 | 130 | |
134 | 131 | $res = $db->select( 'revision', array( 'rev_id' ), array( 'rev_page' => $pageID ), __METHOD__ ); |
135 | 132 | $slaveIDs = array(); |
136 | 133 | foreach ( $res as $row ) { |
137 | 134 | $slaveIDs[] = $row->rev_id; |
138 | 135 | } |
139 | | - $db->freeResult( $res ); |
140 | 136 | if ( count( $masterIDs ) < count( $slaveIDs ) ) { |
141 | 137 | $missingIDs = array_diff( $slaveIDs, $masterIDs ); |
142 | 138 | if ( count( $missingIDs ) ) { |
Index: trunk/phase3/maintenance/orphans.php |
— | — | @@ -184,7 +184,6 @@ |
185 | 185 | WHERE rev_page=$row->page_id |
186 | 186 | " ); |
187 | 187 | $row2 = $dbw->fetchObject( $result2 ); |
188 | | - $dbw->freeResult( $result2 ); |
189 | 188 | if ( $row2 ) { |
190 | 189 | if ( $row->rev_timestamp != $row2->max_timestamp ) { |
191 | 190 | if ( $found == 0 ) { |