Index: trunk/phase3/maintenance/rebuildrecentchanges.inc |
— | — | @@ -64,19 +64,17 @@ |
65 | 65 | # Switch! Look up the previous last edit, if any |
66 | 66 | $lastCurId = intval( $obj->rc_cur_id ); |
67 | 67 | $emit = $obj->rc_timestamp; |
68 | | - $sql2 = "SELECT rev_id, rev_len, rev_text_id FROM $revision " . |
| 68 | + $sql2 = "SELECT rev_id, rev_len FROM $revision " . |
69 | 69 | "WHERE rev_page={$lastCurId} ". |
70 | 70 | "AND rev_timestamp<'{$emit}' ORDER BY rev_timestamp DESC LIMIT 1"; |
71 | 71 | $res2 = $dbw->query( $sql2 ); |
72 | 72 | if( $row = $dbw->fetchObject( $res2 ) ) { |
73 | 73 | $lastOldId = intval( $row->rev_id ); |
74 | | - $lastTextId = intval( $row->rev_text_id ); |
75 | 74 | $lastSize = $row->rev_len; # Grab the last text size |
76 | 75 | } else { |
77 | 76 | # No previous edit |
78 | 77 | $lastOldId = 0; |
79 | | - $lastTextId = 0; |
80 | | - $lastSize = NULL; |
| 78 | + $lastSize = 'NULL'; |
81 | 79 | $new = 1; |
82 | 80 | } |
83 | 81 | $dbw->freeResult( $res2 ); |
— | — | @@ -84,25 +82,9 @@ |
85 | 83 | if( $lastCurId == 0 ) { |
86 | 84 | print "Uhhh, something wrong? No curid\n"; |
87 | 85 | } else { |
88 | | - # Check the text if not in rev_len for the last entry's text size |
89 | | - if( !$lastSize ) { |
90 | | - $lastText = $dbw->selectField( 'text', 'old_text', array('old_id' => $lastTextId ) ); |
91 | | - $lastSize = $lastText ? strlen($lastText) : 'NULL'; |
92 | | - } |
93 | 86 | # Grab the entry's text size |
94 | | - $res3 = $dbw->select( 'revision', array('rev_len','rev_text_id'), array('rev_id' => $obj->rc_this_oldid ) ); |
95 | | - if( $row = $dbw->fetchObject( $res3 ) ) { |
96 | | - $textId = $row->rev_text_id; |
97 | | - $size = $row->rev_len; |
98 | | - } else { |
99 | | - $textId = 0; |
100 | | - $size = NULL; |
101 | | - } |
102 | | - # Check the text if not in rev_len for the entry's text size |
103 | | - if( !$size ) { |
104 | | - $text = $dbw->selectField( 'text', 'old_text', array('old_id' => $textId ) ); |
105 | | - $size = $text ? strlen($text) : 'NULL'; |
106 | | - } |
| 87 | + $size = $dbw->selectField( 'revision', 'rev_len', array('rev_id' => $obj->rc_this_oldid ) ); |
| 88 | + $size = $size ? $size : 'NULL'; |
107 | 89 | |
108 | 90 | $sql3 = "UPDATE $recentchanges SET rc_last_oldid=$lastOldId,rc_new=$new,rc_type=$new," . |
109 | 91 | "rc_old_len='$lastSize',rc_new_len='$size' " . |