[evolvis-commits] r18279: Prepared 1.11.0-4

mirabilos at evolvis.org mirabilos at evolvis.org
Wed Apr 11 11:15:56 CEST 2012


Author: mirabilos
Date: 2012-04-11 11:15:55 +0200 (Wed, 11 Apr 2012)
New Revision: 18279

Added:
   trunk/mediawiki/debian/patches/fix_postgre.patch
Removed:
   trunk/mediawiki/debian/patches/fix_postgre_unserialize.patch
Modified:
   trunk/mediawiki/debian/changelog
   trunk/mediawiki/debian/patches/series
Log:
Prepared 1.11.0-4

Modified: trunk/mediawiki/debian/changelog
===================================================================
--- trunk/mediawiki/debian/changelog	2012-04-11 09:15:54 UTC (rev 18278)
+++ trunk/mediawiki/debian/changelog	2012-04-11 09:15:55 UTC (rev 18279)
@@ -1,3 +1,11 @@
+mediawiki (1:1.11.0-4) unstable; urgency=low
+
+  * Really add the patch for #459312
+  * Added also patch to fix #459617
+  * Merged two previous patches
+
+ -- Romain Beauxis <toots at rastageeks.org>  Fri, 18 Jan 2008 16:14:59 +0100
+
 mediawiki (1:1.11.0-3) unstable; urgency=low
 
   * Really remove debian specific scripts

