Page MenuHomePhabricator

Enabling math with postgres, leads to error
Closed, ResolvedPublic

Description

Author: papadako

Description:
A database error has occurred Query: SELECT
math_outputhash,math_html_conservativeness,math_html,math_mathml FROM math WHERE
math_inputhash = '��׾�\x1f\x11��\x12@\x01˵' LIMIT 1 Function: MathRenderer::_recall Error: 1
ERROR: invalid byte sequence for encoding "UTF8": 0xebc3d7 HINT: This error can
also happen if the byte sequence does not match the encoding expected by the
server, which is controlled by "client_encoding".

Backtrace:

#0 /var/www/apache2-default/includes/Database.php(665):
DatabasePostgres->reportQueryError('ERROR: invalid...', 1, 'SELECT math_ou...',
'MathRenderer::_...', false)
#1 /var/www/apache2-default/includes/Database.php(1057): Database->query('SELECT
math_ou...', 'MathRenderer::_...')
#2 /var/www/apache2-default/includes/Database.php(1076):
Database->select('math', Array, Array, 'MathRenderer::_...', Array)
#3 /var/www/apache2-default/includes/Math.php(193): Database->selectRow('math',
Array, Array, 'MathRenderer::_...')
#4 /var/www/apache2-default/includes/Math.php(46): MathRenderer->_recall()
#5 /var/www/apache2-default/includes/Math.php(271): MathRenderer->render()
#6 /var/www/apache2-default/includes/Parser.php(589):
MathRenderer::renderMath('a^2')
#7 /var/www/apache2-default/includes/Parser.php(299): Parser->strip('== Status

?<b...', Object(StripState))

#8 /var/www/apache2-default/includes/EditPage.php(1452): Parser->parse('==
Status ==?<b...', Object(Title), Object(ParserOptions))
#9 /var/www/apache2-default/includes/EditPage.php(992): EditPage->getPreviewText()
#10 /var/www/apache2-default/includes/EditPage.php(429): EditPage->showEditForm()
#11 /var/www/apache2-default/includes/EditPage.php(267): EditPage->edit()
#12 /var/www/apache2-default/includes/Wiki.php(417): EditPage->submit()
#13 /var/www/apache2-default/includes/Wiki.php(50):
MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title),
Object(User), Object(WebRequest))
#14 /var/www/apache2-default/index.php(48): MediaWiki->initialize(Object(Title),
Object(OutputPage), Object(User), Object(WebRequest))
#15 {main}


Version: 1.9.x
Severity: normal
OS: Linux
Platform: PC

Details

Reference
bz9444

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
InvalidNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:36 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz9444.
bzimport added a subscriber: Unknown Object (MLST).
  • Bug 9445 has been marked as a duplicate of this bug. ***

papadako wrote:

Sorry for the duplicate.

jpotkanski wrote:

Seeing the same issue at Citizendium. Attaching workaround...It's ugly.

jpotkanski wrote:

Workaround for bug 9444 that disables caching of tex images to DB

Performance wise, this workaround is ugly. Images will be rendered every time a
user hits the page.

Attached:

jpotkanski wrote:

Diff for Math.php, adds UTF8 encoding

This patch works on postgresql, adds utf8_encode to hash database writes. Reads
seem to be unaffected.

Have not/unable to test code for other database backends.

Attached:

papadako wrote:

Yep, it works also here!

robchur wrote:

This should be fixed in 1.10.

Jdforrester-WMF subscribed.

Migrating from the old tracking task to a tag for PostgreSQL-related tasks.