Index: trunk/phase3/includes/Category.php |
— | — | @@ -246,7 +246,7 @@ |
247 | 247 | } else { |
248 | 248 | # Let's be sure that the row exists in the table. We don't need to |
249 | 249 | # do this if we got the row from the table in initialization! |
250 | | - $seqVal = $dbw->nextSequenceValue( 'category_id_seq' ); |
| 250 | + $seqVal = $dbw->nextSequenceValue( 'category_cat_id_seq' ); |
251 | 251 | $dbw->insert( |
252 | 252 | 'category', |
253 | 253 | array( 'cat_id' => $seqVal, |
Index: trunk/phase3/includes/Block.php |
— | — | @@ -377,7 +377,7 @@ |
378 | 378 | # Don't collide with expired blocks |
379 | 379 | Block::purgeExpired(); |
380 | 380 | |
381 | | - $ipb_id = $dbw->nextSequenceValue('ipblocks_ipb_id_val'); |
| 381 | + $ipb_id = $dbw->nextSequenceValue('ipblocks_ipb_id_seq'); |
382 | 382 | $dbw->insert( 'ipblocks', |
383 | 383 | array( |
384 | 384 | 'ipb_id' => $ipb_id, |
Index: trunk/phase3/includes/RecentChange.php |
— | — | @@ -156,7 +156,7 @@ |
157 | 157 | # Fixup database timestamps |
158 | 158 | $this->mAttribs['rc_timestamp'] = $dbw->timestamp($this->mAttribs['rc_timestamp']); |
159 | 159 | $this->mAttribs['rc_cur_time'] = $dbw->timestamp($this->mAttribs['rc_cur_time']); |
160 | | - $this->mAttribs['rc_id'] = $dbw->nextSequenceValue( 'rc_rc_id_seq' ); |
| 160 | + $this->mAttribs['rc_id'] = $dbw->nextSequenceValue( 'recentchanges_rc_id_seq' ); |
161 | 161 | |
162 | 162 | ## If we are using foreign keys, an entry of 0 for the page_id will fail, so use NULL |
163 | 163 | if( $dbw->cascadingDeletes() and $this->mAttribs['rc_cur_id']==0 ) { |
Index: trunk/phase3/includes/Import.php |
— | — | @@ -265,7 +265,7 @@ |
266 | 266 | $this->timestamp . "\n" ); |
267 | 267 | return false; |
268 | 268 | } |
269 | | - $log_id = $dbw->nextSequenceValue( 'log_log_id_seq' ); |
| 269 | + $log_id = $dbw->nextSequenceValue( 'logging_log_id_seq' ); |
270 | 270 | $data = array( |
271 | 271 | 'log_id' => $log_id, |
272 | 272 | 'log_type' => $this->type, |
Index: trunk/phase3/includes/Revision.php |
— | — | @@ -826,7 +826,7 @@ |
827 | 827 | |
828 | 828 | # Record the text (or external storage URL) to the text table |
829 | 829 | if( !isset( $this->mTextId ) ) { |
830 | | - $old_id = $dbw->nextSequenceValue( 'text_old_id_val' ); |
| 830 | + $old_id = $dbw->nextSequenceValue( 'text_old_id_seq' ); |
831 | 831 | $dbw->insert( 'text', |
832 | 832 | array( |
833 | 833 | 'old_id' => $old_id, |
— | — | @@ -840,7 +840,7 @@ |
841 | 841 | # Record the edit in revisions |
842 | 842 | $rev_id = isset( $this->mId ) |
843 | 843 | ? $this->mId |
844 | | - : $dbw->nextSequenceValue( 'rev_rev_id_val' ); |
| 844 | + : $dbw->nextSequenceValue( 'revision_rev_id_seq' ); |
845 | 845 | $dbw->insert( 'revision', |
846 | 846 | array( |
847 | 847 | 'rev_id' => $rev_id, |
Index: trunk/phase3/includes/LogPage.php |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | global $wgLogRestrictions; |
62 | 62 | |
63 | 63 | $dbw = wfGetDB( DB_MASTER ); |
64 | | - $log_id = $dbw->nextSequenceValue( 'log_log_id_seq' ); |
| 64 | + $log_id = $dbw->nextSequenceValue( 'logging_log_id_seq' ); |
65 | 65 | |
66 | 66 | $this->timestamp = $now = wfTimestampNow(); |
67 | 67 | $data = array( |
Index: trunk/phase3/includes/db/DatabaseOracle.php |
— | — | @@ -512,6 +512,12 @@ |
513 | 513 | } else { |
514 | 514 | $srcTable = $this->tableName( $srcTable ); |
515 | 515 | } |
| 516 | + |
| 517 | + // count-alias subselect fields to avoid abigious definition errors |
| 518 | + $i=0; |
| 519 | + foreach($varMap as $key=>&$val) |
| 520 | + $val=$val.' field'.($i++); |
| 521 | + |
516 | 522 | $sql = "INSERT INTO $destTable (" . implode( ',', array_keys( $varMap ) ) . ')' . |
517 | 523 | " SELECT $startOpts " . implode( ',', $varMap ) . |
518 | 524 | " FROM $srcTable $useIndex "; |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -4097,7 +4097,7 @@ |
4098 | 4098 | } |
4099 | 4099 | $insertRows = array(); |
4100 | 4100 | foreach( $insertCats as $cat ) { |
4101 | | - $insertRows[] = array( 'cat_id' => $dbw->nextSequenceValue( 'category_id_seq' ), |
| 4101 | + $insertRows[] = array( 'cat_id' => $dbw->nextSequenceValue( 'category_cat_id_seq' ), |
4102 | 4102 | 'cat_title' => $cat ); |
4103 | 4103 | } |
4104 | 4104 | $dbw->insert( 'category', $insertRows, __METHOD__, 'IGNORE' ); |
Index: trunk/phase3/maintenance/ora/patch_seq_names_pre1.16.sql |
— | — | @@ -0,0 +1,8 @@ |
| 2 | +-- script for renameing sequence names to conform with <table>_<field>_seq format |
| 3 | +RENAME rev_rev_id_val TO revision_rev_id_seq; |
| 4 | +RENAME text_old_id_val TO text_old_id_seq; |
| 5 | +RENAME category_id_seq TO category_cat_id_seq; |
| 6 | +RENAME ipblocks_ipb_id_val TO ipblocks_ipb_id_seq; |
| 7 | +RENAME rc_rc_id_seq TO recentchanges_rc_id_seq; |
| 8 | +RENAME log_log_id_seq TO logging_log_id_seq; |
| 9 | +RENAME pr_id_val TO page_restrictions_pr_id_seq; |
\ No newline at end of file |
Index: trunk/phase3/maintenance/ora/tables.sql |
— | — | @@ -79,7 +79,7 @@ |
80 | 80 | END; |
81 | 81 | /*$mw$*/ |
82 | 82 | |
83 | | -CREATE SEQUENCE rev_rev_id_val; |
| 83 | +CREATE SEQUENCE revision_rev_id_seq; |
84 | 84 | CREATE TABLE &mw_prefix.revision ( |
85 | 85 | rev_id NUMBER NOT NULL, |
86 | 86 | rev_page NUMBER NULL REFERENCES &mw_prefix.page (page_id) ON DELETE CASCADE, |
— | — | @@ -100,7 +100,7 @@ |
101 | 101 | CREATE INDEX &mw_prefix.revision_i03 ON &mw_prefix.revision (rev_user,rev_timestamp); |
102 | 102 | CREATE INDEX &mw_prefix.revision_i04 ON &mw_prefix.revision (rev_user_text,rev_timestamp); |
103 | 103 | |
104 | | -CREATE SEQUENCE text_old_id_val; |
| 104 | +CREATE SEQUENCE text_old_id_seq; |
105 | 105 | CREATE TABLE &mw_prefix.pagecontent ( -- replaces reserved word 'text' |
106 | 106 | old_id NUMBER NOT NULL, |
107 | 107 | old_text CLOB, |
— | — | @@ -163,7 +163,7 @@ |
164 | 164 | CREATE INDEX &mw_prefix.categorylinks_i01 ON &mw_prefix.categorylinks (cl_to,cl_sortkey,cl_from); |
165 | 165 | CREATE INDEX &mw_prefix.categorylinks_i02 ON &mw_prefix.categorylinks (cl_to,cl_timestamp); |
166 | 166 | |
167 | | -CREATE SEQUENCE category_id_seq; |
| 167 | +CREATE SEQUENCE category_cat_id_seq; |
168 | 168 | CREATE TABLE &mw_prefix.category ( |
169 | 169 | cat_id NUMBER NOT NULL, |
170 | 170 | cat_title VARCHAR2(255) NOT NULL, |
— | — | @@ -210,7 +210,7 @@ |
211 | 211 | hc_id NUMBER NOT NULL |
212 | 212 | ); |
213 | 213 | |
214 | | -CREATE SEQUENCE ipblocks_ipb_id_val; |
| 214 | +CREATE SEQUENCE ipblocks_ipb_id_seq; |
215 | 215 | CREATE TABLE &mw_prefix.ipblocks ( |
216 | 216 | ipb_id NUMBER NOT NULL, |
217 | 217 | ipb_address VARCHAR2(255) NULL, |
— | — | @@ -314,7 +314,7 @@ |
315 | 315 | CREATE INDEX &mw_prefix.filearchive_i03 ON &mw_prefix.filearchive (fa_deleted_timestamp); |
316 | 316 | CREATE INDEX &mw_prefix.filearchive_i04 ON &mw_prefix.filearchive (fa_user_text,fa_timestamp); |
317 | 317 | |
318 | | -CREATE SEQUENCE rc_rc_id_seq; |
| 318 | +CREATE SEQUENCE recentchanges_rc_id_seq; |
319 | 319 | CREATE TABLE &mw_prefix.recentchanges ( |
320 | 320 | rc_id NUMBER NOT NULL, |
321 | 321 | rc_timestamp TIMESTAMP(6) WITH TIME ZONE NOT NULL, |
— | — | @@ -409,7 +409,7 @@ |
410 | 410 | CREATE UNIQUE INDEX &mw_prefix.transcache_u01 ON &mw_prefix.transcache (tc_url); |
411 | 411 | |
412 | 412 | |
413 | | -CREATE SEQUENCE log_log_id_seq; |
| 413 | +CREATE SEQUENCE logging_log_id_seq; |
414 | 414 | CREATE TABLE &mw_prefix.logging ( |
415 | 415 | log_id NUMBER NOT NULL, |
416 | 416 | log_type VARCHAR2(10) NOT NULL, |
— | — | @@ -488,7 +488,7 @@ |
489 | 489 | CREATE INDEX &mw_prefix.querycachetwo_i02 ON &mw_prefix.querycachetwo (qcc_type,qcc_namespace,qcc_title); |
490 | 490 | CREATE INDEX &mw_prefix.querycachetwo_i03 ON &mw_prefix.querycachetwo (qcc_type,qcc_namespacetwo,qcc_titletwo); |
491 | 491 | |
492 | | -CREATE SEQUENCE pr_id_val; |
| 492 | +CREATE SEQUENCE page_restrictions_pr_id_seq; |
493 | 493 | CREATE TABLE &mw_prefix.page_restrictions ( |
494 | 494 | pr_id NUMBER NOT NULL, |
495 | 495 | pr_page NUMBER NULL REFERENCES &mw_prefix.page (page_id) ON DELETE CASCADE, |