MantisBT: master 04a5fb5e

Author Committer Branch Timestamp Parent
dregad dregad master 2012-03-09 18:21 master fca6d033
Affected Issues  0014014: Search with number > 2147483647 fails on 64-bit systems with PostgreSQL
Changeset

Fix 0014014: Search number > 2147483647 fails on 64-bit systems

When a numeric search term is entered, the Filter API will only check
for matches in the bug and bugnote id fields when the search term is
within a valid range.

This was never an issue on 32-bit systems, but on 64-bit OS, PostgreSQL
throws an "integer out of range" error when executing the query because
the search term is cast to (int) and PHP_INT_MAX is greater than the
largest value allowed for the numeric DB fields (4-byte int, 2^31-1).

This issue does not exist on MySQL as the value is capped to the maximum
allowed; behavior was not tested on Oracle, DB2 or MSSQL.

The fix for PostgreSQL behavior is a hack, but I can't think of any
better solution (ideally, we should be able to query the DB for the
maximum allowed value for a field).

mod - core/filter_api.php Diff File