View Issue Details

IDProjectCategoryView StatusLast Update
0020483mantisbtdb postgresqlpublic2016-06-12 00:42
ReportercproensaAssigned Tocproensa 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.3.0-rc.1 
Target Version1.3.0-rc.2Fixed in Version1.3.0-rc.2 
Summary0020483: Error 401 with PostgreSQL manage_user_page
Description

Using PostgreSQL, on manage_user_page
selecting:
Hide Inactive = ON
Show Disabled = OFF

The query fails with attached message

Additional Information
APPLICATION ERROR 0000401
Database query failed. Error received from database was #-1: ERROR: operator does not exist: boolean < integer
LINE 3: AND ($1 < last_visit + 604800)
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. for the query: SELECT * FROM mantis_user_table
WHERE (1 = 1) AND enabled = $1
AND ($1 < last_visit + 604800)
ORDER BY username ASC.
TagsNo tags attached.

Relationships

related to 0020479 closeddregad Error 401 db_query bind params starts with $2 
related to 0020894 closeddregad APPLICATION ERROR 401 @ user_edit_page when changing Accesslevel 

Activities

Related Changesets

MantisBT: master 4192d571

2016-01-07 15:13:05

cproensa


Committer: dregad Details Diff
Fix pgsql query error manage_user_page

Due to pgsql having positional parameters in parametrized queries, the
page is throwing an error in some combination of conditions.

The error is caused by the reutilization of a prepared WHERE condition
in a string from previous query. In the new query, a db_param() call is
issued, which has the parameter reset to 1 (returning "$1"). Then,
the resulting query string contains two "$1" parameters for different
values.

With this commit, the query build code is cleaned to avoid said
situation.

Fixes 0020483

Signed-off-by: Damien Regad <dregad@mantisbt.org>
mod - manage_user_page.php Diff File

Issue History

Date Modified Username Field Change
2016-01-06 18:54 cproensa New Issue
2016-01-07 15:41 cproensa Note Added: 0052273
2016-01-08 04:58 dregad Changeset attached => MantisBT master 4192d571
2016-01-08 04:58 dregad Assigned To => dregad
2016-01-08 04:58 dregad Status new => resolved
2016-01-08 04:58 dregad Resolution open => fixed
2016-01-08 04:58 dregad Fixed in Version => 1.3.0-rc.2
2016-01-08 04:59 dregad Assigned To dregad => community
2016-01-08 04:59 dregad Category sql => db postgresql
2016-01-08 04:59 dregad Target Version => 1.3.0-rc.2
2016-01-08 08:37 dregad Relationship added related to 0020479
2016-01-19 15:21 atrol Assigned To community => cproensa
2016-05-10 09:00 dregad Relationship added related to 0020894
2016-06-12 00:42 vboctor Status resolved => closed