From: Brion Vibber Date: Fri, 22 Apr 2011 21:37:16 +0000 (+0000) Subject: Breaking the 'math' table setup out to Math extension. Should be the last main step... X-Git-Tag: 1.31.0-rc.0~30622 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=5f0afcf1a2fb4ddbd15773c336f97c42aab60812;p=lhc%2Fweb%2Fwiklou.git Breaking the 'math' table setup out to Math extension. Should be the last main step in extension-ification of the math options! 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. --- diff --git a/maintenance/archives/patch-math.sql b/maintenance/archives/patch-math.sql deleted file mode 100644 index 1d4b90e13a..0000000000 --- a/maintenance/archives/patch-math.sql +++ /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*/; diff --git a/maintenance/ibm_db2/tables.sql b/maintenance/ibm_db2/tables.sql index af04e64e9b..261a3a2b45 100644 --- a/maintenance/ibm_db2/tables.sql +++ b/maintenance/ibm_db2/tables.sql @@ -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, diff --git a/maintenance/mssql/tables.sql b/maintenance/mssql/tables.sql index 3d3d3592e5..dca64f17da 100644 --- a/maintenance/mssql/tables.sql +++ b/maintenance/mssql/tables.sql @@ -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, diff --git a/maintenance/oracle/tables.sql b/maintenance/oracle/tables.sql index b8ecc2b96a..7312bbee42 100644 --- a/maintenance/oracle/tables.sql +++ b/maintenance/oracle/tables.sql @@ -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, diff --git a/maintenance/postgres/tables.sql b/maintenance/postgres/tables.sql index f1e7e93365..3482039abc 100644 --- a/maintenance/postgres/tables.sql +++ b/maintenance/postgres/tables.sql @@ -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, diff --git a/maintenance/tables.sql b/maintenance/tables.sql index 93c41565bb..81f7424394 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -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, diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index 19c291b4fc..b1a4e224e1 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -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' );