r57102 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57101‎ | r57102 | r57103 >
Date:13:38, 30 September 2009
Author:freakolowsky
Status:ok (Comments)
Tags:
Comment:
logging table added columns, fixed cat_id sequence generation in Article and Category
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/Category.php (modified) (history)
  • /trunk/phase3/maintenance/ora/tables.sql (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/ora/tables.sql
@@ -416,8 +416,10 @@
417417 log_action VARCHAR2(10) NOT NULL,
418418 log_timestamp TIMESTAMP(6) WITH TIME ZONE NOT NULL,
419419 log_user NUMBER REFERENCES &mw_prefix.mwuser(user_id) ON DELETE SET NULL,
 420+ log_user_text VARCHAR2(255),
420421 log_namespace NUMBER NOT NULL,
421422 log_title VARCHAR2(255) NOT NULL,
 423+ log_page NUMBER,
422424 log_comment VARCHAR2(255),
423425 log_params CLOB,
424426 log_deleted NUMBER DEFAULT '0' NOT NULL
Index: trunk/phase3/includes/Article.php
@@ -4072,7 +4072,8 @@
40734073 }
40744074 $insertRows = array();
40754075 foreach( $insertCats as $cat ) {
4076 - $insertRows[] = array( 'cat_title' => $cat );
 4076+ $insertRows[] = array( 'cat_id' => $dbw->nextSequenceValue( 'category_cat_id_val' ),
 4077+ 'cat_title' => $cat );
40774078 }
40784079 $dbw->insert( 'category', $insertRows, __METHOD__, 'IGNORE' );
40794080
Index: trunk/phase3/includes/Category.php
@@ -246,9 +246,11 @@
247247 } else {
248248 # Let's be sure that the row exists in the table. We don't need to
249249 # do this if we got the row from the table in initialization!
 250+ $seqVal = $dbw->nextSequenceValue( 'category_cat_id_val' );
250251 $dbw->insert(
251252 'category',
252 - array( 'cat_title' => $this->mName ),
 253+ array( 'cat_id' => $seqVal,
 254+ 'cat_title' => $this->mName ),
253255 __METHOD__,
254256 'IGNORE'
255257 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r57698Followup to r57102, use already existing sequence name so as to not break DB2...overlordq04:28, 14 October 2009

Comments

#Comment by OverlordQ (talk | contribs)   04:21, 14 October 2009

This uses an inconsistent column name which breaks other databases.

Status & tagging log