Page MenuHomePhabricator

binary md5 in Math.php break in postgreSQL
Closed, ResolvedPublic

Description

Reported by Timonator on irc:

pg_query() [function.pg-query]: Query failed:
ERROR: invalid byte sequence for encoding "UTF8": 0x9a
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". in ./includes/DatabasePostgres.php on line 389

A database error has occurred Query: SELECT
math_outputhash,math_html_conservativeness,math_html,math_mathml FROM math WHERE
math_inputhash = '\x06zfsq`X��y���.�V ' LIMIT 1 Function: MathRenderer::_recall
Error: 1 ERROR: invalid byte sequence for encoding "UTF8": 0x9a HINT: This error
can also happen if the byte sequence does not match the encoding expected by the
server, which is controlled by "client_encodin

This is caused by pack() used to store the md5 hash as a binary field
in the database.


Version: 1.10.x
Severity: major

Details

Reference
bz8716

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:35 PM
bzimport set Reference to bz8716.
bzimport added a subscriber: Unknown Object (MLST).

pomac wrote:

remove the pack and unpack and it works, why pack at all? A md5 sum should
always work.
to me this looks like a useless operation while it might act as compression.

cedric.villemain wrote:

else use a bytea data type

While I agree the pack and unpack seems a little silly to save a few characters,
I've changed the two database fields to bytea for now: r20542

robchur wrote:

*** Bug 9546 has been marked as a duplicate of this bug. ***

  • Bug 10321 has been marked as a duplicate of this bug. ***
Jdforrester-WMF subscribed.

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