View Issue Details

IDProjectCategoryView StatusLast Update
0007191mantisbtdb oraclepublic2014-05-16 15:01
Reportermechantflou Assigned Toryandesign  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionduplicate 
Product Version1.0.3 
Summary0007191: error in filter_api with date filter
Description

this query doesn't work in oracle

SELECT DISTINCT m_bug_tbl.id as id, FROM m_project_tbl, m_bug_tbl
WHERE m_project_tbl.enabled = 1 AND m_project_tbl.id = m_bug_tbl.project_id AND m_bug_tbl.date_submitted BETWEEN '2006-2-1 00:00:00' AND '2006-4-12 23:59:59'

first, I've added a new function in database_api.php

function db_prepare_date( $p_date)
{
$t_db_type = config_get( 'db_type' );

    switch( $t_db_type ) {
        case 'mssql':
        case 'odbc_mssql':
        case 'mysql':
        case 'mysqli':
        case 'postgres':
        case 'postgres64':
        case 'postgres7':
        case 'pgsql':
        return '$p_date';
        case 'oci8':
        return "TO_TIMESTAMP('$p_date','YYYY-MM-DD HH24:MI:SS')";
}
}

then I've modified at the line 520 in filter_api.php
array_push( $t_where_clauses, "($t_bug_table.date_submitted BETWEEN ".db_prepare_date($t_start_string)." AND ".db_prepare_date($t_end_string)." )" );

With all change, date filter can work with oracle

TagsNo tags attached.

Relationships

duplicate of 0007190 closeddregad error in filter_api with date filter 

Activities

chillax

chillax

2006-06-12 18:38

developer   ~0012957

Dupe of 0007190

grangeway

grangeway

2014-05-16 15:01

reporter   ~0040496

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