Breaking the 'math' table setup out to Math extension. Should be the last main step...
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 22 Apr 2011 21:37:16 +0000 (21:37 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 22 Apr 2011 21:37:16 +0000 (21:37 +0000)
The 'math' table will no longer be created on a default install unless you've explicitly enabled the Math plugin at install time; the usual update.php procedure will add it in.

Postgres, Oracle, MSSQL, and DB2 variants are included -- broken out from the core files -- but have not been tested.

I know there has been some code duplication in parser test infrastructure but could only find one instance of the parser test temporary table setup to remove the 'math' table from (the extension adds it back via the hook). If the phpunit-based runner breaks, please track it down and fix it there too.

maintenance/archives/patch-math.sql [deleted file]
maintenance/ibm_db2/tables.sql
maintenance/mssql/tables.sql
maintenance/oracle/tables.sql
maintenance/postgres/tables.sql
maintenance/tables.sql
tests/parser/parserTest.inc

diff --git a/maintenance/archives/patch-math.sql b/maintenance/archives/patch-math.sql
deleted file mode 100644 (file)
index 1d4b90e..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
--- Creates table math used for caching TeX blocks.  Needs to be run
--- on old installations when adding TeX support (2002-12-26)
--- Or, TeX can be disabled via $wgUseTeX=false in LocalSettings.php
-
--- Note: math table has changed, and this script needs to be run again
--- to create it. (2003-02-02)
-
-DROP TABLE IF EXISTS /*$wgDBprefix*/math;
-CREATE TABLE /*$wgDBprefix*/math (
-  -- Binary MD5 hash of the latex fragment, used as an identifier key.
-  math_inputhash varbinary(16) NOT NULL,
-  
-  -- Not sure what this is, exactly...
-  math_outputhash varbinary(16) NOT NULL,
-  
-  -- texvc reports how well it thinks the HTML conversion worked;
-  -- if it's a low level the PNG rendering may be preferred.
-  math_html_conservativeness tinyint NOT NULL,
-  
-  -- HTML output from texvc, if any
-  math_html text,
-  
-  -- MathML output from texvc, if any
-  math_mathml text,
-  
-  UNIQUE KEY math_inputhash (math_inputhash)
-
-) /*$wgDBTableOptions*/;
index af04e64..261a3a2 100644 (file)
@@ -445,15 +445,6 @@ CREATE TABLE watchlist (
 CREATE UNIQUE INDEX wl_user_namespace_title ON watchlist (wl_namespace, wl_title, wl_user);
 
 
-CREATE TABLE math (
-  math_inputhash              VARCHAR(16) FOR BIT DATA     NOT NULL  UNIQUE,
-  math_outputhash             VARCHAR(16) FOR BIT DATA     NOT NULL,
-  math_html_conservativeness  SMALLINT  NOT NULL,
-  math_html                   CLOB(64K) INLINE LENGTH 4096,
-  math_mathml                 CLOB(64K) INLINE LENGTH 4096
-);
-
-
 CREATE TABLE interwiki (
   iw_prefix  VARCHAR(32)      NOT NULL  UNIQUE,
   iw_url     CLOB(64K) INLINE LENGTH 4096      NOT NULL,
index 3d3d359..dca64f1 100644 (file)
@@ -545,18 +545,6 @@ CREATE TABLE /*$wgDBprefix*/watchlist (
 );
 CREATE UNIQUE INDEX /*$wgDBprefix*/namespace_title ON /*$wgDBprefix*/watchlist(wl_namespace,wl_title);
 
---
--- Used by the math module to keep track
--- of previously-rendered items.
---
-CREATE TABLE /*$wgDBprefix*/math (
-   math_inputhash varbinary(16) NOT NULL PRIMARY KEY,
-   math_outputhash varbinary(16) NOT NULL,
-   math_html_conservativeness tinyint NOT NULL,
-   math_html NVARCHAR(MAX),
-   math_mathml NVARCHAR(MAX),
-);
-
 -- Needs fulltext index.
 CREATE TABLE /*$wgDBprefix*/searchindex (
    si_page INT NOT NULL unique REFERENCES /*$wgDBprefix*/page(page_id) ON DELETE CASCADE,
index b8ecc2b..7312bbe 100644 (file)
@@ -405,15 +405,6 @@ CREATE UNIQUE INDEX &mw_prefix.watchlist_u01 ON &mw_prefix.watchlist (wl_user, w
 CREATE INDEX &mw_prefix.watchlist_i01 ON &mw_prefix.watchlist (wl_namespace, wl_title);
 
 
-CREATE TABLE &mw_prefix.math (
-  math_inputhash              VARCHAR2(32)      NOT NULL,
-  math_outputhash             VARCHAR2(32)      NOT NULL,
-  math_html_conservativeness  NUMBER  NOT NULL,
-  math_html                   CLOB,
-  math_mathml                 CLOB
-);
-CREATE UNIQUE INDEX &mw_prefix.math_u01 ON &mw_prefix.math (math_inputhash);
-
 CREATE TABLE &mw_prefix.searchindex (
   si_page      NUMBER NOT NULL,
   si_title     VARCHAR2(255) DEFAULT '' NOT NULL,
index f1e7e93..3482039 100644 (file)
@@ -399,14 +399,6 @@ CREATE TABLE watchlist (
 CREATE UNIQUE INDEX wl_user_namespace_title ON watchlist (wl_namespace, wl_title, wl_user);
 CREATE INDEX wl_user ON watchlist (wl_user);
 
-CREATE TABLE math (
-  math_inputhash              BYTEA     NOT NULL  UNIQUE,
-  math_outputhash             BYTEA     NOT NULL,
-  math_html_conservativeness  SMALLINT  NOT NULL,
-  math_html                   TEXT,
-  math_mathml                 TEXT
-);
-
 
 CREATE TABLE interwiki (
   iw_prefix  TEXT      NOT NULL  UNIQUE,
index 93c4156..81f7424 100644 (file)
@@ -1031,31 +1031,6 @@ CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_ti
 CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title);
 
 
---
--- Used by the math module to keep track
--- of previously-rendered items.
---
-CREATE TABLE /*_*/math (
-  -- Binary MD5 hash of the latex fragment, used as an identifier key.
-  math_inputhash varbinary(16) NOT NULL,
-
-  -- Not sure what this is, exactly...
-  math_outputhash varbinary(16) NOT NULL,
-
-  -- texvc reports how well it thinks the HTML conversion worked;
-  -- if it's a low level the PNG rendering may be preferred.
-  math_html_conservativeness tinyint NOT NULL,
-
-  -- HTML output from texvc, if any
-  math_html text,
-
-  -- MathML output from texvc, if any
-  math_mathml text
-) /*$wgDBTableOptions*/;
-
-CREATE UNIQUE INDEX /*i*/math_inputhash ON /*_*/math (math_inputhash);
-
-
 --
 -- When using the default MySQL search backend, page titles
 -- and text are munged to strip markup, do Unicode case folding,
index 19c291b..b1a4e22 100644 (file)
@@ -707,7 +707,7 @@ class ParserTest {
                        'protected_titles', 'revision', 'text', 'pagelinks', 'imagelinks',
                        'categorylinks', 'templatelinks', 'externallinks', 'langlinks', 'iwlinks',
                        'site_stats', 'hitcounter',     'ipblocks', 'image', 'oldimage',
-                       'recentchanges', 'watchlist', 'math', 'interwiki', 'logging',
+                       'recentchanges', 'watchlist', 'interwiki', 'logging',
                        'querycache', 'objectcache', 'job', 'l10n_cache', 'redirect', 'querycachetwo',
                        'archive', 'user_groups', 'page_props', 'category', 'msg_resource', 'msg_resource_links'
                );