View Issue Details

IDProjectCategoryView StatusLast Update
0014095mantisbtdb mssqlpublic2014-05-16 15:00
Reportermarustik Assigned Todregad  
PriorityimmediateSeverityblockReproducibilityalways
Status closedResolutionduplicate 
OSWindows Server 2008 R2OS VersionW2008R2 
Product Version1.2.9 
Summary0014095: Cannot initialize DB on SQL Server 2008 R2
Description

Cannot install Mantis to MS SQL Database. Error messages is:

BAD
ALTER TABLE mantis_tokens_table DROP CONSTRAINT
ALTER TABLE mantis_tokens_table DROP COLUMN timestamp
No errors found

Steps To Reproduce

We have two servers:
SRV-SQL - W2008R2 + SQL2008R2 (default instance)
SRV-MANTIS - W2008R2 + IIS + PHP 5.3.10 (http://php.iis.net/)

I cretaed DB "MANTIS" on SQL server, created user "mantis" and gave him owner righst to DB "MANTIS". Then I went to page http://srv-mantis/mantisbt/admin/install.php and tried to install Mantis to DB but after click at "Install/Upgrade Database" I got this error at command "Schema DropColumnSQL ( mantis_tokens_table )":

BAD
ALTER TABLE mantis_tokens_table DROP CONSTRAINT
ALTER TABLE mantis_tokens_table DROP COLUMN timestamp
No errors found

TagsNo tags attached.
Attached Files
datadict-mssqlnative.inc.php.patch (826 bytes)   
--- D:/wamp/www/www.mantis.local/library/adodb/datadict/datadict-mssqlnative.inc-orig.php	Sat Jun 09 07:29:03 2012
+++ D:/wamp/www/www.mantis.local/library/adodb/datadict/datadict-mssqlnative.inc.php	Tue Aug 07 22:14:30 2012
@@ -189,8 +189,10 @@
 			$rs = $this->connection->Execute( "select name from sys.default_constraints WHERE object_name(parent_object_id) = '" . $tabname ."' AND col_name(parent_object_id, parent_column_id) = '" . $v . "'");
 			if ( is_object($rs) ) {
 				$row = $rs->FetchRow();
-				$constraintname = $row[0];
-				$sql[] = 'ALTER TABLE '.$tabname.' DROP CONSTRAINT '. $constraintname;
+				if ($row) {
+					$constraintname = $row[0];
+					$sql[] = 'ALTER TABLE '.$tabname.' DROP CONSTRAINT '. $constraintname;
+				}
 			}
 		
 			$f[] = "\n$this->dropCol ".$this->NameQuote($v);

Relationships

duplicate of 0011524 closeddregad 1.2.0rc2 with MS SQL not installable 
related to 0015454 closeddregad installation errors with SQLServer 

Activities

tomkraw1

tomkraw1

2012-08-07 16:25

reporter   ~0032494

Last edited: 2012-08-07 16:28

I had the same problem. I use WampServer, SQL Server Native driver and SQL Server 2005 Express and MantisBT v.1.2.11.

I was able to install Mantis adding one condition to the <INSTALL_DIR>library\adodb\datadict\datadict-mssqlnative.inc.php file.
Just apply my patch.

It changes the DropColumnSQL method but I think the same condition should be added to the AlterColumnSQL method.

dregad

dregad

2013-02-18 05:38

developer   ~0035199

Resolving as duplicate, please follow up in 0011524

grangeway

grangeway

2014-05-16 15:00

reporter   ~0040355

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