http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90586

Revision: 90586
Author:   freakolowsky
Date:     2011-06-22 14:34:55 +0000 (Wed, 22 Jun 2011)
Log Message:
-----------
* MFT r90585 (i know it's late ... ready for 1.17.1 :D)
* *this* is why i need testing pplz on oracle

Modified Paths:
--------------
    branches/REL1_17/phase3/includes/installer/OracleUpdater.php
    branches/REL1_17/phase3/maintenance/oracle/tables.sql

Added Paths:
-----------
    
branches/REL1_17/phase3/maintenance/oracle/archives/patch_remove_not_null_empty_defs.sql

Modified: branches/REL1_17/phase3/includes/installer/OracleUpdater.php
===================================================================
--- branches/REL1_17/phase3/includes/installer/OracleUpdater.php        
2011-06-22 14:10:55 UTC (rev 90585)
+++ branches/REL1_17/phase3/includes/installer/OracleUpdater.php        
2011-06-22 14:34:55 UTC (rev 90586)
@@ -21,6 +21,7 @@
                        array( 'doFunctions17' ),
                        array( 'doSchemaUpgrade17' ),
                        array( 'doInsertPage0' ),
+                       array( 'doRemoveNotNullEmptyDefaults' ),
                );
        }
 
@@ -103,6 +104,21 @@
        }
 
        /**
+        * Remove DEFAULT '' NOT NULL constraints from fields as '' is 
internally
+        * converted to NULL in Oracle
+        */
+       protected function doRemoveNotNullEmptyDefaults() {
+               $this->output( "Removing not null empty constraints ... " );
+               $meta = $this->db->fieldInfo( 'categorylinks' , 
'cl_sortkey_prefix' );
+               if ( $meta->isNullable() ) {
+                       $this->output( "constraints seem to be removed\n" );
+                       return;
+               }
+               $this->applyPatch( 'patch_remove_not_null_empty_defs.sql', 
false );
+               $this->output( "ok\n" );
+       }
+
+       /**
         * Overload: after this action field info table has to be rebuilt
         */
        public function doUpdates( $what = array( 'core', 'extensions', 'purge' 
) ) {

Added: 
branches/REL1_17/phase3/maintenance/oracle/archives/patch_remove_not_null_empty_defs.sql
===================================================================
--- 
branches/REL1_17/phase3/maintenance/oracle/archives/patch_remove_not_null_empty_defs.sql
                            (rev 0)
+++ 
branches/REL1_17/phase3/maintenance/oracle/archives/patch_remove_not_null_empty_defs.sql
    2011-06-22 14:34:55 UTC (rev 90586)
@@ -0,0 +1,9 @@
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.categorylinks MODIFY cl_sortkey_prefix DEFAULT NULL 
NULL;
+ALTER TABLE &mw_prefix.categorylinks MODIFY cl_collation DEFAULT NULL NULL;
+ALTER TABLE &mw_prefix.iwlinks MODIFY iwl_prefix DEFAULT NULL NULL;
+ALTER TABLE &mw_prefix.iwlinks MODIFY iwl_title DEFAULT NULL NULL;
+ALTER TABLE &mw_prefix.searchindex MODIFY si_title DEFAULT NULL NULL;
+ALTER TABLE &mw_prefix.querycachetwo MODIFY qcc_title DEFAULT NULL NULL;
+ALTER TABLE &mw_prefix.querycachetwo MODIFY qcc_titletwo DEFAULT NULL NULL;


Property changes on: 
branches/REL1_17/phase3/maintenance/oracle/archives/patch_remove_not_null_empty_defs.sql
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: branches/REL1_17/phase3/maintenance/oracle/tables.sql
===================================================================
--- branches/REL1_17/phase3/maintenance/oracle/tables.sql       2011-06-22 
14:10:55 UTC (rev 90585)
+++ branches/REL1_17/phase3/maintenance/oracle/tables.sql       2011-06-22 
14:34:55 UTC (rev 90586)
@@ -26,7 +26,7 @@
 
 -- Create a dummy user to satisfy fk contraints especially with revisions
 INSERT INTO &mw_prefix.mwuser
-  VALUES 
(user_user_id_seq.nextval,'Anonymous','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
 '', current_timestamp, current_timestamp, 0);
+  VALUES 
(user_user_id_seq.nextval,'Anonymous',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
 '', current_timestamp, current_timestamp, 0);
 
 CREATE TABLE &mw_prefix.user_groups (
   ug_user   NUMBER      DEFAULT 0 NOT NULL,
@@ -168,9 +168,9 @@
   cl_from       NUMBER      NOT NULL,
   cl_to         VARCHAR2(255)         NOT NULL,
   cl_sortkey    VARCHAR2(230),
-  cl_sortkey_prefix VARCHAR2(255) DEFAULT '' NOT NULL,
+  cl_sortkey_prefix VARCHAR2(255),
   cl_timestamp  TIMESTAMP(6) WITH TIME ZONE  NOT NULL,
-  cl_collation VARCHAR2(32) DEFAULT '' NOT NULL,
+  cl_collation VARCHAR2(32),
   cl_type              VARCHAR2(6) DEFAULT 'page' NOT NULL
 );
 ALTER TABLE &mw_prefix.categorylinks ADD CONSTRAINT 
&mw_prefix.categorylinks_fk1 FOREIGN KEY (cl_from) REFERENCES 
&mw_prefix.page(page_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
@@ -220,8 +220,8 @@
 
 CREATE TABLE &mw_prefix.iwlinks (
   iwl_from NUMBER DEFAULT 0 NOT NULL,
-  iwl_prefix VARCHAR2(20) DEFAULT '' NOT NULL,
-  iwl_title VARCHAR2(255) DEFAULT '' NOT NULL
+  iwl_prefix VARCHAR2(20),
+  iwl_title VARCHAR2(255)
 );
 CREATE UNIQUE INDEX &mw_prefix.iwlinks_ui01 ON &mw_prefix.iwlinks (iwl_from, 
iwl_prefix, iwl_title);
 CREATE UNIQUE INDEX &mw_prefix.iwlinks_ui02 ON &mw_prefix.iwlinks (iwl_prefix, 
iwl_title, iwl_from);
@@ -416,7 +416,7 @@
 
 CREATE TABLE &mw_prefix.searchindex (
   si_page      NUMBER NOT NULL,
-  si_title     VARCHAR2(255) DEFAULT '' NOT NULL,
+  si_title     VARCHAR2(255),
   si_text      CLOB NOT NULL
 );
 CREATE UNIQUE INDEX &mw_prefix.searchindex_u01 ON &mw_prefix.searchindex 
(si_page);
@@ -528,9 +528,9 @@
   qcc_type          VARCHAR2(32)     NOT NULL,
   qcc_value         NUMBER  DEFAULT 0 NOT NULL,
   qcc_namespace     NUMBER  DEFAULT 0 NOT NULL,
-  qcc_title         VARCHAR2(255)     DEFAULT '' NOT NULL,
+  qcc_title         VARCHAR2(255),
   qcc_namespacetwo  NUMBER  DEFAULT 0 NOT NULL,
-  qcc_titletwo      VARCHAR2(255)     DEFAULT '' NOT NULL
+  qcc_titletwo      VARCHAR2(255)
 );
 CREATE INDEX &mw_prefix.querycachetwo_i01 ON &mw_prefix.querycachetwo 
(qcc_type,qcc_value);
 CREATE INDEX &mw_prefix.querycachetwo_i02 ON &mw_prefix.querycachetwo 
(qcc_type,qcc_namespace,qcc_title);


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to