Added: trunk/mediawiki/debian/patches/fix_postgre.patch
===================================================================
--- trunk/mediawiki/debian/patches/fix_postgre.patch	                        (rev 0)
+++ trunk/mediawiki/debian/patches/fix_postgre.patch	2012-04-11 09:15:55 UTC (rev 18279)
@@ -0,0 +1,135 @@
+Index: includes/DatabasePostgres.php
+===================================================================
+--- mediawiki-1.11.0/includes/DatabasePostgres.php	(révision 26039)
++++ mediawiki-1.11.0/includes/DatabasePostgres.php	(révision 26040)
+@@ -1148,9 +1148,13 @@
+ 	}
+ 
+ 	function encodeBlob( $b ) {
+-		return pg_escape_bytea( $b );
++		return new Blob ( pg_escape_bytea( $b ) ) ;
+ 	}
++
+ 	function decodeBlob( $b ) {
++		if ($b instanceof Blob) {
++			$b = $b->fetch();
++		}
+ 		return pg_unescape_bytea( $b );
+ 	}
+ 
+@@ -1161,11 +1165,10 @@
+ 	function addQuotes( $s ) {
+ 		if ( is_null( $s ) ) {
+ 			return 'NULL';
+-		} else if (is_array( $s )) { ## Assume it is bytea data
+-			return "E'$s[1]'";
++		} else if ($s instanceof Blob) {
++			return "'".$s->fetch($s)."'";
+ 		}
+ 		return "'" . pg_escape_string($s) . "'";
+-		// Unreachable: return "E'" . pg_escape_string($s) . "'";
+ 	}
+ 
+ 	function quote_ident( $s ) {
+Index: includes/Database.php
+===================================================================
+--- mediawiki-1.11.0/includes/Database.php	(révision 26039)
++++ mediawiki-1.11.0/includes/Database.php	(révision 26040)
+@@ -36,6 +36,22 @@
+ };
+ 
+ /**
++ * Utility class
++ * @addtogroup Database
++ *
++ * This allows us to distinguish a blob from a normal string and an array of strings
++ */
++class Blob {
++	var $data;
++	function __construct($data) {
++		$this->mData = $data;
++	}
++	function fetch() {
++		return $this->mData;
++	}
++};
++
++/**
+  * Utility class.
+  * @addtogroup Database
+  */
+Index: mediawiki-1.11.0/maintenance/postgres/tables.sql
+===================================================================
+--- mediawiki-1.11.0/maintenance/postgres/tables.sql	(révision 26041)
++++ mediawiki-1.11.0/maintenance/postgres/tables.sql	(révision 26044)
+@@ -243,7 +243,7 @@
+   img_size         INTEGER   NOT NULL,
+   img_width        INTEGER   NOT NULL,
+   img_height       INTEGER   NOT NULL,
+-  img_metadata     TEXT,
++  img_metadata     BYTEA     NOT NULL  DEFAULT '',
+   img_bits         SMALLINT,
+   img_media_type   TEXT,
+   img_major_mime   TEXT                DEFAULT 'unknown',
+@@ -259,7 +259,7 @@
+ CREATE INDEX img_sha1          ON image (img_sha1);
+ 
+ CREATE TABLE oldimage (
+-  oi_name          TEXT         NOT NULL  REFERENCES image(img_name),
++  oi_name          TEXT         NOT NULL,
+   oi_archive_name  TEXT         NOT NULL,
+   oi_size          INTEGER      NOT NULL,
+   oi_width         INTEGER      NOT NULL,
+@@ -276,6 +276,7 @@
+   oi_deleted       CHAR         NOT NULL DEFAULT '0',
+   oi_sha1          TEXT         NOT NULL DEFAULT ''
+ );
++ALTER TABLE oldimage ADD CONSTRAINT oldimage_oi_name_fkey_cascade FOREIGN KEY (oi_name) REFERENCES image(img_name) ON DELETE CASCADE;
+ CREATE INDEX oi_name_timestamp    ON oldimage (oi_name,oi_timestamp);
+ CREATE INDEX oi_name_archive_name ON oldimage (oi_name,oi_archive_name);
+ CREATE INDEX oi_sha1              ON oldimage (oi_sha1);
+@@ -286,14 +287,14 @@
+   fa_name               TEXT         NOT NULL,
+   fa_archive_name       TEXT,
+   fa_storage_group      VARCHAR(16),
+-  fa_storage_key        CHAR(64),
++  fa_storage_key        TEXT,
+   fa_deleted_user       INTEGER          NULL  REFERENCES mwuser(user_id) ON DELETE SET NULL,
+   fa_deleted_timestamp  TIMESTAMPTZ  NOT NULL,
+   fa_deleted_reason     TEXT,
+   fa_size               SMALLINT     NOT NULL,
+   fa_width              SMALLINT     NOT NULL,
+   fa_height             SMALLINT     NOT NULL,
+-  fa_metadata           TEXT,
++  fa_metadata           BYTEA        NOT NULL  DEFAULT '',
+   fa_bits               SMALLINT,
+   fa_media_type         TEXT,
+   fa_major_mime         TEXT                   DEFAULT 'unknown',
+Index: maintenance/updaters.inc
+===================================================================
+--- mediawiki-1.11.0/maintenance/updaters.inc	(révision 26041)
++++ mediawiki-1.11.0/maintenance/updaters.inc	(révision 26044)
+@@ -1351,6 +1351,9 @@
+ 
+ 	# table, column, desired type, USING clause if needed
+ 	$typechanges = array(
++		array("filearchive",  "fa_metadata",     "bytea", "decode(fa_metadata,'escape')"),
++		array("filearchive",  "fa_storage_key",  "text",  ""),
++		array("image",        "img_metadata",    "bytea", "decode(img_metadata,'escape')"),
+ 		array("image",        "img_size",        "int4",  ""),
+ 		array("image",        "img_width",       "int4",  ""),
+ 		array("image",        "img_height",      "int4",  ""),
+@@ -1457,6 +1460,13 @@
+ 		dbsource(archive($nr[2]));
+ 	}
+ 
++	if ($wgDatabase->hasConstraint("oldimage_oi_name_fkey")) {
++		echo "... change oldimage to CASCADE DELETE on image deletion\n";
++		$wgDatabase->query("ALTER TABLE oldimage DROP CONSTRAINT oldimage_oi_name_fkey");
++		$wgDatabase->query("ALTER TABLE oldimage ADD CONSTRAINT oldimage_oi_name_fkey_cascade ".
++			"FOREIGN KEY (oi_name) REFERENCES image(img_name) ON DELETE CASCADE");
++	}
++
+ 	if (!$wgDatabase->triggerExists("page", "page_deleted")) {
+ 		echo "... create page_deleted trigger\n";
+ 		dbsource(archive('patch-page_deleted.sql'));

Modified: trunk/mediawiki/debian/patches/series
===================================================================
--- trunk/mediawiki/debian/patches/series	2012-04-11 09:15:54 UTC (rev 18278)
+++ trunk/mediawiki/debian/patches/series	2012-04-11 09:15:55 UTC (rev 18279)
@@ -1,3 +1,4 @@
 texvc_location.patch
 mimetypes.patch
 debian_specific_config.patch
+fix_postgre.patch



More information about the evolvis-commits mailing list