Last modified: 2013-03-18 10:15:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T48042, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 46042 - Use of medium space throws database error
Use of medium space throws database error
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Math (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 46080 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-12 21:02 UTC by Patrik (pajz)
Modified: 2013-03-18 10:15 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Patrik (pajz) 2013-03-12 21:02:37 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)“."
Comment 1 Matthew Flaschen 2013-03-12 21:10:40 UTC
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>
Comment 2 Sam Reed (reedy) 2013-03-12 21:22:26 UTC
			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?
Comment 3 physikerwelt 2013-03-12 21:56:37 UTC
@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.
Comment 4 Sam Reed (reedy) 2013-03-12 21:58:09 UTC
(In reply to comment #3)
> @Sam that simply wrong.

I pasted the code that's there. Not my fault.
Comment 5 Matthew Flaschen 2013-03-12 22:15:35 UTC
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.
Comment 6 physikerwelt 2013-03-12 22:22:48 UTC
@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.
Comment 7 physikerwelt 2013-03-13 13:26:55 UTC
@Matthew: Do you get an error or do you see the expected output?
Comment 8 bugaroosa 2013-03-13 16:37:49 UTC
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]
Comment 9 Sam Reed (reedy) 2013-03-13 18:19:50 UTC
*** Bug 46080 has been marked as a duplicate of this bug. ***
Comment 10 Matthew Flaschen 2013-03-13 18:30:47 UTC
Yes, when I reproduced it, I got the error.
Comment 11 Andre Klapper 2013-03-14 11:23:54 UTC
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
Comment 12 Patrik (pajz) 2013-03-14 12:10:20 UTC
(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.
Comment 13 physikerwelt 2013-03-14 13:24:03 UTC
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
Comment 14 Alchimista 2013-03-14 17:22:49 UTC
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.
Comment 15 physikerwelt 2013-03-17 11:37:36 UTC
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)}},
Comment 16 Patrik (pajz) 2013-03-17 11:55:57 UTC
(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.
Comment 17 Andre Klapper 2013-03-18 10:15:16 UTC
Great. Closing as FIXED.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links