Last modified: 2013-03-18 10:15:16 UTC
See summary. Steps to reproduce (tested on dewiki): 1) Create a new page. 2) Insert <math>\:</math> (i.e. the medium space in math mode) 3) Click on "Preview" This results in the following error message: "Es ist ein Datenbankfehler aufgetreten. Der Grund kann ein Programmierfehler sein. Die letzte Datenbankabfrage lautete: (Die SQL-Datenbankabfrage ist verborgen.) aus der Funktion „MathRenderer::writeDBEntry“. Die Datenbank meldete den Fehler „1048: Column 'math_outputhash' cannot be null (10.64.16.28)“."
It looks like some error scenario is not being handled, so the hash ends up staying null, and the code tries to write it to the database, which should not happen. Note, it happens on other equations, not only when the equation is *only* a space. E.g. <math>x = h + j \:</math>
if ( $this->hash ) { $outmd5_sql = $dbw->encodeBlob( pack( 'H32', $this->hash ) ); } else { $outmd5_sql = null; } -- Not sure what this is, exactly... math_outputhash varbinary(16) NOT NULL, Wwwwwwwwwhhhhhhhhhhhhhhhhhhhhyyyyyyyyyyyyyyyyyyyyyyyyyyyy?
@Sam that simply wrong. I have used for LaTeXML where I allowed for null values if no math image has been generated. But it should not appear here. If $this->hash is not set this leads to an error as well. I can not reproduce the error: See http://wikidemo.formulasearchengine.com/wiki/46042 I would be highly interested why I can't.
(In reply to comment #3) > @Sam that simply wrong. I pasted the code that's there. Not my fault.
I can reproduce it. That obviously is the code that's there on master: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/Math.git;a=blob;f=MathRenderer.php;h=10676aa91d9d0f843a3b123757d4173dbbb5f2d2;hb=HEAD#l160 Clearly (both from the bug report and looking at the code), null is not getting caught before the DB insert.
@Sam: I didn't want to say that your are wrong. Just wanted to say that the code should not be in the master branch.
@Matthew: Do you get an error or do you see the expected output?
I am also seeing this, and it is hindering my work proofreading scientific texts on wikisource. I created a page on the 4th of March with two medium spaces perfectly fine but now I cannot even delete them or edit the existing page. [http://en.wikisource.org/wiki/Page:Scientific_Memoirs,_Vol._2_(1841).djvu/226]
*** Bug 46080 has been marked as a duplicate of this bug. ***
Yes, when I reproduced it, I got the error.
The problem can also be seen on the German help page for TeX: https://de.wikipedia.org/w/index.php?title=Hilfe_Diskussion:TeX&oldid=115257136
(In reply to comment #11) > The problem can also be seen on the German help page for TeX: > https://de.wikipedia.org/w/index.php?title=Hilfe_Diskussion: > TeX&oldid=115257136 Apparently you "just" have to remove - <math>a_{1</math> - <math>\frak{1}{2}</math> - <math>ä </math> - <math>Oberfläche_\mathrm{Kugel} \, = 4 \pi r^2 </math> - <math>\mathop{\large \sqcap} V</math> - <math>\mathop{\large \sqcup} V</math> - <math>\mathop{\Large \sqcap} V</math> to make that page usable again.
Thank you very much for your input. I can not fix the bug since, I can not reproduce it. http://wikidemo.formulasearchengine.com/wiki/DEDiskussionTex
On pt, i've crossed with this case: http://pt.wikipedia.org/w/index.php?title=Pi&diff=34437603&oldid=34383249 The math code was incorrect, so instead of the usual <math> error red output, there was the db one. Fixing the formula,the problem went away.
Can someone confirm that it is fixed. Rendering the former page leads to the following red text for me: Falhou ao verificar gramática (Erro de sintaxe): x_{i+1} = x_i - {{f(x_i)}} \over {f'(x_i)}} = x_i - {{sin(x_i)}} \over {cos(x_i)}}= x_i - {{tan(x_i)}},
(In reply to comment #15) > Can someone confirm that it is fixed. Apparently, yes. I cannot reproduce the database error in the example originally reported, https://de.wikipedia.org/w/index.php?title=Hilfe_Diskussion:TeX&oldid=115257136 looks fine now, and so does the ptwiki page.
Great. Closing as FIXED.