From d9522b604982f38760ee965f8a2190d2009db8af Mon Sep 17 00:00:00 2001 From: "physikerwelt (Moritz Schubotz)" Date: Thu, 6 Nov 2014 21:06:19 +0100 Subject: [PATCH] Increase size of the math_mathml in the mathlatexml table The type text allows text with maximum length of 64k only. Since the MathML generated by LaTeXML is quite verbose this is too small for some equations used at Wikipedia. Bug: 73090 Change-Id: Id09ec6201f68efe63a439f6e85a53876d5c1e521 --- Math.hooks.php | 4 ++++ db/mathlatexml.mysql.sql | 2 +- db/patches/mathlatexml.mathml-length-adjustment.mysql.sql | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 db/patches/mathlatexml.mathml-length-adjustment.mysql.sql diff --git a/Math.hooks.php b/Math.hooks.php index 6749a79..213ac8f 100644 --- a/Math.hooks.php +++ b/Math.hooks.php @@ -232,6 +232,10 @@ class MathHooks { if ( in_array( $type, array( 'mysql', 'sqlite', 'postgres' ) ) ) { $sql = dirname( __FILE__ ) . '/db/mathlatexml.' . $type . '.sql'; $updater->addExtensionTable( 'mathlatexml', $sql ); + if ( $type == 'mysql' ){ + $sql = dirname( __FILE__ ) . '/db/patches/mathlatexml.mathml-length-adjustment.mysql.sql'; + $updater->modifyExtensionField( 'mathlatexml', 'math_mathml', $sql ); + } } else { throw new MWException( "Math extension does not currently support $type database for LaTeXML." ); } diff --git a/db/mathlatexml.mysql.sql b/db/mathlatexml.mysql.sql index 89d8a6c..38ded24 100644 --- a/db/mathlatexml.mysql.sql +++ b/db/mathlatexml.mysql.sql @@ -10,7 +10,7 @@ CREATE TABLE /*_*/mathlatexml ( -- the validated tex math_tex text, -- MathML output LaTeXML - math_mathml text, + math_mathml mediumtext, -- SVG output mathoid math_svg text, -- MW_MATHSTYLE_(INLINE_DISPLAYSTYLE|DISPLAY|INLINE) diff --git a/db/patches/mathlatexml.mathml-length-adjustment.mysql.sql b/db/patches/mathlatexml.mathml-length-adjustment.mysql.sql new file mode 100644 index 0000000..8bbb86c --- /dev/null +++ b/db/patches/mathlatexml.mathml-length-adjustment.mysql.sql @@ -0,0 +1 @@ +ALTER TABLE /*_*/mathlatexml MODIFY math_mathml mediumtext; \ No newline at end of file