View Issue Details

IDProjectCategoryView StatusLast Update
0008203mantisbtdb mssqlpublic2014-05-16 15:00
ReporterAngelVel Assigned Tograngeway  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Product Version1.1.0a3 
Summary0008203: Linux with MSSQL DB = bad datetime format
Description

Mantis 1.1.0a3 was installed on Windows Server 2003 with MS SQL 2000 SP3 and working properly (with file upload to disk).
The Mantis files were transferred to Debian Linux, while the DB was kept the same (MS SQL).
Mantis was still working, but the dates were not recognized by it, causing it to handle them as 0 or give error that date() requires the second parameter to be integer, not string.
I fixed it in my version by adding in db_unixtimestamp function to use strtotime() when DB is MS SQL.
Please put some solution in the next Mantis versions.

TagsNo tags attached.

Activities

giallu

giallu

2007-07-27 03:14

reporter   ~0015234

is this the same / caused by 0006240 ?

AngelVel

AngelVel

2007-07-27 04:57

reporter   ~0015236

Last edited: 2007-07-27 05:07

Yes, it looks like 0006240. Sorry, I haven't seen it.
But I don't believe that the format is the same and I don't think that patch from 6240 will work in my case. In 6240 it is about additional ' characters which is not my case. In my case the string that comes from the DB is in different format. I checked the PHP and Mantis settings and they were OK, but the problem still existed. I will also stress that the same source worked under Windows Server 2003 and after copying it to Debian this problem occured, so I suppose that the PHP under Windows and under Linux give different things.

AngelVel

AngelVel

2007-07-27 05:00

reporter   ~0015237

Here is my patch:
function db_unixtimestamp( $p_date=null ) {
global $g_db;

            if ( null !== $p_date ) {
                    $p_timestamp = $g_db->UnixTimeStamp($p_date);
                    $t_db_type = config_get( 'db_type' );
                    if ( $t_db_type == 'mssql' ) {
                            $p_timestamp = strtotime($p_date);
                    }
            } else {
                    $p_timestamp = time();
            }
            return $p_timestamp ;
    }
giallu

giallu

2007-07-27 05:31

reporter   ~0015239

Last edited: 2007-07-27 05:31

If you did not actually try, I would appreciate if you could test the fix in 0006240 and let us know if that works.

AngelVel

AngelVel

2007-07-27 05:41

reporter   ~0015240

The problems are different, thou in the same place. The 6240 cannot help me because I don't have problem with apostrophies, but with the format. I don't think strtotime() can handle the apostrophies, and it works for me.
I can't make test, because our Mantis is in production...

vboctor

vboctor

2007-07-28 03:16

manager   ~0015255

Reminder sent to: grangeway

grangeway, what is your input on this since you are the MS SQL guy :)

grangeway

grangeway

2012-02-05 12:09

reporter   ~0031138

1.2.x stores dates as int's [to get avoid issues like this]

grangeway

grangeway

2014-05-16 15:00

reporter   ~0040375

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