View Issue Details

IDProjectCategoryView StatusLast Update
0023268mantisbtdb oraclepublic2017-10-08 23:52
Reportercproensa Assigned Tocproensa  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version2.6.0 
Target Version2.7.0Fixed in Version2.7.0 
Summary0023268: Error filtering custom fields of type date

With oracle database.
When trying to filter on a custom field of type DATE, an error in sql query occurs.

ORA-00905: missing keyword para la consulta: SELECT Count( DISTINCT ) idcnt FROM m_bug JOIN m_project ON = m_bug.project_id LEFT JOIN m_custom_field_string m_custom_field_string_96 ON = m_custom_field_string_96.bug_id AND m_custom_field_string_96.field_id = 96 WHERE m_project.enabled=:0 AND ( ( m_bug.status in (:1, :2, :3, :4, :5, :6, :7, :8) ) AND ( CAST(COALESCE(NULLIF(m_custom_field_string_96.value, ''), '0') DECIMAL) != 0 AND CAST(COALESCE(NULLIF(m_custom_field_string_96.value, ''), '0') DECIMAL) < 1503784800) )

TagsNo tags attached.


Related Changesets

MantisBT: master 5a523672

2017-08-27 18:34:23


Committer: dregad Details Diff
Fix oracle sql syntax for table alias

Fix the oracle syntax to not remove those "AS" that are part of CAST

Oracle doesn't suppor AS keyword as part of table aliases.
Previous code was modifying the query sql to remove all appearances of
"AS". However, "AS" can also appear as part of a CAST expression:
CAST( x AS y )

Fixes: 0023268
Affected Issues
mod - core/database_api.php Diff File