View Issue Details

IDProjectCategoryView StatusLast Update
0016341mantisbtdb postgresqlpublic2014-05-16 15:02
Reporterdregad Assigned Todregad  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.0 
Target Version1.2.16Fixed in Version1.2.16 
Summary0016341: Impossible to retrieve attachments from DB with PostgreSQL >= 9.0
Description

Attachments stored in the database cannot be downloaded with PostgreSQL >= 9.0.

For example, a sample text file containing 'test' is successfully uploaded; value stored in mantis_bug_file_table.content checked to be OK using DB admin tool (stored internally as '\x74657374').

Trying to view or download the attachment, Mantis shows 't657374'.

Additional Information

Problem does not occur with PostgreSQL 8.4

TagsNo tags attached.

Activities

dregad

dregad

2013-08-30 18:24

developer   ~0037958

PostgreSQL 9.0 introduced a new method for outputting bytea (BLOB) fields: 'hex' [1] which is now the default, replacing the old 'escape' method, and PHP does not properly handle this new format. A PHP bug [2] was opened, but closed as 'Not a bug'.

Recommended workaround is to set bytea_output to 'escape' prior to selecting data from BLOB fields.

[1] http://www.postgresql.org/docs/9.0/interactive/runtime-config-client.html#GUC-BYTEA-OUTPUT
[2] https://bugs.php.net/bug.php?id=59831

dregad

dregad

2013-08-30 18:42

developer   ~0037959

Last edited: 2013-08-30 18:42

Upstream (ADOdb) bug report https://github.com/ADOdb/ADOdb/issues/4

grangeway

grangeway

2014-05-16 15:02

reporter   ~0040512

MantisBT currently supports Mysql and has support for other database engines.

The support for other databases is known to be problematic.

Having implemented the current database layer into Mantis 10 years ago, I'm currently working on replacing the current layer.

If you are interested in using Mantis with non-mysql databases - for example, Oracle, PGSQL or MSSQL, and would be willing to help out testing the new database layer, please drop me an email at paul@mantisforge.org

In the meantime, I'd advise running Mantis with Mysql Only to avoid issues.

Thanks
Paul

Related Changesets

MantisBT: master-1.2.x 49e413b4

2013-08-30 14:10

dregad


Details Diff
ADOdb/pgsql: fix output of bytea fields for PostgreSQL >= 9.0

The new default 'hex' prevents Mantis from displaying the contents of
attachments.

Fixes 0016341
Affected Issues
0016341
mod - library/adodb/drivers/adodb-postgres64.inc.php Diff File

MantisBT: master 1a7759d6

2013-08-30 21:44

dregad


Details Diff
Updated ADOdb to latest upstream commit

Includes PostgreSQL >= 9.0 fix for output of BLOB (bytea) fields.

Fixes 0016341
Affected Issues
0016341
mod - library/adodb Diff File